unsplash 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/unsplash/configuration.rb +10 -1
- data/lib/unsplash/connection.rb +3 -3
- data/lib/unsplash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6e5a96899cf6ef9c75460bf49a6be1325fa9aec
|
4
|
+
data.tar.gz: 6c5cdf85ffc25bbb83ac88b78f323692cab79972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e327fc0ae850477a6fc4fe3705a3d04599074aead174f1b186f95858699e476ab53b84b1a200a8f44f71f3ac5f416aafa084e7a09ca6984f34bdfb15ad4e7c
|
7
|
+
data.tar.gz: 0d1a4be937557bb7919dfb5edd8da4d5dd5d310138b39b42665a8f31a48a81fa303507e88722f73a7d206bb4da18cbcc8934908014ae6ba9db22ad69d671b7d4
|
data/README.md
CHANGED
@@ -26,11 +26,11 @@ Or install it yourself as:
|
|
26
26
|
### Configuration
|
27
27
|
|
28
28
|
Before making requests, you must configure the gem with your application ID
|
29
|
-
and secret. If you are using Rails, you can do this in an initializer.
|
29
|
+
and secret. If you are using Rails, you can do this in an initializer.
|
30
30
|
|
31
31
|
```ruby
|
32
|
-
Unsplash.configure do |config|
|
33
|
-
config.
|
32
|
+
Unsplash.configure do |config|
|
33
|
+
config.application_access_key = "YOUR ACCESS KEY"
|
34
34
|
config.application_secret = "YOUR APPLICATION SECRET"
|
35
35
|
config.application_redirect_uri = "https://your-application.com/oauth/callback"
|
36
36
|
config.utm_source = "alices_terrific_client_app"
|
@@ -91,7 +91,7 @@ Unlike most APIs, Unsplash requires for the image URLs returned by the API to be
|
|
91
91
|
|
92
92
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
93
93
|
|
94
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
94
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
95
95
|
|
96
96
|
## Contributing
|
97
97
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Unsplash # :nodoc:
|
2
2
|
class Configuration # :nodoc:
|
3
|
-
attr_accessor :
|
3
|
+
attr_accessor :application_access_key
|
4
4
|
attr_accessor :application_secret
|
5
5
|
attr_accessor :application_redirect_uri
|
6
6
|
attr_accessor :logger
|
@@ -16,5 +16,14 @@ module Unsplash # :nodoc:
|
|
16
16
|
!!@test
|
17
17
|
end
|
18
18
|
|
19
|
+
def application_id=(key)
|
20
|
+
logger.warn "Configuring application_id is deprecated. Use application_access_key."
|
21
|
+
self.application_access_key = key
|
22
|
+
end
|
23
|
+
|
24
|
+
def application_id
|
25
|
+
application_access_key
|
26
|
+
end
|
27
|
+
|
19
28
|
end
|
20
29
|
end
|
data/lib/unsplash/connection.rb
CHANGED
@@ -18,13 +18,13 @@ module Unsplash #:nodoc:
|
|
18
18
|
# @param api_base_uri [String] Base URI at which to make API calls.
|
19
19
|
# @param oauth_base_uri [String] Base URI for OAuth requests.
|
20
20
|
def initialize(version: DEFAULT_VERSION, api_base_uri: DEFAULT_API_BASE_URI, oauth_base_uri: DEFAULT_OAUTH_BASE_URI)
|
21
|
-
@
|
21
|
+
@application_access_key = Unsplash.configuration.application_access_key
|
22
22
|
@application_secret = Unsplash.configuration.application_secret
|
23
23
|
@api_version = version
|
24
24
|
@api_base_uri = api_base_uri
|
25
25
|
|
26
26
|
oauth_base_uri = oauth_base_uri
|
27
|
-
@oauth = ::OAuth2::Client.new(@
|
27
|
+
@oauth = ::OAuth2::Client.new(@application_access_key, @application_secret, site: oauth_base_uri) do |http|
|
28
28
|
http.request :multipart
|
29
29
|
http.request :url_encoded
|
30
30
|
http.adapter :net_http
|
@@ -137,7 +137,7 @@ module Unsplash #:nodoc:
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def public_auth_header
|
140
|
-
{ "Authorization" => "Client-ID #{@
|
140
|
+
{ "Authorization" => "Client-ID #{@application_access_key}" }
|
141
141
|
end
|
142
142
|
|
143
143
|
def utm_params
|
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.3
|
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: 2018-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|