New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitbucket2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbucket2

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Bitbucket2

Bitbucket2 is a wrapper gem for the BitBucket API - exploiting the new (2.0) version, and support for OAuth2.

It leverages Restroom (a wrapper meta gem) which was built in parallel to Bitbucket2.

Installation

Add this line to your application's Gemfile:

gem 'bitbucket2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bitbucket2

Usage

Use the Bitbucket2::Client class to get all public repositories like this:

Bitbucket2::Client.new.repositories.all

To collect private data, pass an oauth_token into the configuration:

Bitbucket2.configure do |config|
  config.stack = -> (faraday) {
    #faraday.use :http_cache, store: cache_store
    faraday.request :oauth2, valid_oauth_token
    faraday.response :logger
  }
end

Bitbucket2::Client.new.repositories.all

These tokens can be collected in a variety of ways - the Rakefile provides a number of tasks to facilitate this.

If you have client credentials for BitBucket's OAuth service, you can put them in defaults.yml like this:

credentials:
  key: <key>
  secret: <secret>

...and then run rake oauth - you'll be guided through an authentication cycle and at the end your defaults.yml will have an access token in it.

rake console will then allow you to use that token in a prebuilt client object, via a helper method at Bitbucket2.default_client.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fairfaxmedia/bitbucket2.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 18 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc