dribbble 1.0.0.beta1 → 1.0.0.beta2

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
  SHA1:
3
- metadata.gz: 85bba0d85d30e2dc9d204fc5200702db45886d01
4
- data.tar.gz: e9c6c9ed96e02be262937fde7bd386f34f829969
3
+ metadata.gz: 0d46c451ba190bda80438f296081283e89c089ac
4
+ data.tar.gz: 0bb8dc6141ec990797129ce5c399b79c369b33d2
5
5
  SHA512:
6
- metadata.gz: 2aca53d14455683154a1f0cd2c34110e44fe4e6ab3cb88d3fd587992ead681107e957e5c99747e207ea3e8273f2a1c6174551cc5fbb995aa45a9a382e8483443
7
- data.tar.gz: 73e565e06a9d4d4947b955175ded0eb7651ceca7a4b5c6eff65120298dedae9098cc36ae80322d36b2cdf1430adeda6e99ec0a80e70c8c00f11532b9b31c68a0
6
+ metadata.gz: f60447a7217a53c00902de8d97990ec3148081dc723dd830880b8815c6ba3a6493e9f24365f2bc1d24a7797dafcbfa1de8d85a1e864f3b6d24ff26e9384b9e61
7
+ data.tar.gz: eb41db304a4d384c7d8d698cbcc25c5ed5159d6095d4d591f765b4786554b47132439c93427b4f8bc2f0f7545c4e659130d4013c74d7d06b57c94b37d20b5f16
data/.travis.yml CHANGED
@@ -3,11 +3,8 @@ language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
5
  - 2.0.0
6
- - 2.1.0
7
6
  - 2.1.5
8
- - 2.2.0-preview2
7
+ - 2.2.0
9
8
 
10
9
  matrix:
11
10
  fast_finish: true
12
- allow_failures:
13
- - rvm: 2.2.0-preview2
data/lib/dribbble/base.rb CHANGED
@@ -8,24 +8,26 @@ module Dribbble
8
8
 
9
9
  include Dribbble::Utils::HasChildren
10
10
 
11
- attr_reader :token
11
+ attr_reader :token, :dribbble_url
12
12
 
13
- def initialize(token, json)
13
+ def initialize(token, json, dribbble_url = '')
14
14
  @token = token
15
+
15
16
  @raw = json.is_a?(Hash) ? json : JSON.parse(json)
17
+ @dribbble_url = build_dribbble_url(@raw['id'].to_s, dribbble_url)
16
18
 
17
- @raw.each do |k, v|
19
+ @raw.each do |k, _v|
18
20
  define_singleton_method(k) { @raw[k] } unless self.respond_to?(k)
19
21
  end
20
22
  end
21
23
 
22
- def self.batch_new(token, json, kind = nil)
24
+ def self.batch_new(token, json, kind = nil, url = '')
23
25
  json = JSON.parse json unless json.is_a? Hash
24
26
  json.map do |obj|
25
27
  if kind
26
- new token, obj[kind]
28
+ new token, obj[kind], url
27
29
  else
28
- new token, obj
30
+ new token, obj, url
29
31
  end
30
32
  end
31
33
  end
@@ -89,5 +91,15 @@ module Dribbble
89
91
  Dribbble::User.new @token, html_get('/user')
90
92
  end
91
93
  end
94
+
95
+ private
96
+
97
+ def build_dribbble_url(id, dribbble_url)
98
+ if dribbble_url.end_with?(id)
99
+ dribbble_url
100
+ else
101
+ "#{dribbble_url}/#{id}"
102
+ end
103
+ end
92
104
  end
93
105
  end
@@ -1,5 +1,9 @@
1
1
  require 'dribbble/base'
2
2
  require 'dribbble/user'
3
+ require 'dribbble/bucket'
4
+ require 'dribbble/project'
5
+ require 'dribbble/shot'
6
+ require 'dribbble/team'
3
7
  require 'dribbble/errors'
4
8
 
5
9
  require 'rest_client'
@@ -1,4 +1,29 @@
1
1
  module Dribbble
2
2
  class Comment < Dribbble::Base
3
+ def self.available_fields
4
+ %i(body)
5
+ end
6
+
7
+ def likes
8
+ url = "#{dribbble_url}/likes"
9
+ Dribbble::Like.batch_new token, html_get(url), nil, url
10
+ end
11
+
12
+ def like?
13
+ html_get "#{dribbble_url}/like"
14
+ true
15
+ rescue RestClient::ResourceNotFound
16
+ false
17
+ end
18
+
19
+ def like!
20
+ res = html_post "#{dribbble_url}/like"
21
+ res.code == 201 ? true : false
22
+ end
23
+
24
+ def unlike!
25
+ res = html_delete "#{dribbble_url}/like"
26
+ res.code == 204 ? true : false
27
+ end
3
28
  end
4
29
  end
data/lib/dribbble/shot.rb CHANGED
@@ -29,19 +29,6 @@ module Dribbble
29
29
  res.code == 202 ? res.headers[:location].split('/').last : false
30
30
  end
31
31
 
32
- def create_attachment(attrs = {})
33
- res = html_post "/shots/#{id}/attachments" do |payload|
34
- Dribbble::Attachment.available_fields.each do |field|
35
- payload[field] = attrs[field]
36
- end
37
- end
38
- res.code == 202 ? true : false
39
- end
40
-
41
- def find_attachment(attachment_id)
42
- Dribbble::Attachment.new token, html_get("/shots/#{id}/attachments/#{attachment_id}")
43
- end
44
-
45
32
  def like?
46
33
  html_get "/shots/#{id}/like"
47
34
  true
data/lib/dribbble/team.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  module Dribbble
2
2
  class Team < Dribbble::Base
3
+ has_many :members, as: Dribbble::User
4
+ has_many :shots
3
5
  end
4
6
  end
data/lib/dribbble/user.rb CHANGED
@@ -1,8 +1,4 @@
1
1
  require 'dribbble/utils/findable'
2
- require 'dribbble/bucket'
3
- require 'dribbble/project'
4
- require 'dribbble/shot'
5
- require 'dribbble/team'
6
2
 
7
3
  module Dribbble
8
4
  class User < Dribbble::Base
@@ -4,23 +4,62 @@ module Dribbble
4
4
  module ClassMethods
5
5
  def has_many(*fields)
6
6
  if fields[1].is_a? Hash
7
- field = fields[0]
8
- singularized_field = field[0...-1]
9
- klass = fields[1][:as]
10
-
11
- define_method field do |attrs = {}|
12
- klass.batch_new token, html_get("/#{pluralized_class_name}/#{id}/#{klass.pluralized_class_name}", attrs)
13
- end
7
+ generate_methods fields[0], fields[1][:as]
14
8
  else
15
9
  fields.each do |field|
16
- cheat = field
10
+ generate_methods field
11
+ end
12
+ end
13
+ end
17
14
 
18
- define_method cheat do |attrs = {}|
19
- singularized_field = cheat[0...-1]
20
- klass = Object.const_get "Dribbble::#{singularized_field.capitalize}"
21
- klass.batch_new token, html_get("/#{pluralized_class_name}/#{id}/#{klass.pluralized_class_name}", attrs)
15
+ def generate_methods(field, klass = nil)
16
+ singularized_field = field[0...-1]
17
+
18
+ define_method field do |attrs = {}|
19
+ klass ||= Object.const_get "Dribbble::#{__method__[0...-1].capitalize}"
20
+ url = "/#{pluralized_class_name}/#{id}/#{field}"
21
+ klass.batch_new token, html_get(url, attrs), nil, url
22
+ end
23
+
24
+ define_method "find_#{singularized_field}" do |child_id|
25
+ klass ||= Object.const_get "Dribbble::#{__method__[0...-1].capitalize}"
26
+ url = "/#{pluralized_class_name}/#{id}/#{field}/#{child_id}"
27
+ klass.new token, html_get(url), url
28
+ end
29
+
30
+ define_method "create_#{singularized_field}" do |attrs = {}|
31
+ klass ||= Object.const_get "Dribbble::#{__method__[0...-1].capitalize}"
32
+ url = "/#{pluralized_class_name}/#{id}/#{field}"
33
+ res = html_post url do |payload|
34
+ klass.available_fields.each do |field|
35
+ payload[field] = attrs[field]
36
+ end
37
+ end
38
+ case res.code
39
+ when 202
40
+ return true
41
+ when 201
42
+ return klass.new token, res, url
43
+ else
44
+ return false
45
+ end
46
+ end
47
+
48
+ define_method "update_#{singularized_field}" do |child_id, attrs = {}|
49
+ klass ||= Object.const_get "Dribbble::#{__method__[0...-1].capitalize}"
50
+ url = "/#{pluralized_class_name}/#{id}/#{klass.pluralized_class_name}/#{child_id}"
51
+ res = html_put url do |payload|
52
+ klass.available_fields.each do |field|
53
+ payload[field] = attrs[field]
22
54
  end
23
55
  end
56
+ klass.new token, res, url
57
+ end
58
+
59
+ define_method "delete_#{singularized_field}" do |child_id|
60
+ klass ||= Object.const_get "Dribbble::#{__method__[0...-1].capitalize}"
61
+ res = html_delete "/#{pluralized_class_name}/#{id}/#{klass.pluralized_class_name}/#{child_id}"
62
+ res.code == 204 ? true : false
24
63
  end
25
64
  end
26
65
  end
@@ -8,7 +8,7 @@ module Dribbble
8
8
  }
9
9
 
10
10
  def class_name
11
- @_class_name ||= respond_to?(:name) ? name.split('::').last.downcase : self.class.name.split('::').last.downcase
11
+ @_class_name ||= self.is_a?(Class) ? name.split('::').last.downcase : self.class.name.split('::').last.downcase
12
12
  end
13
13
 
14
14
  def pluralized_class_name
@@ -1,4 +1,4 @@
1
1
  # Dribbble Version
2
2
  module Dribbble
3
- VERSION = '1.0.0.beta1'
3
+ VERSION = '1.0.0.beta2'
4
4
  end
@@ -0,0 +1,77 @@
1
+ require 'spec_helper'
2
+
3
+ RAW_COMMENT = data_from_json 'comment_success.json'
4
+
5
+ describe Dribbble::Comment do
6
+ describe 'on instance' do
7
+ before :all do
8
+ @comment = Dribbble::Comment.new 'valid_token', RAW_COMMENT, '/shots/471756/comments'
9
+ end
10
+
11
+ describe 'after initialization' do
12
+ RAW_COMMENT.each do |field, value|
13
+ it "respond to #{field}" do
14
+ expect(@comment.send field).to eq(value)
15
+ end
16
+ end
17
+ end
18
+
19
+ describe 'on #likes' do
20
+ subject do
21
+ stub_dribbble :get, '/shots/471756/comments/1145736/likes', DribbbleAPI::CommentLikesSuccess
22
+ @comment.likes
23
+ end
24
+
25
+ it 'return a user' do
26
+ expect(subject.first).to be_a Dribbble::Like
27
+ expect(subject.first.user).to be_a Dribbble::User
28
+ end
29
+ end
30
+
31
+ describe 'on #like?' do
32
+ describe 'on a not liked shot' do
33
+ subject do
34
+ stub_dribbble :get, '/shots/471756/comments/1145736/like', DribbbleAPI::CommentLikeNotFound
35
+ @comment.like?
36
+ end
37
+
38
+ it 'return a user' do
39
+ expect(subject).to be_falsy
40
+ end
41
+ end
42
+
43
+ describe 'on a liked shot' do
44
+ subject do
45
+ stub_dribbble :get, '/shots/471756/comments/1145736/like', DribbbleAPI::CommentLikeSuccess
46
+ @comment.like?
47
+ end
48
+
49
+ it 'return a user' do
50
+ expect(subject).to be_truthy
51
+ end
52
+ end
53
+ end
54
+
55
+ describe 'on #like!' do
56
+ subject do
57
+ stub_dribbble :post, '/shots/471756/comments/1145736/like', DribbbleAPI::CommentLikeCreated
58
+ @comment.like!
59
+ end
60
+
61
+ it 'return true' do
62
+ expect(subject).to be_truthy
63
+ end
64
+ end
65
+
66
+ describe 'on #unlike!' do
67
+ subject do
68
+ stub_dribbble :delete, '/shots/471756/comments/1145736/like', DribbbleAPI::CommentLikeDeleted
69
+ @comment.unlike!
70
+ end
71
+
72
+ it 'return true' do
73
+ expect(subject).to be_truthy
74
+ end
75
+ end
76
+ end
77
+ end
@@ -55,13 +55,26 @@ describe Dribbble::Shot do
55
55
  end
56
56
 
57
57
  describe 'create' do
58
- subject do
59
- stub_dribbble :post, '/shots/471756/attachments', DribbbleAPI::Accepted
60
- @shot.create_attachment
58
+ describe 'when shot is accepted' do
59
+ subject do
60
+ stub_dribbble :post, '/shots/471756/attachments', DribbbleAPI::Accepted
61
+ @shot.create_attachment
62
+ end
63
+
64
+ it 'works' do
65
+ expect(subject).to eq(true)
66
+ end
61
67
  end
62
68
 
63
- it 'works' do
64
- expect(subject).to be_truthy
69
+ describe 'with a 422 error' do
70
+ subject do
71
+ stub_dribbble :post, '/shots/471756/attachments', DribbbleAPI::Unprocessable
72
+ @shot.create_attachment
73
+ end
74
+
75
+ it 'works' do
76
+ expect { subject }.to raise_error(Dribbble::Error::Unprocessable)
77
+ end
65
78
  end
66
79
  end
67
80
 
@@ -76,6 +89,17 @@ describe Dribbble::Shot do
76
89
  expect(subject.id).to eq(206_165)
77
90
  end
78
91
  end
92
+
93
+ describe 'delete' do
94
+ subject do
95
+ stub_dribbble :delete, '/shots/471756/attachments/206165', DribbbleAPI::AttachmentDeleted
96
+ @shot.delete_attachment 206_165
97
+ end
98
+
99
+ it 'return true' do
100
+ expect(subject).to eq(true)
101
+ end
102
+ end
79
103
  end
80
104
 
81
105
  describe 'on #buckets' do
@@ -90,13 +114,62 @@ describe Dribbble::Shot do
90
114
  end
91
115
 
92
116
  describe 'on #comments' do
93
- subject do
94
- stub_dribbble :get, '/shots/471756/comments', DribbbleAPI::CommentsSuccess
95
- @shot.comments
117
+ describe 'all' do
118
+ subject do
119
+ stub_dribbble :get, '/shots/471756/comments', DribbbleAPI::CommentsSuccess
120
+ @shot.comments
121
+ end
122
+
123
+ it 'return comments' do
124
+ expect(subject.first).to be_a Dribbble::Comment
125
+ end
96
126
  end
97
127
 
98
- it 'return a shot' do
99
- expect(subject.first).to be_a Dribbble::Comment
128
+ describe 'create' do
129
+ subject do
130
+ stub_dribbble :post, '/shots/471756/comments', DribbbleAPI::CommentCreated
131
+ @shot.create_comment body: "<p>Could he somehow make the shape of an \"S\" with his arms? I feel like i see potential for some hidden shapes in here...</p>\n\n<p>Looks fun!\n</p>"
132
+ end
133
+
134
+ it 'return a comment' do
135
+ expect(subject).to be_a Dribbble::Comment
136
+ expect(subject.body).to eq("<p>Could he somehow make the shape of an \"S\" with his arms? I feel like i see potential for some hidden shapes in here...</p>\n\n<p>Looks fun!\n</p>")
137
+ end
138
+ end
139
+
140
+ describe 'find' do
141
+ subject do
142
+ stub_dribbble :get, '/shots/471756/comments/1145736', DribbbleAPI::CommentSuccess
143
+ @shot.find_comment 1_145_736
144
+ end
145
+
146
+ it 'return a comment' do
147
+ expect(subject).to be_a Dribbble::Comment
148
+ expect(subject.id).to eq(1_145_736)
149
+ end
150
+ end
151
+
152
+ describe 'update' do
153
+ subject do
154
+ stub_dribbble :put, '/shots/471756/comments/1145736', DribbbleAPI::CommentUpdated
155
+ @shot.update_comment 1_145_736, body: "New body"
156
+ end
157
+
158
+ it 'return a comment' do
159
+ expect(subject).to be_a Dribbble::Comment
160
+ expect(subject.body).to eq("New body")
161
+ end
162
+ end
163
+
164
+ describe 'delete' do
165
+ subject do
166
+ stub_dribbble :delete, '/shots/471756/comments/1145736', DribbbleAPI::CommentDeleted
167
+ @shot.delete_comment 1_145_736
168
+ end
169
+
170
+ it 'return true' do
171
+ expect(subject).to eq(true)
172
+ end
100
173
  end
101
174
  end
102
175
 
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ RAW_TEAM = data_from_json 'team_success.json'
4
+
5
+ describe Dribbble::Team do
6
+ describe 'on instance' do
7
+ before :all do
8
+ @team = Dribbble::Team.new 'valid_token', RAW_TEAM, '/teams/39'
9
+ end
10
+
11
+ describe 'after initialization' do
12
+ RAW_TEAM.each do |field, value|
13
+ it "respond to #{field}" do
14
+ expect(@team.send field).to eq(value)
15
+ end
16
+ end
17
+ end
18
+
19
+ describe 'on #shots' do
20
+ subject do
21
+ stub_dribbble :get, '/teams/39/shots', DribbbleAPI::ShotsSuccess
22
+ @team.shots
23
+ end
24
+
25
+ it 'responds with shots' do
26
+ expect(subject.size).to eq 2
27
+ expect(subject.first).to be_a Dribbble::Shot
28
+ end
29
+ end
30
+
31
+ describe 'on #members' do
32
+ subject do
33
+ stub_dribbble :get, '/teams/39/members', DribbbleAPI::UsersSuccess
34
+ @team.members
35
+ end
36
+
37
+ it 'responds with members' do
38
+ expect(subject.size).to eq 1
39
+ expect(subject.first).to be_a Dribbble::User
40
+ end
41
+ end
42
+ end
43
+ end
@@ -92,15 +92,66 @@ module DribbbleAPI
92
92
  end
93
93
  end
94
94
 
95
+ class Unprocessable < Base
96
+ def status_code
97
+ 422
98
+ end
99
+
100
+ protected
101
+
102
+ def json_response
103
+ content_type :json
104
+ status status_code
105
+ headers response_headers
106
+
107
+ {
108
+ message: "Validation failed.",
109
+ errors: [
110
+ { attribute: "user", message: "reached the daily limit of 5 shots" }
111
+ ]
112
+ }.to_json
113
+ end
114
+ end
115
+
95
116
  class AttachmentsSuccess < Found
96
117
  end
97
118
 
98
119
  class AttachmentSuccess < Found
99
120
  end
100
121
 
122
+ class AttachmentDeleted < Deleted
123
+ end
124
+
101
125
  class CommentsSuccess < Found
102
126
  end
103
127
 
128
+ class CommentSuccess < Found
129
+ end
130
+
131
+ class CommentCreated < Created
132
+ end
133
+
134
+ class CommentUpdated < Updated
135
+ end
136
+
137
+ class CommentDeleted < Deleted
138
+ end
139
+
140
+ class CommentLikesSuccess < Found
141
+ end
142
+
143
+ class CommentLikeSuccess < Found
144
+ end
145
+
146
+ class CommentLikeNotFound < NotFound
147
+ end
148
+
149
+ class CommentLikeCreated < Created
150
+ end
151
+
152
+ class CommentLikeDeleted < Deleted
153
+ end
154
+
104
155
  class CurrentUserSuccess < Found
105
156
  end
106
157
 
@@ -186,4 +237,7 @@ module DribbbleAPI
186
237
 
187
238
  class UserSuccess < Found
188
239
  end
240
+
241
+ class UsersSuccess < Found
242
+ end
189
243
  end
@@ -0,0 +1,38 @@
1
+ {
2
+ "id" : 1145736,
3
+ "body" : "<p>Could he somehow make the shape of an \"S\" with his arms? I feel like i see potential for some hidden shapes in here...</p>\n\n<p>Looks fun!\n</p>",
4
+ "likes_count" : 1,
5
+ "likes_url" : "https://api.dribbble.com/v1/shots/471756/comments/1145736/likes",
6
+ "created_at" : "2012-03-15T04:24:39Z",
7
+ "updated_at" : "2012-03-15T04:24:39Z",
8
+ "user" : {
9
+ "id" : 1,
10
+ "name" : "Dan Cederholm",
11
+ "username" : "simplebits",
12
+ "html_url" : "https://dribbble.com/simplebits",
13
+ "avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/1/avatars/normal/dc.jpg?1371679243",
14
+ "bio" : "Co-founder &amp; designer of <a href=\"https://dribbble.com/dribbble\">@Dribbble</a>. Principal of SimpleBits. Aspiring clawhammer banjoist.",
15
+ "location" : "Salem, MA",
16
+ "links" : {
17
+ "web" : "http://simplebits.com",
18
+ "twitter" : "https://twitter.com/simplebits"
19
+ },
20
+ "buckets_count" : 10,
21
+ "followers_count" : 29262,
22
+ "followings_count" : 1728,
23
+ "likes_count" : 34954,
24
+ "projects_count" : 8,
25
+ "shots_count" : 214,
26
+ "teams_count" : 1,
27
+ "type" : "User",
28
+ "pro" : true,
29
+ "buckets_url" : "https://dribbble.com/v1/users/1/buckets",
30
+ "followers_url" : "https://dribbble.com/v1/users/1/followers",
31
+ "following_url" : "https://dribbble.com/v1/users/1/following",
32
+ "likes_url" : "https://dribbble.com/v1/users/1/likes",
33
+ "shots_url" : "https://dribbble.com/v1/users/1/shots",
34
+ "teams_url" : "https://dribbble.com/v1/users/1/teams",
35
+ "created_at" : "2009-07-08T02:51:22Z",
36
+ "updated_at" : "2014-02-22T17:10:33Z"
37
+ }
38
+ }
@@ -0,0 +1,40 @@
1
+ [
2
+ {
3
+ "id" : 24400091,
4
+ "created_at" : "2014-01-06T17:19:59Z",
5
+ "user" : {
6
+ "id" : 1,
7
+ "name" : "Dan Cederholm",
8
+ "username" : "simplebits",
9
+ "html_url" : "https://dribbble.com/simplebits",
10
+ "avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/1/avatars/normal/dc.jpg?1371679243",
11
+ "bio" : "Co-founder &amp; designer of <a href=\"https://dribbble.com/dribbble\">@Dribbble</a>. Principal of SimpleBits. Aspiring clawhammer banjoist.",
12
+ "location" : "Salem, MA",
13
+ "links" : {
14
+ "web" : "http://simplebits.com",
15
+ "twitter" : "https://twitter.com/simplebits"
16
+ },
17
+ "buckets_count" : 10,
18
+ "comments_received_count" : 3395,
19
+ "followers_count" : 29262,
20
+ "followings_count" : 1728,
21
+ "likes_count" : 34954,
22
+ "likes_received_count" : 27568,
23
+ "projects_count" : 8,
24
+ "rebounds_received_count" : 504,
25
+ "shots_count" : 214,
26
+ "teams_count" : 1,
27
+ "can_upload_shot" : true,
28
+ "type" : "Player",
29
+ "pro" : true,
30
+ "buckets_url" : "https://dribbble.com/v1/users/1/buckets",
31
+ "followers_url" : "https://dribbble.com/v1/users/1/followers",
32
+ "following_url" : "https://dribbble.com/v1/users/1/following",
33
+ "likes_url" : "https://dribbble.com/v1/users/1/likes",
34
+ "shots_url" : "https://dribbble.com/v1/users/1/shots",
35
+ "teams_url" : "https://dribbble.com/v1/users/1/teams",
36
+ "created_at" : "2009-07-08T02:51:22Z",
37
+ "updated_at" : "2014-02-22T17:10:33Z"
38
+ }
39
+ }
40
+ ]
@@ -0,0 +1,38 @@
1
+ {
2
+ "id" : 1145736,
3
+ "body" : "<p>Could he somehow make the shape of an \"S\" with his arms? I feel like i see potential for some hidden shapes in here...</p>\n\n<p>Looks fun!\n</p>",
4
+ "likes_count" : 1,
5
+ "likes_url" : "https://api.dribbble.com/v1/shots/471756/comments/1145736/likes",
6
+ "created_at" : "2012-03-15T04:24:39Z",
7
+ "updated_at" : "2012-03-15T04:24:39Z",
8
+ "user" : {
9
+ "id" : 1,
10
+ "name" : "Dan Cederholm",
11
+ "username" : "simplebits",
12
+ "html_url" : "https://dribbble.com/simplebits",
13
+ "avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/1/avatars/normal/dc.jpg?1371679243",
14
+ "bio" : "Co-founder &amp; designer of <a href=\"https://dribbble.com/dribbble\">@Dribbble</a>. Principal of SimpleBits. Aspiring clawhammer banjoist.",
15
+ "location" : "Salem, MA",
16
+ "links" : {
17
+ "web" : "http://simplebits.com",
18
+ "twitter" : "https://twitter.com/simplebits"
19
+ },
20
+ "buckets_count" : 10,
21
+ "followers_count" : 29262,
22
+ "followings_count" : 1728,
23
+ "likes_count" : 34954,
24
+ "projects_count" : 8,
25
+ "shots_count" : 214,
26
+ "teams_count" : 1,
27
+ "type" : "User",
28
+ "pro" : true,
29
+ "buckets_url" : "https://dribbble.com/v1/users/1/buckets",
30
+ "followers_url" : "https://dribbble.com/v1/users/1/followers",
31
+ "following_url" : "https://dribbble.com/v1/users/1/following",
32
+ "likes_url" : "https://dribbble.com/v1/users/1/likes",
33
+ "shots_url" : "https://dribbble.com/v1/users/1/shots",
34
+ "teams_url" : "https://dribbble.com/v1/users/1/teams",
35
+ "created_at" : "2009-07-08T02:51:22Z",
36
+ "updated_at" : "2014-02-22T17:10:33Z"
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "id" : 1145736,
3
+ "body" : "New body",
4
+ "likes_count" : 1,
5
+ "likes_url" : "https://api.dribbble.com/v1/shots/471756/comments/1145736/likes",
6
+ "created_at" : "2012-03-15T04:24:39Z",
7
+ "updated_at" : "2012-03-15T04:24:39Z",
8
+ "user" : {
9
+ "id" : 1,
10
+ "name" : "Dan Cederholm",
11
+ "username" : "simplebits",
12
+ "html_url" : "https://dribbble.com/simplebits",
13
+ "avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/1/avatars/normal/dc.jpg?1371679243",
14
+ "bio" : "Co-founder &amp; designer of <a href=\"https://dribbble.com/dribbble\">@Dribbble</a>. Principal of SimpleBits. Aspiring clawhammer banjoist.",
15
+ "location" : "Salem, MA",
16
+ "links" : {
17
+ "web" : "http://simplebits.com",
18
+ "twitter" : "https://twitter.com/simplebits"
19
+ },
20
+ "buckets_count" : 10,
21
+ "followers_count" : 29262,
22
+ "followings_count" : 1728,
23
+ "likes_count" : 34954,
24
+ "projects_count" : 8,
25
+ "shots_count" : 214,
26
+ "teams_count" : 1,
27
+ "type" : "User",
28
+ "pro" : true,
29
+ "buckets_url" : "https://dribbble.com/v1/users/1/buckets",
30
+ "followers_url" : "https://dribbble.com/v1/users/1/followers",
31
+ "following_url" : "https://dribbble.com/v1/users/1/following",
32
+ "likes_url" : "https://dribbble.com/v1/users/1/likes",
33
+ "shots_url" : "https://dribbble.com/v1/users/1/shots",
34
+ "teams_url" : "https://dribbble.com/v1/users/1/teams",
35
+ "created_at" : "2009-07-08T02:51:22Z",
36
+ "updated_at" : "2014-02-22T17:10:33Z"
37
+ }
38
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "id" : 39,
3
+ "name" : "Dribbble",
4
+ "username" : "dribbble",
5
+ "html_url" : "https://dribbble.com/dribbble",
6
+ "avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/39/avatars/normal/apple-flat-precomposed.png?1388527574",
7
+ "bio" : "Show and tell for designers. This is Dribbble on Dribbble.",
8
+ "location" : "Salem, MA",
9
+ "links" : {
10
+ "web" : "http://dribbble.com",
11
+ "twitter" : "https://twitter.com/dribbble"
12
+ },
13
+ "followers_count" : 25011,
14
+ "followings_count" : 6120,
15
+ "likes_count" : 44,
16
+ "shots_count" : 91,
17
+ "type" : "Team",
18
+ "pro" : false,
19
+ "buckets_url" : "https://dribbble.com/v1/users/39/buckets",
20
+ "followers_url" : "https://dribbble.com/v1/users/39/followers",
21
+ "likes_url" : "https://dribbble.com/v1/users/39/likes",
22
+ "shots_url" : "https://dribbble.com/v1/users/39/shots",
23
+ "teams_url" : "https://dribbble.com/v1/users/39/teams",
24
+ "created_at" : "2009-08-18T18:34:31Z",
25
+ "updated_at" : "2014-02-14T22:32:11Z"
26
+ }
@@ -0,0 +1,27 @@
1
+ [
2
+ {
3
+ "id" : 483195,
4
+ "name" : "Charley D.",
5
+ "username" : "Calyhre",
6
+ "html_url" : "https://dribbble.com/Calyhre",
7
+ "avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/483195/avatars/normal/493064787.png?1390292526",
8
+ "bio" : "",
9
+ "location" : null,
10
+ "links" : {},
11
+ "followers_count" : 1,
12
+ "followings_count" : 4,
13
+ "likes_count" : 4,
14
+ "shots_count" : 0,
15
+ "type" : "Player",
16
+ "pro" : false,
17
+ "buckets_url" : "https://api.dribbble.com/v1/users/483195/buckets",
18
+ "followers_url" : "https://api.dribbble.com/v1/users/483195/followers",
19
+ "following_url" : "https://api.dribbble.com/v1/users/483195/following",
20
+ "likes_url" : "https://api.dribbble.com/v1/users/483195/likes",
21
+ "projects_url" : "https://api.dribbble.com/v1/users/483195/projects",
22
+ "shots_url" : "https://api.dribbble.com/v1/users/483195/shots",
23
+ "teams_url" : "https://api.dribbble.com/v1/users/483195/teams",
24
+ "created_at" : "2014-01-21T08:22:06Z",
25
+ "updated_at" : "2014-09-29T19:39:00Z"
26
+ }
27
+ ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dribbble
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta1
4
+ version: 1.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Calyhre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-13 00:00:00.000000000 Z
11
+ date: 2015-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -132,17 +132,23 @@ files:
132
132
  - spec/lib/dribbble/base_spec.rb
133
133
  - spec/lib/dribbble/bucket_spec.rb
134
134
  - spec/lib/dribbble/client_spec.rb
135
+ - spec/lib/dribbble/comment_spec.rb
135
136
  - spec/lib/dribbble/project_spec.rb
136
137
  - spec/lib/dribbble/shot_spec.rb
138
+ - spec/lib/dribbble/team_spec.rb
137
139
  - spec/lib/dribbble/user_spec.rb
138
140
  - spec/spec_helper.rb
139
- - spec/support/dribbble.rb
141
+ - spec/support/dribbble_api.rb
140
142
  - spec/support/fixtures/attachment_success.json
141
143
  - spec/support/fixtures/attachments_success.json
142
144
  - spec/support/fixtures/bucket_created.json
143
145
  - spec/support/fixtures/bucket_success.json
144
146
  - spec/support/fixtures/bucket_updated.json
145
147
  - spec/support/fixtures/buckets_success.json
148
+ - spec/support/fixtures/comment_created.json
149
+ - spec/support/fixtures/comment_likes_success.json
150
+ - spec/support/fixtures/comment_success.json
151
+ - spec/support/fixtures/comment_updated.json
146
152
  - spec/support/fixtures/comments_success.json
147
153
  - spec/support/fixtures/current_user_success.json
148
154
  - spec/support/fixtures/followers_success.json
@@ -155,10 +161,12 @@ files:
155
161
  - spec/support/fixtures/shot_success.json
156
162
  - spec/support/fixtures/shot_updated.json
157
163
  - spec/support/fixtures/shots_success.json
164
+ - spec/support/fixtures/team_success.json
158
165
  - spec/support/fixtures/teams_success.json
159
166
  - spec/support/fixtures/unauthorized.json
160
167
  - spec/support/fixtures/user_likes_success.json
161
168
  - spec/support/fixtures/user_success.json
169
+ - spec/support/fixtures/users_success.json
162
170
  homepage: http://github.com/Calyhre/dribbble
163
171
  licenses:
164
172
  - MIT
@@ -187,17 +195,23 @@ test_files:
187
195
  - spec/lib/dribbble/base_spec.rb
188
196
  - spec/lib/dribbble/bucket_spec.rb
189
197
  - spec/lib/dribbble/client_spec.rb
198
+ - spec/lib/dribbble/comment_spec.rb
190
199
  - spec/lib/dribbble/project_spec.rb
191
200
  - spec/lib/dribbble/shot_spec.rb
201
+ - spec/lib/dribbble/team_spec.rb
192
202
  - spec/lib/dribbble/user_spec.rb
193
203
  - spec/spec_helper.rb
194
- - spec/support/dribbble.rb
204
+ - spec/support/dribbble_api.rb
195
205
  - spec/support/fixtures/attachment_success.json
196
206
  - spec/support/fixtures/attachments_success.json
197
207
  - spec/support/fixtures/bucket_created.json
198
208
  - spec/support/fixtures/bucket_success.json
199
209
  - spec/support/fixtures/bucket_updated.json
200
210
  - spec/support/fixtures/buckets_success.json
211
+ - spec/support/fixtures/comment_created.json
212
+ - spec/support/fixtures/comment_likes_success.json
213
+ - spec/support/fixtures/comment_success.json
214
+ - spec/support/fixtures/comment_updated.json
201
215
  - spec/support/fixtures/comments_success.json
202
216
  - spec/support/fixtures/current_user_success.json
203
217
  - spec/support/fixtures/followers_success.json
@@ -210,7 +224,9 @@ test_files:
210
224
  - spec/support/fixtures/shot_success.json
211
225
  - spec/support/fixtures/shot_updated.json
212
226
  - spec/support/fixtures/shots_success.json
227
+ - spec/support/fixtures/team_success.json
213
228
  - spec/support/fixtures/teams_success.json
214
229
  - spec/support/fixtures/unauthorized.json
215
230
  - spec/support/fixtures/user_likes_success.json
216
231
  - spec/support/fixtures/user_success.json
232
+ - spec/support/fixtures/users_success.json