Skip to content

Commit

Permalink
Merge pull request #83 from unsplash/v3
Browse files Browse the repository at this point in the history
V3 release
  • Loading branch information
arg committed Sep 20, 2022
2 parents 7414642 + e0874f5 commit 77db1e7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.5.3
3.1.2
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: ruby
rvm:
- 2.3.8
- 2.4.5
- 2.5.4
- 2.6.2
- 2.7.6
- 3.0.4
- 3.1.2
before_install: gem install bundler
5 changes: 3 additions & 2 deletions lib/unsplash/connection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'faraday/multipart'

module Unsplash #:nodoc:

# HTTP connection to and communication with the Unsplash API.
Expand All @@ -23,7 +25,6 @@ def initialize(version: DEFAULT_VERSION, api_base_uri: DEFAULT_API_BASE_URI, oau
@api_version = version
@api_base_uri = api_base_uri

oauth_base_uri = oauth_base_uri
@oauth = ::OAuth2::Client.new(@application_access_key, @application_secret, site: oauth_base_uri) do |http|
http.request :multipart
http.request :url_encoded
Expand Down Expand Up @@ -129,7 +130,7 @@ def request(verb, path, params = {})
self.class.public_send verb, path, query: params, headers: public_auth_header
end
rescue OAuth2::Error => e
OpenStruct.new(headers: {}, status: 403, body: e.error_message(e.response.body))
OpenStruct.new(headers: {}, status: 403, body: e.message)
end

if response.headers["Warning"]
Expand Down
2 changes: 1 addition & 1 deletion lib/unsplash/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Unsplash # :nodoc:
# :nodoc:
VERSION = "2.1.0"
VERSION = "3.0.0"
end
13 changes: 7 additions & 6 deletions unsplash.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.3.0"
spec.required_ruby_version = ">= 2.7.0"

spec.add_dependency "httparty", "~> 0.16"
spec.add_dependency "oauth2", "~> 1"
spec.add_dependency "httparty", "~> 0.20"
spec.add_dependency "oauth2", ">= 2.0.8"
spec.add_dependency "faraday-multipart", "~> 1.0.4"

spec.add_development_dependency "rake", "~> 12.3.2"
spec.add_development_dependency "rspec", "~> 3.8.0"
spec.add_development_dependency "vcr", "~> 3.0.0"
spec.add_development_dependency "webmock", "~> 3.5.1"
spec.add_development_dependency "vcr", "~> 6.1.0"
spec.add_development_dependency "webmock", "~> 3.18.1"
spec.add_development_dependency "pry"
spec.add_development_dependency "coveralls"
spec.add_development_dependency "coveralls_reborn", "~> 0.25.0"
spec.add_development_dependency "dotenv"
spec.add_development_dependency "rb-readline"
end

0 comments on commit 77db1e7

Please sign in to comment.