unsplash 1.5.1 → 1.5.2

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: fddaa858d2caa8978e2114873406405b6f176e3c
4
- data.tar.gz: 85e9830ea66bcc617b5feda502f01a316a4c6a5a
3
+ metadata.gz: b0f81e610661ea5f391d577a27c0eb07260ec937
4
+ data.tar.gz: 6e143ef14b52e58339226b947d07e2ece908b3c6
5
5
  SHA512:
6
- metadata.gz: dc7ca8088cea2e1c701f21b2e94e9f61c300d13b8a0b24828ae78a661dcfead1bd3b666f5181b4afecbbac07f85ca2a0fa44f7f5cb17295e4b604f2008190210
7
- data.tar.gz: d6db9727af1da4f57373187c52c3a22b21fd52314aa7b539900c30b5e488ea55f56e98d9df3dd50538f2e07a513bc52a4cdc8370d98ed3ca0393afe823809c73
6
+ metadata.gz: 8b4439758d404d17113aaac63b28c5c084bb8b4cf5b9ccb670f236089f9d810c1103fef0e32b5469815472727313f310298e197730357e4ea48c4b8e61bb7094
7
+ data.tar.gz: fcba0381f752839058dca31f1b5876e2957a2bf8db1787b3938cb8605cf9aa3f63f80225aebc91222494103f569ad9b32ab7ba426407b723cce458ee479a5b00
data/README.md CHANGED
@@ -37,9 +37,11 @@ Unsplash.configure do |config|
37
37
  end
38
38
  ```
39
39
 
40
- #### UTM parameters
40
+ #### API Guidelines
41
41
 
42
- As part of [the API guidelines](https://community.unsplash.com/developersblog/unsplash-api-guidelines), all API uses are required to use utm links when providing credit to photographers and Unsplash. Set the `config.utm_source` to your app's name to automatically append the utm source.
42
+ All API applications must abide by the [API Guidelines](https://medium.com/unsplash/unsplash-api-guidelines-28e0216e6daa).
43
+
44
+ As part of [the API guidelines](https://medium.com/unsplash/unsplash-api-guidelines-28e0216e6daa), all API uses are required to use utm links when providing credit to photographers and Unsplash. Set the `config.utm_source` to your app's name to automatically append the utm source.
43
45
 
44
46
  ### Public-scope actions
45
47
 
@@ -81,9 +83,9 @@ permission scopes you requested and the user authorized.
81
83
 
82
84
  ### Hotlinking
83
85
 
84
- Hotlinking the Unsplash image files is encouraged: https://unsplash.com/documentation#hotlinking
86
+ Hotlinking the [Unsplash image files is required](https://medium.com/@lukechesser/unsplash-api-guidelines-hotlinking-images-6c6b51030d2a)
85
87
 
86
- Unlike most APIs, Unsplash prefers for the image URLs returned by the API to be directly used or embedded in your applications (generally referred to as hotlinking). By using the CDN and embedding the photo URLs in your application, Unsplash can better track photo views and pass those stats on to the photographer, providing them with context for how popular their photo is and how it's being used.
88
+ Unlike most APIs, Unsplash requires for the image URLs returned by the API to be directly used or embedded in your applications (generally referred to as hotlinking). By using the CDN and embedding the photo URLs in your application, Unsplash can better track photo views and pass those stats on to the photographer, providing them with context for how popular their photo is and how it's being used.
87
89
 
88
90
  ## Development
89
91
 
@@ -108,7 +108,7 @@ module Unsplash # :nodoc:
108
108
  # @return [Boolean] +true+ on success.
109
109
  def destroy
110
110
  response = connection.delete("/collections/#{id}")
111
- response.status == 204
111
+ (200..299).include?(response.status)
112
112
  end
113
113
 
114
114
  # Get a list of the photos contained in this collection.
@@ -145,7 +145,7 @@ module Unsplash # :nodoc:
145
145
  # @return [Boolean] +true+ on success.
146
146
  def remove(photo)
147
147
  response = connection.delete("/collections/#{id}/remove", photo_id: photo.id)
148
- response.status == 204
148
+ (200..299).include?(response.status)
149
149
  end
150
150
 
151
151
  end
@@ -17,6 +17,12 @@ module Unsplash # :nodoc:
17
17
  true
18
18
  end
19
19
 
20
+ # Download a photo.
21
+ # @return [String] URL of image file for download.
22
+ def download!
23
+ connection.get(links.download_location)["url"]
24
+ end
25
+
20
26
  class << self
21
27
 
22
28
  # Get a photo. Can be cropped or resized using the optional parameters.
@@ -1,4 +1,4 @@
1
1
  module Unsplash # :nodoc:
2
2
  # :nodoc:
3
- VERSION = "1.5.1"
3
+ VERSION = "1.5.2"
4
4
  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: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Klaassen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-20 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty