From 38fad912d3b8f6513dd30ff71ba8adb397be4c01 Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 20 Dec 2017 09:44:00 -0600 Subject: [PATCH] PEN-541: Loosen faraday dependency --- .rubocop.yml | 7 +++++++ .travis.yml | 11 ++++++----- Gemfile | 1 + LICENSE | 20 -------------------- LICENSE.md | 14 ++++++++++++++ bigcommerce.gemspec | 6 +++--- examples/exception_handling.rb | 2 +- lib/bigcommerce/exception.rb | 2 +- lib/bigcommerce/version.rb | 2 +- 9 files changed, 34 insertions(+), 31 deletions(-) delete mode 100644 LICENSE create mode 100644 LICENSE.md diff --git a/.rubocop.yml b/.rubocop.yml index 964c668..0f3a188 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,6 +4,7 @@ AllCops: - .bundle/**/* - bin/**/* - vendor/**/* + - examples/**/* Metrics/LineLength: Max: 120 @@ -17,3 +18,9 @@ Metrics/MethodLength: Style/Documentation: Enabled: false + +Style/FormatStringToken: + Enabled: false + +Gemspec/RequiredRubyVersion: + Enabled: false diff --git a/.travis.yml b/.travis.yml index 1c28213..76980e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,15 @@ language: ruby -sudo: false -cache: bundler - rvm: - ruby-head - 2.0 - 2.1 - 2.2 - - 2.3.0 - + - 2.3 + - 2.4 +cache: + bundler: true +sudo: false matrix: allow_failures: - rvm: ruby-head + fast_finish: true diff --git a/Gemfile b/Gemfile index c9e93b2..0894d5d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source 'https://rubygems.org' + gemspec group :development do diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 71cc391..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) Bigcommerce, 2016. -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..6b53e98 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,14 @@ +Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/bigcommerce.gemspec b/bigcommerce.gemspec index d7cb32b..69aeafb 100644 --- a/bigcommerce.gemspec +++ b/bigcommerce.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.0.0' s.license = 'MIT' - s.authors = ['Patrick Edelman'] + s.authors = ['BigCommerce Engineering'] s.homepage = 'https://github.com/bigcommerce/bigcommerce-api-ruby' s.summary = 'Ruby client library for the BigCommerce API' s.description = s.summary @@ -20,8 +20,8 @@ Gem::Specification.new do |s| s.add_development_dependency 'bundler' s.add_development_dependency 'rake' - s.add_dependency 'faraday', '~> 0.12.0' - s.add_dependency 'faraday_middleware', '~> 0.10.0' + s.add_dependency 'faraday', '~> 0.11' + s.add_dependency 'faraday_middleware', '~> 0.11' s.add_dependency 'hashie', '~> 3.4' s.add_dependency 'jwt', '~> 1.5.4' end diff --git a/examples/exception_handling.rb b/examples/exception_handling.rb index 41bd82c..7d151b0 100644 --- a/examples/exception_handling.rb +++ b/examples/exception_handling.rb @@ -38,7 +38,7 @@ def bc_handle_exception puts e.inspect rescue Bigcommerce::BandwidthLimitExceeded => e puts e.inspect -rescue => e +rescue StandardError => e puts "Some other Error #{e.inspect}" end diff --git a/lib/bigcommerce/exception.rb b/lib/bigcommerce/exception.rb index 9868939..2757ceb 100644 --- a/lib/bigcommerce/exception.rb +++ b/lib/bigcommerce/exception.rb @@ -45,7 +45,7 @@ def throw_http_exception!(code, env) unless env.body.empty? response_headers = begin JSON.parse(env.body, symbolize_names: true) - rescue + rescue StandardError {} end end diff --git a/lib/bigcommerce/version.rb b/lib/bigcommerce/version.rb index f452a4a..bd6aad2 100644 --- a/lib/bigcommerce/version.rb +++ b/lib/bigcommerce/version.rb @@ -1,3 +1,3 @@ module Bigcommerce - VERSION = '1.0.0'.freeze + VERSION = '1.0.1'.freeze end