noun-project-api 0.1.0 → 0.1.1

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: 1f48184a1d214d1c7a49a7613f70b2c6837e7752
4
- data.tar.gz: e5cd3736f3dd1d3cf8cc7c33941051d76f4837be
3
+ metadata.gz: bb8a4380606b5d326ccc449f4a077194e6386631
4
+ data.tar.gz: 54a5dad9793a4ee4d0ed2bebd75a546285e2235d
5
5
  SHA512:
6
- metadata.gz: a2279e8f3a1eb12deb20eaf8716e211e89d205197426a44074e668fe62b16732007f542b12375a82e2e1656409a0500659b23cd2e01788abe69309891483ad6d
7
- data.tar.gz: 9bdcac6c98affae7970a37690f9ab44244d938724916f949c54b40c2af8616bffc6bc2384e90e5abc825e294bc45d89720d0f4eedd1e776784c902abf7d357ef
6
+ metadata.gz: a825ef76bc8e82cc2a6b7657e6f0b1a1bedff16370c682461c40238d5173d2b08e0f7c83aa1eebb7ab49c3d3545c7aa8f838793ee45e37d3ed40b004579196e8
7
+ data.tar.gz: a9e9ee20eba171b591213b651a47af9ad207fef400005ed8ae40fab7780876ba714b52797d16658252c6fad522eea09cfe06e4ec1e3c322e9578be47ed5c368b
@@ -1,3 +1,5 @@
1
+ require 'oauth'
2
+ require 'json'
1
3
  require 'noun-project-api/icon_retriever'
2
4
  require 'noun-project-api/icons_retriever'
3
5
  require 'noun-project-api/icon'
@@ -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 = CGI.escape(term)
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? }
@@ -1,5 +1,3 @@
1
- require "oauth"
2
-
3
1
  module NounProjectApi
4
2
  API_BASE = 'http://api.thenounproject.com'
5
3
 
@@ -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}#{CGI.escape(term)}?limit_to_public_domain=0"
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}#{CGI.escape(term)}?limit_to_public_domain=0"
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}#{CGI.escape(term)}?limit_to_public_domain=1"
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}#{CGI.escape(term)}?limit_to_public_domain=0&limit=#{limit}"
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}#{CGI.escape(term)}?limit_to_public_domain=0"
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
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noun-project-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nadav Shatz