noun-project-api 0.0.8 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38b46a0bde8395513cae9b4d2096d15cab2de56d
4
- data.tar.gz: 5a148071f5a87420443ba2b7affe37bc24e24ba5
3
+ metadata.gz: 1f48184a1d214d1c7a49a7613f70b2c6837e7752
4
+ data.tar.gz: e5cd3736f3dd1d3cf8cc7c33941051d76f4837be
5
5
  SHA512:
6
- metadata.gz: f964c8927b12370efc633b7c07b7e99ee19ee1081f3c782130f6593c8e1d280cc553e2a03a57da034d6e9bb1e6963c42fdb33c7eeb6363408e4679e8ec575626
7
- data.tar.gz: 3f394da10b8dff96754c0810c7f2b66ae1894f74dabaac5dae898b5fcdd2703561d19d6ed73abd9083c1b3aaa8d47b64e87ef5c883d9387ae4a5e0ee07f96d7d
6
+ metadata.gz: a2279e8f3a1eb12deb20eaf8716e211e89d205197426a44074e668fe62b16732007f542b12375a82e2e1656409a0500659b23cd2e01788abe69309891483ad6d
7
+ data.tar.gz: 9bdcac6c98affae7970a37690f9ab44244d938724916f949c54b40c2af8616bffc6bc2384e90e5abc825e294bc45d89720d0f4eedd1e776784c902abf7d357ef
@@ -8,7 +8,7 @@ module NounProjectApi
8
8
  def find(term, limit = nil, offset = nil, page = nil)
9
9
  raise ArgumentError.new('Missing search term') unless term
10
10
 
11
- search = URI::encode(term)
11
+ search = CGI.escape(term)
12
12
  search += "?limit_to_public_domain=#{NounProjectApi.configuration.public_domain ? 1 : 0}"
13
13
 
14
14
  args = { "limit" => limit, "offset" => offset, "page" => page }.reject { |k, v| v.nil? }
@@ -64,11 +64,11 @@ RSpec.describe NounProjectApi::IconsRetriever do
64
64
  code: '200'
65
65
  )
66
66
 
67
- term = 'some search'
67
+ term = 'some search with \',] bad chars'
68
68
  expect(@icons.access_token).to receive(
69
69
  :get
70
70
  ).with(
71
- "#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{URI::encode(term)}?limit_to_public_domain=0"
71
+ "#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{CGI.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}#{URI::encode(term)}?limit_to_public_domain=0"
94
+ "#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{CGI.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}#{URI::encode(term)}?limit_to_public_domain=1"
117
+ "#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{CGI.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}#{URI::encode(term)}?limit_to_public_domain=0&limit=#{limit}"
142
+ "#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{CGI.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}#{URI::encode(term)}?limit_to_public_domain=0"
163
+ "#{NounProjectApi::API_BASE}#{NounProjectApi::IconsRetriever::API_PATH}#{CGI.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.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nadav Shatz
@@ -72,6 +72,20 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: semver
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
75
89
  description: A Gem to expose a wrapping API for The Noun Project API's
76
90
  email: nadav@tailorbrands.com
77
91
  executables: []