tinybucket 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/README.md +38 -36
- data/lib/tinybucket.rb +2 -0
- data/lib/tinybucket/api/helper/api_helper.rb +2 -2
- data/lib/tinybucket/model/branch_restriction.rb +1 -1
- data/lib/tinybucket/model/comment.rb +1 -1
- data/lib/tinybucket/model/commit.rb +1 -1
- data/lib/tinybucket/model/error_response.rb +1 -1
- data/lib/tinybucket/model/page.rb +3 -1
- data/lib/tinybucket/model/profile.rb +1 -1
- data/lib/tinybucket/model/pull_request.rb +1 -1
- data/lib/tinybucket/model/repository.rb +1 -1
- data/lib/tinybucket/model/team.rb +1 -1
- data/lib/tinybucket/version.rb +1 -1
- data/spec/fixtures/repository.json +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f8322d047bde729e02843291178cd774cdf9dda
|
4
|
+
data.tar.gz: fbb59ff442a1a15ba4ef1a37cc744d6120022144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41874e2f618fba8215d7175f0dac4fe1d23a6360552d4bacc93931a144750b908729b70a431fba68637f1bc1b781d1ef3ea6ef785d7d9931174c739be77e7b53
|
7
|
+
data.tar.gz: da85967a81daad9c54231dd23d35d61c1567066fa6fb6b2fe16ced024ccf5d82acd0cc3715125447dee13929b46c1312904548c4be70a839d7a7b9c50c07977c
|
data/README.md
CHANGED
@@ -12,6 +12,8 @@ This gem is inspired by [vongrippen/bitbucket](https://github.com/vongrippen/bit
|
|
12
12
|
[](https://codeclimate.com/github/hirakiuc/tinybucket)
|
13
13
|
[](https://coveralls.io/r/hirakiuc/tinybucket?branch=master)
|
14
14
|
|
15
|
+
[](https://www.omniref.com/ruby/gems/tinybucket)
|
16
|
+
|
15
17
|
## Installation
|
16
18
|
|
17
19
|
Add this line to your application's Gemfile:
|
@@ -45,6 +47,41 @@ bucket = Tinybucket.new do |config|
|
|
45
47
|
end
|
46
48
|
```
|
47
49
|
|
50
|
+
#### teams Endpoint
|
51
|
+
|
52
|
+
```
|
53
|
+
# [x] GET the team profile
|
54
|
+
team = bucket.team('team name')
|
55
|
+
|
56
|
+
# [x] GET the team members
|
57
|
+
members = team.members
|
58
|
+
|
59
|
+
# [x] GET the team followers
|
60
|
+
followers = team.followers
|
61
|
+
|
62
|
+
# [x] GET a list of accounts the team is following
|
63
|
+
following = team.following
|
64
|
+
|
65
|
+
# [x] GET the team's repositories
|
66
|
+
repos = team.repos
|
67
|
+
```
|
68
|
+
|
69
|
+
#### users Endpoint
|
70
|
+
|
71
|
+
```
|
72
|
+
# [x] GET the user profile
|
73
|
+
user = bucket.user('user name')
|
74
|
+
|
75
|
+
# [x] GET the list of followers
|
76
|
+
followers = user.followers
|
77
|
+
|
78
|
+
# [x] GET a list of accounts the user is following
|
79
|
+
followings = user.followings
|
80
|
+
|
81
|
+
# [x] GET the user's repositories
|
82
|
+
repos = user.repos
|
83
|
+
```
|
84
|
+
|
48
85
|
#### repositories Endpoint
|
49
86
|
|
50
87
|
```
|
@@ -104,7 +141,7 @@ commits = pull_request.commits
|
|
104
141
|
# [x] DELETE a pull request approval
|
105
142
|
pull_request.unapprove
|
106
143
|
|
107
|
-
# [
|
144
|
+
# [x] GET the diff for a pull request
|
108
145
|
diff = pull_request.diff
|
109
146
|
|
110
147
|
# [ ] GET the log of all of a repository's pull request activity
|
@@ -185,41 +222,6 @@ diff = repo.diff(COMMIT_ID)
|
|
185
222
|
patch = repo.patch(COMMIT_ID)
|
186
223
|
```
|
187
224
|
|
188
|
-
#### teams Endpoint
|
189
|
-
|
190
|
-
```
|
191
|
-
# [x] GET the team profile
|
192
|
-
team = bucket.team('team name')
|
193
|
-
|
194
|
-
# [x] GET the team members
|
195
|
-
members = team.members
|
196
|
-
|
197
|
-
# [x] GET the team followers
|
198
|
-
followers = team.followers
|
199
|
-
|
200
|
-
# [x] GET a list of accounts the team is following
|
201
|
-
following = team.following
|
202
|
-
|
203
|
-
# [x] GET the team's repositories
|
204
|
-
repos = team.repos
|
205
|
-
```
|
206
|
-
|
207
|
-
#### users Endpoint
|
208
|
-
|
209
|
-
```
|
210
|
-
# [x] GET the user profile
|
211
|
-
user = bucket.user('user name')
|
212
|
-
|
213
|
-
# [x] GET the list of followers
|
214
|
-
followers = user.followers
|
215
|
-
|
216
|
-
# [x] GET a list of accounts the user is following
|
217
|
-
followings = user.followings
|
218
|
-
|
219
|
-
# [x] GET the user's repositories
|
220
|
-
repos = user.repos
|
221
|
-
```
|
222
|
-
|
223
225
|
## Contribution
|
224
226
|
|
225
227
|
1. Fork it ( https://github.com/[my-github-username]/bitbucket/fork )
|
data/lib/tinybucket.rb
CHANGED
@@ -28,6 +28,8 @@ require 'tinybucket/parser'
|
|
28
28
|
require 'tinybucket/request'
|
29
29
|
require 'tinybucket/response'
|
30
30
|
|
31
|
+
require 'uri'
|
32
|
+
|
31
33
|
require 'active_support/notifications'
|
32
34
|
ActiveSupport::Notifications.subscribe('request.faraday') \
|
33
35
|
do |_name, start_time, end_time, _, env|
|
@@ -3,7 +3,7 @@ module Tinybucket
|
|
3
3
|
class BranchRestriction < Base
|
4
4
|
include Tinybucket::Model::Concerns::RepositoryKeys
|
5
5
|
|
6
|
-
attr_accessor :groups, :id, :kind, :links, :pattern, :users
|
6
|
+
attr_accessor :groups, :id, :kind, :links, :pattern, :users, :uuid
|
7
7
|
|
8
8
|
def update(_params)
|
9
9
|
fail NotImplementedError
|
@@ -53,7 +53,9 @@ module Tinybucket
|
|
53
53
|
def load_next
|
54
54
|
fail StopIteration if @attrs[:next].nil? || @next_proc.nil?
|
55
55
|
|
56
|
-
|
56
|
+
unescaped_query = URI.unescape(URI.parse(@attrs[:next]).query)
|
57
|
+
query = Hash[*unescaped_query.split(/&|=/)]
|
58
|
+
list = @next_proc.call(query)
|
57
59
|
|
58
60
|
fail StopIteration if list.items.size == 0
|
59
61
|
|
@@ -7,7 +7,7 @@ module Tinybucket
|
|
7
7
|
attr_accessor \
|
8
8
|
:state, :description, :links, :title, :close_source_branch,
|
9
9
|
:destination, :reason, :id, :source, :created_on, :author, :updated_on,
|
10
|
-
:merge_commit, :closed_by, :reviewers, :participants
|
10
|
+
:merge_commit, :closed_by, :reviewers, :participants, :uuid
|
11
11
|
|
12
12
|
def create(_params)
|
13
13
|
fail NotImplementedError
|
@@ -5,7 +5,7 @@ module Tinybucket
|
|
5
5
|
include Tinybucket::Model::Concerns::Reloadable
|
6
6
|
|
7
7
|
attr_accessor :scm, :has_wiki, :description, :links, :updated_on,
|
8
|
-
:fork_policy, :created_on, :owner, :size, :parent,
|
8
|
+
:fork_policy, :created_on, :owner, :size, :parent, :uuid,
|
9
9
|
:has_issues, :is_private, :full_name, :name, :language
|
10
10
|
|
11
11
|
def create(_params)
|
data/lib/tinybucket/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinybucket
|
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
|
- hirakiuc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -375,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
375
375
|
version: '0'
|
376
376
|
requirements: []
|
377
377
|
rubyforge_project:
|
378
|
-
rubygems_version: 2.
|
378
|
+
rubygems_version: 2.4.4
|
379
379
|
signing_key:
|
380
380
|
specification_version: 4
|
381
381
|
summary: ruby wrapper for the Bitbucket REST API (v2) with oauth
|