behance 0.3.0 → 0.4.0
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 +15 -0
- data/README.md +8 -0
- data/behance.gemspec +1 -1
- data/lib/behance/client.rb +2 -0
- data/lib/behance/fields.rb +17 -0
- data/lib/behance/version.rb +1 -1
- data/spec/behance/fields_spec.rb +31 -0
- data/spec/fixtures/fields.json +26 -0
- metadata +13 -19
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZjM1MjY1NWVlM2EyMTJjYWQ5MGU5NzRmZDE1NzAxOWRiMDMzOTYxMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NGIxZTVjYmFjMDNlNTgzOTAwNWEyMmFhZTg4MmIzZjQwZDkxMDcxNw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YmFjZDMxNDc2NzFiY2NlZDhiZjMzMTI0YjAwZjhlN2MyNWM0MWY1ZWNjMmVk
|
10
|
+
MzRlOWYwYmQwNTY2ZGMwNTk5MTdlMzAwYTkxNTdiMzc0NjJjNDZlOTdhY2Fj
|
11
|
+
Y2U3MTQ0OGQ1ZjE2ZGMwZWQ1NjFjMTAwYjY5MjBhZTZkY2ViZTY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTAxMDNhMjE5ZDE4MTczYTVkYWYzOTFjNmFlYWU3MDk5NjNmOGU0NzQ3ZmFi
|
14
|
+
MzM3NGU2MmZkODhjMWM5NzI2NmJjNjg5ODFiOGI1ZTBhNzYzNmJmYjBjMTcx
|
15
|
+
YWViMWZkMGU0OWJiYmZiNWE0ZjQ4ZDBmNzUzMDljODM5Zjg2NGI=
|
data/README.md
CHANGED
@@ -138,6 +138,14 @@ Once you get it, you'll be able to start playing
|
|
138
138
|
$ client.collection_projects(5074147)
|
139
139
|
$ client.collection_projects(5074147, page: 2)
|
140
140
|
|
141
|
+
### Creative Fields
|
142
|
+
|
143
|
+
[Retrieve all Creative Fields][fields]
|
144
|
+
|
145
|
+
[fields]: https://www.behance.net/dev/api/endpoints/11#creative-fields-get-75
|
146
|
+
|
147
|
+
$ client.fields
|
148
|
+
|
141
149
|
## Contributing
|
142
150
|
|
143
151
|
1. Fork it
|
data/behance.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
|
20
20
|
gem.add_runtime_dependency 'faraday', '~> 0.8.4'
|
21
21
|
gem.add_runtime_dependency 'faraday_middleware', '~> 0.8'
|
22
|
-
gem.add_runtime_dependency 'json', '~> 1.
|
22
|
+
gem.add_runtime_dependency 'json', '~> 1.8.1'
|
23
23
|
gem.add_development_dependency 'webmock', '~> 1.8.10'
|
24
24
|
gem.add_development_dependency 'rspec', '~> 2.6'
|
25
25
|
end
|
data/lib/behance/client.rb
CHANGED
@@ -2,6 +2,7 @@ require File.expand_path('../project', __FILE__)
|
|
2
2
|
require File.expand_path('../user', __FILE__)
|
3
3
|
require File.expand_path('../wips', __FILE__)
|
4
4
|
require File.expand_path('../collections', __FILE__)
|
5
|
+
require File.expand_path('../fields', __FILE__)
|
5
6
|
require 'faraday'
|
6
7
|
require 'faraday_middleware'
|
7
8
|
|
@@ -16,6 +17,7 @@ module Behance
|
|
16
17
|
include Behance::Client::User
|
17
18
|
include Behance::Client::Wips
|
18
19
|
include Behance::Client::Collections
|
20
|
+
include Behance::Client::Fields
|
19
21
|
|
20
22
|
attr_accessor :access_token, :connection
|
21
23
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Fields Endpoints.
|
2
|
+
module Behance
|
3
|
+
class Client
|
4
|
+
module Fields
|
5
|
+
# Public: Retrieve all Creative Fields.
|
6
|
+
#
|
7
|
+
# Examples
|
8
|
+
#
|
9
|
+
# @client.fields
|
10
|
+
#
|
11
|
+
# Returns an array of creative fields in JSON format.
|
12
|
+
def fields
|
13
|
+
request("fields")["fields"]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/behance/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Behance::Client::Fields do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@client = Behance::Client.new(access_token: "abc123")
|
7
|
+
end
|
8
|
+
|
9
|
+
before do
|
10
|
+
@options = { api_key: @client.access_token }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "#fields" do
|
14
|
+
|
15
|
+
before do
|
16
|
+
stub_get("fields").with(query: @options).
|
17
|
+
to_return(body: fixture("fields.json"))
|
18
|
+
@fields = @client.fields
|
19
|
+
end
|
20
|
+
|
21
|
+
it "makes a http request" do
|
22
|
+
a_get("fields").
|
23
|
+
with(query: @options).should have_been_made
|
24
|
+
end
|
25
|
+
|
26
|
+
it "gets a fields list" do
|
27
|
+
@fields.size.should == 6
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{ "fields": [
|
2
|
+
{
|
3
|
+
"id": 1,
|
4
|
+
"name": "Academia"
|
5
|
+
},
|
6
|
+
{
|
7
|
+
"id": 108,
|
8
|
+
"name": "Advertising"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"id": 3,
|
12
|
+
"name": "Animation"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"id": 4,
|
16
|
+
"name": "Architecture"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"id": 5,
|
20
|
+
"name": "Art Direction"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"id": 130,
|
24
|
+
"name": "Automotive Design"
|
25
|
+
}
|
26
|
+
]}
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: behance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Amed Rodriguez
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: faraday
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: faraday_middleware
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,23 +41,20 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: json
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
47
|
+
version: 1.8.1
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
54
|
+
version: 1.8.1
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: webmock
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rspec
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ~>
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ~>
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -107,18 +96,21 @@ files:
|
|
107
96
|
- lib/behance.rb
|
108
97
|
- lib/behance/client.rb
|
109
98
|
- lib/behance/collections.rb
|
99
|
+
- lib/behance/fields.rb
|
110
100
|
- lib/behance/project.rb
|
111
101
|
- lib/behance/user.rb
|
112
102
|
- lib/behance/version.rb
|
113
103
|
- lib/behance/wips.rb
|
114
104
|
- spec/behance/client_spec.rb
|
115
105
|
- spec/behance/collections_spec.rb
|
106
|
+
- spec/behance/fields_spec.rb
|
116
107
|
- spec/behance/project_spec.rb
|
117
108
|
- spec/behance/user_spec.rb
|
118
109
|
- spec/behance/wips_spec.rb
|
119
110
|
- spec/fixtures/collection.json
|
120
111
|
- spec/fixtures/collection_projects.json
|
121
112
|
- spec/fixtures/collections.json
|
113
|
+
- spec/fixtures/fields.json
|
122
114
|
- spec/fixtures/project.json
|
123
115
|
- spec/fixtures/project_comments.json
|
124
116
|
- spec/fixtures/projects.json
|
@@ -135,37 +127,38 @@ files:
|
|
135
127
|
- spec/spec_helper.rb
|
136
128
|
homepage: ''
|
137
129
|
licenses: []
|
130
|
+
metadata: {}
|
138
131
|
post_install_message:
|
139
132
|
rdoc_options: []
|
140
133
|
require_paths:
|
141
134
|
- lib
|
142
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
-
none: false
|
144
136
|
requirements:
|
145
137
|
- - ! '>='
|
146
138
|
- !ruby/object:Gem::Version
|
147
139
|
version: '0'
|
148
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
-
none: false
|
150
141
|
requirements:
|
151
142
|
- - ! '>='
|
152
143
|
- !ruby/object:Gem::Version
|
153
144
|
version: '0'
|
154
145
|
requirements: []
|
155
146
|
rubyforge_project:
|
156
|
-
rubygems_version:
|
147
|
+
rubygems_version: 2.2.2
|
157
148
|
signing_key:
|
158
|
-
specification_version:
|
149
|
+
specification_version: 4
|
159
150
|
summary: A Ruby wrapper for the Behance API
|
160
151
|
test_files:
|
161
152
|
- spec/behance/client_spec.rb
|
162
153
|
- spec/behance/collections_spec.rb
|
154
|
+
- spec/behance/fields_spec.rb
|
163
155
|
- spec/behance/project_spec.rb
|
164
156
|
- spec/behance/user_spec.rb
|
165
157
|
- spec/behance/wips_spec.rb
|
166
158
|
- spec/fixtures/collection.json
|
167
159
|
- spec/fixtures/collection_projects.json
|
168
160
|
- spec/fixtures/collections.json
|
161
|
+
- spec/fixtures/fields.json
|
169
162
|
- spec/fixtures/project.json
|
170
163
|
- spec/fixtures/project_comments.json
|
171
164
|
- spec/fixtures/projects.json
|
@@ -180,3 +173,4 @@ test_files:
|
|
180
173
|
- spec/fixtures/wip_revision_comments.json
|
181
174
|
- spec/fixtures/wips.json
|
182
175
|
- spec/spec_helper.rb
|
176
|
+
has_rdoc:
|