README.md in bitbucket_rest_api2-0.9.1 vs README.md in bitbucket_rest_api2-0.9.5
- old
+ new
@@ -2,10 +2,12 @@
[![Gem Version](https://badge.fury.io/rb/bitbucket_rest_api.png)](http://badge.fury.io/rb/bitbucket_rest_api)
[Wiki](https://github.com/vongrippen/bitbucket/wiki) | [RDocs](http://rubydoc.info/github/vongrippen/bitbucket/master/frames)
+[ ![Codeship Status for codeship/bitbucket](https://www.codeship.io/projects/88f3e870-c528-0130-f653-22e3e5b4ad67/status?branch=master)](https://www.codeship.io/projects/4690)
+
A Ruby wrapper for the BitBucket REST API.
## Installation
Install the gem by issuing
@@ -23,23 +25,23 @@
## Usage
Create a new client instance
```ruby
-bitbucket = BitBucket.new
+bitbucket = BitBucket::Client.new
```
At this stage you can also supply various configuration parameters, such as `:user`,`:repo`, `:oauth_token`, `:oauth_secret`, `:basic_auth` which are used throughout the API. These can be passed directly as hash options:
```ruby
-bitbucket = BitBucket.new oauth_token: 'request_token', oauth_secret: 'request_secret'
+bitbucket = BitBucket::Client.new oauth_token: 'request_token', oauth_secret: 'request_secret'
```
Alternatively, you can configure the BitBucket settings by passing a block:
```ruby
-bitbucket = BitBucket.new do |config|
+bitbucket = BitBucket::Client.new do |config|
config.oauth_token = 'request_token'
config.oauth_secret = 'request_secret'
config.client_id = 'consumer_key'
config.client_secret = 'consumer_secret'
config.adapter = :net_http
@@ -47,20 +49,20 @@
```
You can authenticate either using OAuth authentication or through basic authentication by passing your login and password credentials
```ruby
-bitbucket = BitBucket.new login:'vongrippen', password:'...'
+bitbucket = BitBucket::Client.new login:'vongrippen', password:'...'
```
or use convenience method:
```ruby
-bitbucket = BitBucket.new basic_auth: 'login:password'
+bitbucket = BitBucket::Client.new basic_auth: 'login:password'
```
-You can interact with BitBucket interface, for example repositories, by issuing following calls that correspond directly to the BitBucket API hierarchy
+You can interact with BitBucket interface, for example repositories, by issuing the following calls that correspond directly to the BitBucket API hierarchy
```ruby
bitbucket.repos.changesets.all 'user-name', 'repo-name'
bitbucket.repos.keys.list 'user-name', 'repo-name'
```
@@ -82,23 +84,22 @@
## Advanced Configuration
The `bitbucket_rest_api` gem will use the default middleware stack which is exposed by calling `stack` on client instance. However, this stack can be freely modified with methods such as `insert`, `insert_after`, `delete` and `swap`. For instance to add your `CustomMiddleware` do
```ruby
-bitbucket = BitBucket.new do |config|
- config.stack.insert_after BitBucket::Response::Helpers, CustomMiddleware
+bitbucket = BitBucket::Client.new do |config|
+ config.stack.insert_after CustomMiddleware
end
```
Furthermore, you can build your entire custom stack and specify other connection options such as `adapter`
```ruby
-bitbucket = BitBucket.new do |config|
+bitbucket = BitBucket::Client.new do |config|
config.adapter :excon
config.stack do |builder|
- builder.use BitBucket::Response::Helpers
builder.use BitBucket::Response::Jsonize
end
end
```
@@ -153,11 +154,11 @@
config.basic_auth = 'login:password'
end
or
-BitBucket.new(:oauth_token => YOUR_OAUTH_REQUEST_TOKEN, :oauth_secret => YOUR_OAUTH_REQUEST_TOKEN_SECRET)
-BitBucket.new(:basic_auth => 'login:password')
+BitBucket::Client.new(:oauth_token => YOUR_OAUTH_REQUEST_TOKEN, :oauth_secret => YOUR_OAUTH_REQUEST_TOKEN_SECRET)
+BitBucket::Client.new(:basic_auth => 'login:password')
```
## Development
Questions or problems? Please post them on the [issue tracker](https://bitbucket.com/vongrippen/bitbucket/issues). You can contribute changes by forking the project and submitting a pull request. You can ensure the tests are passing by running `bundle` and `rake`.