unsplash 2.1.0 → 3.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
  SHA256:
3
- metadata.gz: 02a138e4c3f28999bbac53d0c82eed72a938ead58fb95fb4ec86236f6a6aa8a3
4
- data.tar.gz: a0dd3304cdb088fd8859dfde19a0bf7722fd6444eec0e4699aeb25ebfda41492
3
+ metadata.gz: f8761235452718ff837fb8b5300c01cbbcbb0773f0ce6a35d71a2a78f4db49a1
4
+ data.tar.gz: f53460d0b82916d1310ead53f989d1dcbd457caee4e846a7c27377abc55bb256
5
5
  SHA512:
6
- metadata.gz: 15db231f6a97b37af4d8448c02206245a9230ff5c1d7aaf52bf2140c010c94fd744cee4eb9ee9db09f65d72810f869053b906ef5e38ecba51d6523c4f268d4c7
7
- data.tar.gz: fb1437ae056f0fb62ea7060c66a7abc66b0810904db29c9c886904b0aa4ef6ae6dfea434a9e58bbcac3a9210f2c607a605c1e8a914552967a8ffc8a04cd4386d
6
+ metadata.gz: facc37b4ff1c8773d8e52a3fcbcbfb8a2900ad7bd5f23a29af0b66a91b604b2b7423e75a1bff190c7aabfe7e40c6e29ac60e3ad01ca0adb5f7c678c25496c577
7
+ data.tar.gz: a711ae14751a9d360760974b1fac6a116a4a20170fe66526a10c3fd31bf21f927904e89a432914df51ef33e69195f79ec6b8efc8e671d7166cc23c4b98b04ca7
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.5.3
1
+ 3.1.2
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.8
4
- - 2.4.5
5
- - 2.5.4
6
- - 2.6.2
3
+ - 2.7.6
4
+ - 3.0.4
5
+ - 3.1.2
7
6
  before_install: gem install bundler
@@ -1,3 +1,5 @@
1
+ require 'faraday/multipart'
2
+
1
3
  module Unsplash #:nodoc:
2
4
 
3
5
  # HTTP connection to and communication with the Unsplash API.
@@ -23,7 +25,6 @@ module Unsplash #:nodoc:
23
25
  @api_version = version
24
26
  @api_base_uri = api_base_uri
25
27
 
26
- oauth_base_uri = oauth_base_uri
27
28
  @oauth = ::OAuth2::Client.new(@application_access_key, @application_secret, site: oauth_base_uri) do |http|
28
29
  http.request :multipart
29
30
  http.request :url_encoded
@@ -129,7 +130,7 @@ module Unsplash #:nodoc:
129
130
  self.class.public_send verb, path, query: params, headers: public_auth_header
130
131
  end
131
132
  rescue OAuth2::Error => e
132
- OpenStruct.new(headers: {}, status: 403, body: e.error_message(e.response.body))
133
+ OpenStruct.new(headers: {}, status: 403, body: e.message)
133
134
  end
134
135
 
135
136
  if response.headers["Warning"]
@@ -52,9 +52,10 @@ module Unsplash # :nodoc:
52
52
  # @param user [String] Limit selection to given User's ID.
53
53
  # @param query [String] Limit selection to given search query.
54
54
  # @param orientation [String] Filter by orientation of the photo. Valid values are landscape, portrait, and squarish.
55
+ # @param content_filter [String] Limit results by content_filter to avoid content that may be unsuitable for younger audiences. Valid values are low, high. Defaults to low.
55
56
  # @return [Unsplash::Photo] An Unsplash Photo if count parameter is omitted
56
57
  # @return [Array] An array of Unsplash Photos if the count parameter is specified. An array is returned even if count is 1
57
- def random(count: nil, collections: nil, featured: nil, user: nil, query: nil, orientation: nil)
58
+ def random(count: nil, collections: nil, featured: nil, user: nil, query: nil, orientation: nil, content_filter: "low")
58
59
  Unsplash.configuration.logger.warn "You cannot combine 'collections' and 'query' parameters. 'query' will be ignored." if collections && query
59
60
 
60
61
  params = {
@@ -62,7 +63,8 @@ module Unsplash # :nodoc:
62
63
  featured: featured,
63
64
  username: user,
64
65
  query: query,
65
- orientation: orientation
66
+ orientation: orientation,
67
+ content_filter: content_filter
66
68
  }.select { |k,v| v }
67
69
  if count
68
70
  params[:count] = count
@@ -83,13 +85,15 @@ module Unsplash # :nodoc:
83
85
  # @param page [Integer] Which page of search results to return.
84
86
  # @param per_page [Integer] The number of users search result per page. (default: 10, maximum: 30)
85
87
  # @param orientation [String] Filter by orientation of the photo. Valid values are landscape, portrait, and squarish.
88
+ # @param content_filter [String] Limit results by content_filter to avoid content that may be unsuitable for younger audiences. Valid values are low, high. Defaults to low.
86
89
  # @return [SearchResult] a list of +Unsplash::Photo+ objects.
87
- def search(query, page = 1, per_page = 10, orientation = nil)
90
+ def search(query, page = 1, per_page = 10, orientation = nil, content_filter = "low")
88
91
  params = {
89
92
  query: query,
90
93
  page: page,
91
94
  per_page: per_page,
92
- orientation: orientation
95
+ orientation: orientation,
96
+ content_filter: content_filter
93
97
  }.select { |_k, v| v }
94
98
  Unsplash::Search.search("/search/photos", self, params)
95
99
  end
@@ -1,4 +1,4 @@
1
1
  module Unsplash # :nodoc:
2
2
  # :nodoc:
3
- VERSION = "2.1.0"
3
+ VERSION = "3.1.1"
4
4
  end
data/unsplash.gemspec CHANGED
@@ -18,17 +18,18 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.required_ruby_version = ">= 2.3.0"
21
+ spec.required_ruby_version = ">= 2.7.0"
22
22
 
23
- spec.add_dependency "httparty", "~> 0.16"
24
- spec.add_dependency "oauth2", "~> 1"
23
+ spec.add_dependency "httparty", "~> 0.20"
24
+ spec.add_dependency "oauth2", ">= 2.0.8"
25
+ spec.add_dependency "faraday-multipart", "~> 1.0.4"
25
26
 
26
27
  spec.add_development_dependency "rake", "~> 12.3.2"
27
28
  spec.add_development_dependency "rspec", "~> 3.8.0"
28
- spec.add_development_dependency "vcr", "~> 3.0.0"
29
- spec.add_development_dependency "webmock", "~> 3.5.1"
29
+ spec.add_development_dependency "vcr", "~> 6.1.0"
30
+ spec.add_development_dependency "webmock", "~> 3.18.1"
30
31
  spec.add_development_dependency "pry"
31
- spec.add_development_dependency "coveralls"
32
+ spec.add_development_dependency "coveralls_reborn", "~> 0.25.0"
32
33
  spec.add_development_dependency "dotenv"
33
34
  spec.add_development_dependency "rb-readline"
34
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unsplash
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Klaassen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-25 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.16'
19
+ version: '0.20'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.16'
26
+ version: '0.20'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: oauth2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.8
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.8
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday-multipart
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '1'
47
+ version: 1.0.4
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '1'
54
+ version: 1.0.4
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +86,28 @@ dependencies:
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: 3.0.0
89
+ version: 6.1.0
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: 3.0.0
96
+ version: 6.1.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: webmock
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: 3.5.1
103
+ version: 3.18.1
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: 3.5.1
110
+ version: 3.18.1
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: pry
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -109,19 +123,19 @@ dependencies:
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
- name: coveralls
126
+ name: coveralls_reborn
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - ">="
129
+ - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: '0'
131
+ version: 0.25.0
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - ">="
136
+ - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: '0'
138
+ version: 0.25.0
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: dotenv
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +164,7 @@ dependencies:
150
164
  - - ">="
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
- description:
167
+ description:
154
168
  email:
155
169
  - aaron@unsplash.com
156
170
  executables: []
@@ -189,7 +203,7 @@ homepage: https://github.com/unsplash/unsplash_rb
189
203
  licenses:
190
204
  - MIT
191
205
  metadata: {}
192
- post_install_message:
206
+ post_install_message:
193
207
  rdoc_options: []
194
208
  require_paths:
195
209
  - lib
@@ -197,15 +211,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
211
  requirements:
198
212
  - - ">="
199
213
  - !ruby/object:Gem::Version
200
- version: 2.3.0
214
+ version: 2.7.0
201
215
  required_rubygems_version: !ruby/object:Gem::Requirement
202
216
  requirements:
203
217
  - - ">="
204
218
  - !ruby/object:Gem::Version
205
219
  version: '0'
206
220
  requirements: []
207
- rubygems_version: 3.0.3
208
- signing_key:
221
+ rubygems_version: 3.3.7
222
+ signing_key:
209
223
  specification_version: 4
210
224
  summary: Ruby wrapper for the Unsplash API.
211
225
  test_files: []