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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 393ea9bab17d1e3a7f3cf4b00184d6c1784e0382
4
- data.tar.gz: 44ec580bf75cf03d8f2ebd2c7be9c849056ad954
3
+ metadata.gz: 2f8322d047bde729e02843291178cd774cdf9dda
4
+ data.tar.gz: fbb59ff442a1a15ba4ef1a37cc744d6120022144
5
5
  SHA512:
6
- metadata.gz: 5843cfe10df247993b7122bdffd1f43e31859ed2273ca50d53469b87247532a457e51f35c478773d943eece91a41cee674116f27309a5a1b808cd8709c124c69
7
- data.tar.gz: 94c5af22b08a7944bc9701001fd853b3bf3a0c0b9d05cc1de795056edf042ed09432cc4199e0cf693c6f8d3d72024daebeb5c0e7a8bb94965980ad4fc2aadcc7
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
  [![Code Climate](https://codeclimate.com/github/hirakiuc/tinybucket/badges/gpa.svg)](https://codeclimate.com/github/hirakiuc/tinybucket)
13
13
  [![Coverage Status](https://coveralls.io/repos/hirakiuc/tinybucket/badge.png?branch=master)](https://coveralls.io/r/hirakiuc/tinybucket?branch=master)
14
14
 
15
+ [![tinybucket API Documentation](https://www.omniref.com/ruby/gems/tinybucket.png)](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
- # [ ] GET the diff for a pull request
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 )
@@ -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|
@@ -5,8 +5,8 @@ module Tinybucket
5
5
  private
6
6
 
7
7
  def next_proc(method, options)
8
- lambda do |next_page|
9
- send(method, options.merge(page: next_page))
8
+ lambda do |next_options|
9
+ send(method, options.merge(next_options))
10
10
  end
11
11
  end
12
12
 
@@ -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
@@ -6,7 +6,7 @@ module Tinybucket
6
6
 
7
7
  attr_accessor \
8
8
  :links, :id, :parent, :filename, :content, :user, :inline, \
9
- :created_on, :updated_on
9
+ :created_on, :updated_on, :uuid
10
10
 
11
11
  attr_accessor :commented_to
12
12
 
@@ -6,7 +6,7 @@ module Tinybucket
6
6
 
7
7
  attr_accessor \
8
8
  :hash, :links, :repository, :author, :parents, :date,
9
- :message, :participants
9
+ :message, :participants, :uuid
10
10
 
11
11
  def comments(options = {})
12
12
  comments_api(options).list(options)
@@ -1,7 +1,7 @@
1
1
  module Tinybucket
2
2
  module Model
3
3
  class ErrorResponse < Base
4
- attr_accessor :message, :fields, :detail, :id
4
+ attr_accessor :message, :fields, :detail, :id, :uuid
5
5
  end
6
6
  end
7
7
  end
@@ -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
- list = @next_proc.call(@attrs[:page] + 1)
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
 
@@ -5,7 +5,7 @@ module Tinybucket
5
5
 
6
6
  attr_accessor \
7
7
  :username, :kind, :website, :display_name,
8
- :links, :created_on, :location, :type
8
+ :links, :created_on, :location, :type, :uuid
9
9
 
10
10
  def followers(options = {})
11
11
  user_api(options).followers(options)
@@ -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)
@@ -4,7 +4,7 @@ module Tinybucket
4
4
  include Tinybucket::Model::Concerns::Reloadable
5
5
 
6
6
  attr_accessor \
7
- :username, :kind, :website, :display_name,
7
+ :username, :kind, :website, :display_name, :uuid,
8
8
  :links, :created_on, :location, :type
9
9
 
10
10
  def members(options = {})
@@ -1,3 +1,3 @@
1
1
  module Tinybucket
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -67,5 +67,6 @@
67
67
  "updated_on": "2013-08-26T18:13:07.514065+00:00",
68
68
  "size": 17657351,
69
69
  "is_private": false,
70
- "name": "atlassian-connect-fork"
70
+ "name": "atlassian-connect-fork",
71
+ "uuid": "{XYZ}"
71
72
  }
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.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: 2014-09-15 00:00:00.000000000 Z
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.2.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