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 +4 -4
- data/.gitignore +2 -1
- data/README.md +5 -0
- data/lib/bitbuckit/client.rb +2 -0
- data/lib/bitbuckit/client/commits.rb +9 -0
- data/lib/bitbuckit/connection.rb +7 -7
- data/lib/bitbuckit/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 273c2eee8296bb89314d1f6a3ae6a8bc38da04b6d2a9b437d0345fe9a602f8d7
|
4
|
+
data.tar.gz: 335ddce29746496b1af17a48efde32d6fc6e1d550d2a0aef3d5e4b43b29c4539
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0970c8ecb6f21c0280097399235d0296efdec474d6509be710e4531a6e06df90e1b1ea80f966faec22aed0c4b64f7fb7bb2e75fa05c686fe8c5cef62349603e2'
|
7
|
+
data.tar.gz: aa2309dd8ff068280533b2c7f50bc8a8e44d15ed36a3bcab4dc081a2013c8fef4ba2a8bab56ece05a96b974b31315b5fd041a742ad78e20ac4bad9e900109d90
|
data/.gitignore
CHANGED
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
|
data/lib/bitbuckit/client.rb
CHANGED
@@ -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
|
|
data/lib/bitbuckit/connection.rb
CHANGED
@@ -6,7 +6,7 @@ module Bitbuckit
|
|
6
6
|
include Bitbuckit::Authentication
|
7
7
|
|
8
8
|
def get(url, options = {})
|
9
|
-
request
|
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
|
-
|
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)
|
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
|
data/lib/bitbuckit/version.rb
CHANGED
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.
|
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-
|
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
|