noun-project-api 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb8a4380606b5d326ccc449f4a077194e6386631
|
4
|
+
data.tar.gz: 54a5dad9793a4ee4d0ed2bebd75a546285e2235d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a825ef76bc8e82cc2a6b7657e6f0b1a1bedff16370c682461c40238d5173d2b08e0f7c83aa1eebb7ab49c3d3545c7aa8f838793ee45e37d3ed40b004579196e8
|
7
|
+
data.tar.gz: a9e9ee20eba171b591213b651a47af9ad207fef400005ed8ae40fab7780876ba714b52797d16658252c6fad522eea09cfe06e4ec1e3c322e9578be47ed5c368b
|
data/lib/noun-project-api.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'noun-project-api/retriever'
|
2
|
-
require 'open-uri'
|
3
2
|
|
4
3
|
module NounProjectApi
|
5
4
|
class IconsRetriever < Retriever
|
@@ -8,7 +7,7 @@ module NounProjectApi
|
|
8
7
|
def find(term, limit = nil, offset = nil, page = nil)
|
9
8
|
raise ArgumentError.new('Missing search term') unless term
|
10
9
|
|
11
|
-
search =
|
10
|
+
search = OAuth::Helper::escape(term)
|
12
11
|
search += "?limit_to_public_domain=#{NounProjectApi.configuration.public_domain ? 1 : 0}"
|
13
12
|
|
14
13
|
args = { "limit" => limit, "offset" => offset, "page" => page }.reject { |k, v| v.nil? }
|
@@ -68,7 +68,7 @@ RSpec.describe NounProjectApi::IconsRetriever do
|
|
68
68
|
expect(@icons.access_token).to receive(
|
69
69
|
:get
|
70
70
|
).with(
|
71
|
-
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{
|
71
|
+
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{OAuth::Helper::escape(term)}?limit_to_public_domain=0"
|
72
72
|
).and_return(
|
73
73
|
valid_response
|
74
74
|
)
|
@@ -91,7 +91,7 @@ RSpec.describe NounProjectApi::IconsRetriever do
|
|
91
91
|
expect(@icons.access_token).to receive(
|
92
92
|
:get
|
93
93
|
).with(
|
94
|
-
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{
|
94
|
+
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{OAuth::Helper::escape(term)}?limit_to_public_domain=0"
|
95
95
|
).and_return(
|
96
96
|
valid_response
|
97
97
|
)
|
@@ -114,7 +114,7 @@ RSpec.describe NounProjectApi::IconsRetriever do
|
|
114
114
|
expect(@icons.access_token).to receive(
|
115
115
|
:get
|
116
116
|
).with(
|
117
|
-
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{
|
117
|
+
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{OAuth::Helper::escape(term)}?limit_to_public_domain=1"
|
118
118
|
).and_return(
|
119
119
|
valid_response
|
120
120
|
)
|
@@ -139,7 +139,7 @@ RSpec.describe NounProjectApi::IconsRetriever do
|
|
139
139
|
expect(@icons.access_token).to receive(
|
140
140
|
:get
|
141
141
|
).with(
|
142
|
-
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{
|
142
|
+
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{OAuth::Helper::escape(term)}?limit_to_public_domain=0&limit=#{limit}"
|
143
143
|
).and_return(
|
144
144
|
valid_response
|
145
145
|
)
|
@@ -160,7 +160,7 @@ RSpec.describe NounProjectApi::IconsRetriever do
|
|
160
160
|
expect(@icons.access_token).to receive(
|
161
161
|
:get
|
162
162
|
).with(
|
163
|
-
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{
|
163
|
+
"#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{OAuth::Helper::escape(term)}?limit_to_public_domain=0"
|
164
164
|
).and_return(
|
165
165
|
missing_response
|
166
166
|
)
|