bitbuckit 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +37 -7
- data/lib/bitbuckit/client.rb +1 -1
- data/lib/bitbuckit/client/commits.rb +1 -1
- data/lib/bitbuckit/client/teams.rb +6 -2
- data/lib/bitbuckit/connection.rb +11 -7
- data/lib/bitbuckit/version.rb +1 -1
- metadata +2 -3
- data/Gemfile.lock +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25458d7e5d493725228b00afa9581b66fdb7f7fbddddbccfda80166e959504c3
|
4
|
+
data.tar.gz: db09f381eba03a2d4081e6bd4ae55f97d07832cce0380f807c9028254a9b5346
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9ae9a0efebfb4ad770df4273b379014c3621f38d073b79d2834ae0dc3ec3c168bbe673b1f001711bf6f143617736c1c3ef9699ce3e82b055fc1985af1e9bc24
|
7
|
+
data.tar.gz: 173629274ab52f763b90c12cbde27c73d7fd5c9d994c98138d8939f8954874c448e1b187bd813cee5c33c4d55d997314daf39d96c7077e194d0a661a311db0d0
|
data/.gitignore
CHANGED
@@ -1,13 +1,43 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
Gemfile.lock
|
5
|
+
*.bundle
|
6
|
+
*.so
|
7
|
+
*.o
|
8
|
+
*.a
|
9
|
+
mkmf.log
|
10
|
+
app.rb
|
11
|
+
log/
|
12
|
+
*.swp
|
13
|
+
|
14
|
+
features
|
15
|
+
.envrc
|
16
|
+
.byebug_history
|
17
|
+
.ruby-version
|
18
|
+
|
19
|
+
## from github ignore.
|
20
|
+
|
21
|
+
/.config
|
4
22
|
/coverage/
|
5
|
-
/
|
23
|
+
/InstalledFiles
|
6
24
|
/pkg/
|
7
|
-
/spec/reports/
|
8
25
|
/tmp/
|
26
|
+
/spec/reports/
|
27
|
+
|
28
|
+
## Documentation cache and generated files:
|
29
|
+
/.yardoc/
|
30
|
+
/_yardoc/
|
31
|
+
/doc/
|
32
|
+
/rdoc/
|
33
|
+
|
34
|
+
## Environment normalisation:
|
35
|
+
/.bundle/
|
36
|
+
/lib/bundler/man/
|
37
|
+
/vendor/
|
38
|
+
*.iml
|
9
39
|
|
10
40
|
# rspec failure tracking
|
11
41
|
.rspec_status
|
12
|
-
|
13
|
-
|
42
|
+
|
43
|
+
.DS_Store
|
data/lib/bitbuckit/client.rb
CHANGED
@@ -2,11 +2,15 @@ module Bitbuckit
|
|
2
2
|
class Client
|
3
3
|
module Teams
|
4
4
|
def teams(role = "member", options = {})
|
5
|
-
paginate("teams", role: role)
|
5
|
+
paginate("teams", role: role, auto_paginate: true)
|
6
|
+
end
|
7
|
+
|
8
|
+
def team(username, options = {})
|
9
|
+
get "teams/#{username}", options
|
6
10
|
end
|
7
11
|
|
8
12
|
def team_repositories(team, options = {})
|
9
|
-
paginate("repositories/#{team}")
|
13
|
+
paginate("repositories/#{team}", auto_paginate: true)
|
10
14
|
end
|
11
15
|
end
|
12
16
|
end
|
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(:get, url, options)
|
9
|
+
request(:get, url, options)
|
10
10
|
end
|
11
11
|
|
12
12
|
def post(url, options = {})
|
@@ -20,12 +20,14 @@ module Bitbuckit
|
|
20
20
|
def paginate(url, options = {}, &block)
|
21
21
|
data = request(:get, url, options.dup)
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
if options[:auto_paginate]
|
24
|
+
while @last_response.data.next
|
25
|
+
request(:get, @last_response.data.next, options.dup)
|
26
|
+
if block_given?
|
27
|
+
yield(data.values, @last_response.data.values)
|
28
|
+
else
|
29
|
+
data.values.concat(@last_response.data.values)
|
30
|
+
end
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
@@ -63,6 +65,8 @@ module Bitbuckit
|
|
63
65
|
opts = { query: data }
|
64
66
|
|
65
67
|
@last_response = response = agent.call(method, Addressable::URI.parse(path.to_s).normalize.to_s, data, opts)
|
68
|
+
|
69
|
+
puts response.inspect
|
66
70
|
response.data
|
67
71
|
end
|
68
72
|
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.2
|
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-
|
11
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sawyer
|
@@ -85,7 +85,6 @@ files:
|
|
85
85
|
- ".travis.yml"
|
86
86
|
- CODE_OF_CONDUCT.md
|
87
87
|
- Gemfile
|
88
|
-
- Gemfile.lock
|
89
88
|
- LICENSE.txt
|
90
89
|
- README.md
|
91
90
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
bitbuckit (0.1.0)
|
5
|
-
sawyer (~> 0.8.0, >= 0.5.3)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
addressable (2.5.2)
|
11
|
-
public_suffix (>= 2.0.2, < 4.0)
|
12
|
-
diff-lcs (1.3)
|
13
|
-
faraday (0.15.4)
|
14
|
-
multipart-post (>= 1.2, < 3)
|
15
|
-
multipart-post (2.0.0)
|
16
|
-
public_suffix (3.0.3)
|
17
|
-
rake (10.5.0)
|
18
|
-
rspec (3.8.0)
|
19
|
-
rspec-core (~> 3.8.0)
|
20
|
-
rspec-expectations (~> 3.8.0)
|
21
|
-
rspec-mocks (~> 3.8.0)
|
22
|
-
rspec-core (3.8.0)
|
23
|
-
rspec-support (~> 3.8.0)
|
24
|
-
rspec-expectations (3.8.2)
|
25
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
-
rspec-support (~> 3.8.0)
|
27
|
-
rspec-mocks (3.8.0)
|
28
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
-
rspec-support (~> 3.8.0)
|
30
|
-
rspec-support (3.8.0)
|
31
|
-
sawyer (0.8.1)
|
32
|
-
addressable (>= 2.3.5, < 2.6)
|
33
|
-
faraday (~> 0.8, < 1.0)
|
34
|
-
|
35
|
-
PLATFORMS
|
36
|
-
ruby
|
37
|
-
|
38
|
-
DEPENDENCIES
|
39
|
-
bitbuckit!
|
40
|
-
bundler (~> 1.16)
|
41
|
-
rake (~> 10.0)
|
42
|
-
rspec (~> 3.0)
|
43
|
-
|
44
|
-
BUNDLED WITH
|
45
|
-
1.16.2
|