bitbuckit 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 205b2f69c3494870e73646dfb9938d9450e4a88613fd45635c32b2ba93311d5e
4
- data.tar.gz: 4e6c911673b2b2e2af63b7c02654fb54f7c086ca00403d970c195b507dab33c5
3
+ metadata.gz: 273c2eee8296bb89314d1f6a3ae6a8bc38da04b6d2a9b437d0345fe9a602f8d7
4
+ data.tar.gz: 335ddce29746496b1af17a48efde32d6fc6e1d550d2a0aef3d5e4b43b29c4539
5
5
  SHA512:
6
- metadata.gz: d70a6613146f6886db405500d85d4509cb284d6d42a5fe04fdffb4773354418fb6911f6f95aac9784c74059ad7922570e204798b9830b8125260de094ec8b95c
7
- data.tar.gz: 5476893d51e268c4fb8e904ef802bfed3698c3a2550349018fa3e8a7776c4c940697ed196a4e03175d60809954e9bfeb27d6bb7b688d1da7814951d33d880091
6
+ metadata.gz: '0970c8ecb6f21c0280097399235d0296efdec474d6509be710e4531a6e06df90e1b1ea80f966faec22aed0c4b64f7fb7bb2e75fa05c686fe8c5cef62349603e2'
7
+ data.tar.gz: aa2309dd8ff068280533b2c7f50bc8a8e44d15ed36a3bcab4dc081a2013c8fef4ba2a8bab56ece05a96b974b31315b5fd041a742ad78e20ac4bad9e900109d90
data/.gitignore CHANGED
@@ -9,4 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
- .DS_Store
12
+ .DS_Store
13
+ *.gem
data/README.md CHANGED
@@ -27,6 +27,11 @@ client = Bitbuckit::Client.new(:access_token => '[personal_access_token]!')
27
27
 
28
28
  # Get information about the current logged in Bitbucket user
29
29
  client.user
30
+
31
+ # Get commits (1st page)
32
+ commits = bit.commits("atlassian", "atlassian-connect-express")
33
+ # Get next commits
34
+ next_commits = bit.get(bit.last_response.data.next)
30
35
  ```
31
36
 
32
37
  ## Development
@@ -1,6 +1,7 @@
1
1
  require "bitbuckit/connection"
2
2
  require "bitbuckit/default"
3
3
  require "bitbuckit/user"
4
+ require "bitbuckit/client/commits"
4
5
  require "bitbuckit/client/teams"
5
6
  require "bitbuckit/client/users"
6
7
 
@@ -8,6 +9,7 @@ module Bitbuckit
8
9
  class Client
9
10
  include Bitbuckit::Connection
10
11
  include Bitbuckit::Default
12
+ include Bitbuckit::Client::Commits
11
13
  include Bitbuckit::Client::Teams
12
14
  include Bitbuckit::Client::Users
13
15
 
@@ -0,0 +1,9 @@
1
+ module Bitbuckit
2
+ class Client
3
+ module Commits
4
+ def commits(user = nil, repo = nil, options = {})
5
+ get "repositories/#{user}/#{repo}/commits/", options
6
+ end
7
+ end
8
+ end
9
+ end
@@ -6,7 +6,7 @@ module Bitbuckit
6
6
  include Bitbuckit::Authentication
7
7
 
8
8
  def get(url, options = {})
9
- request :get, url, options
9
+ request(:get, url, options).values
10
10
  end
11
11
 
12
12
  def post(url, options = {})
@@ -20,12 +20,12 @@ module Bitbuckit
20
20
  def paginate(url, options = {}, &block)
21
21
  data = request(:get, url, options.dup)
22
22
 
23
- while @last_response.next
24
- @last_response = request(:get, @last_response.next, options.dup)
23
+ while @last_response.data.next
24
+ request(:get, @last_response.data.next, options.dup)
25
25
  if block_given?
26
- yield(data, @last_response)
26
+ yield(data.values, @last_response.data.values)
27
27
  else
28
- data.values.concat(@last_response.values)
28
+ data.values.concat(@last_response.data.values)
29
29
  end
30
30
  end
31
31
 
@@ -62,8 +62,8 @@ module Bitbuckit
62
62
  def request(method, path, data, options = {})
63
63
  opts = { query: data }
64
64
 
65
- @last_response = response = agent.call(method, Addressable::URI.parse(path.to_s).normalize.to_s, data, opts).data
66
- response
65
+ @last_response = response = agent.call(method, Addressable::URI.parse(path.to_s).normalize.to_s, data, opts)
66
+ response.data
67
67
  end
68
68
  end
69
69
  end
@@ -1,3 +1,3 @@
1
1
  module Bitbuckit
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitbuckit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Alves
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-30 00:00:00.000000000 Z
11
+ date: 2019-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sawyer
@@ -95,6 +95,7 @@ files:
95
95
  - lib/bitbuckit.rb
96
96
  - lib/bitbuckit/authentication.rb
97
97
  - lib/bitbuckit/client.rb
98
+ - lib/bitbuckit/client/commits.rb
98
99
  - lib/bitbuckit/client/teams.rb
99
100
  - lib/bitbuckit/client/users.rb
100
101
  - lib/bitbuckit/connection.rb