unsplash 1.5.5 → 1.5.6
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 +5 -5
- data/lib/unsplash/category.rb +7 -11
- data/lib/unsplash/configuration.rb +1 -1
- data/lib/unsplash/connection.rb +8 -4
- data/lib/unsplash/curated_batch.rb +1 -1
- data/lib/unsplash/errors.rb +3 -1
- data/lib/unsplash/photo.rb +1 -1
- data/lib/unsplash/stats.rb +1 -1
- data/lib/unsplash/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2baf82aec25861dec27432935378a12e49344a1920e8c6d2a0f3972cf80ae275
|
4
|
+
data.tar.gz: 6964813d9ed8b4bf69122900ed31c6e498cac94ab2748f33f7277086772ea42d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 241302c561d0633f1403c483e3fb787dfe1a13319bdf868dc65fe55c17ab9d170adb4d28473a29b1e4ef6ed71ac5d6098a5cde69249d65c9f4ef3546ba3a2b32
|
7
|
+
data.tar.gz: eaa1640eccffbe19204a2c5a959d3a67533819f6879a35e0bda1bb7469e07396eec791abd4ddb2ca05981849935adfe881e209ef4882aa4e7d14bedc33f2d83c
|
data/lib/unsplash/category.rb
CHANGED
@@ -7,17 +7,17 @@ module Unsplash # :nodoc:
|
|
7
7
|
|
8
8
|
# Get a list of all of the Unsplash photo categories.
|
9
9
|
# @return [Array] The list categories.
|
10
|
+
# <b>DEPRECATED</b>
|
10
11
|
def all
|
11
|
-
|
12
|
-
new category
|
13
|
-
end
|
12
|
+
raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
|
14
13
|
end
|
15
14
|
|
16
15
|
# Get an Unsplash Category.
|
17
16
|
# @param id [Integer] The ID of the category to retrieve.
|
18
17
|
# @return [Unsplash::Category] The specified category.
|
18
|
+
# <b>DEPRECATED</b>
|
19
19
|
def find(id)
|
20
|
-
new
|
20
|
+
raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -25,13 +25,9 @@ module Unsplash # :nodoc:
|
|
25
25
|
# @param page [Integer] Which page of search results to return.
|
26
26
|
# @param per_page [Integer] The number of search results per page.
|
27
27
|
# @return [Array] A single page of +Unsplash::Photo+s.
|
28
|
+
# <b>DEPRECATED</b>
|
28
29
|
def photos(page = 1, per_page = 10)
|
29
|
-
|
30
|
-
page: page,
|
31
|
-
per_page: per_page
|
32
|
-
}
|
33
|
-
list = JSON.parse(connection.get("/categories/#{id}/photos", params).body)
|
34
|
-
list.map { |photo| Unsplash::Photo.new photo }
|
30
|
+
raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
|
35
31
|
end
|
36
32
|
end
|
37
|
-
end
|
33
|
+
end
|
data/lib/unsplash/connection.rb
CHANGED
@@ -127,10 +127,14 @@ module Unsplash #:nodoc:
|
|
127
127
|
|
128
128
|
status_code = response.respond_to?(:status) ? response.status : response.code
|
129
129
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
130
|
+
begin
|
131
|
+
if !(200..299).include?(status_code)
|
132
|
+
body = JSON.parse(response.body)
|
133
|
+
msg = body["error"] || body["errors"].join(" ")
|
134
|
+
raise Unsplash::Error.new msg
|
135
|
+
end
|
136
|
+
rescue JSON::ParserError
|
137
|
+
raise Unsplash::Error.new response.body
|
134
138
|
end
|
135
139
|
|
136
140
|
response
|
data/lib/unsplash/errors.rb
CHANGED
data/lib/unsplash/photo.rb
CHANGED
@@ -128,7 +128,7 @@ module Unsplash # :nodoc:
|
|
128
128
|
# @return [Unsplash::Photo] The uploaded photo.
|
129
129
|
# <b>DEPRECATED</b>
|
130
130
|
def create(filepath)
|
131
|
-
raise Unsplash::
|
131
|
+
raise Unsplash::DeprecationError.new "API photo-upload endpoint has been deprecated and removed."
|
132
132
|
end
|
133
133
|
|
134
134
|
private
|
data/lib/unsplash/stats.rb
CHANGED
data/lib/unsplash/version.rb
CHANGED
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: 1.5.
|
4
|
+
version: 1.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Klaassen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -177,8 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
- !ruby/object:Gem::Version
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
|
-
|
181
|
-
rubygems_version: 2.6.10
|
180
|
+
rubygems_version: 3.0.3
|
182
181
|
signing_key:
|
183
182
|
specification_version: 4
|
184
183
|
summary: Ruby wrapper for the Unsplash API.
|