diff --git a/.travis.yml b/.travis.yml index 152140f0..c12d1274 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: ruby + rvm: - 2.0.0 - 2.1.10 @@ -11,9 +12,18 @@ notifications: on_success: change on_failure: always -script: SPEC_ALL=true bundle exec rspec spec +gemfile: + - Gemfile + - Gemfile.aws-sdk-core-v2 + +env: + - SPEC_ALL=true + +script: bundle exec rspec spec + before_install: - - gem update bundler + - gem update bundler + after_success: - bundle exec codeclimate-test-reporter diff --git a/Gemfile b/Gemfile index 22d6e41c..ad84f182 100644 --- a/Gemfile +++ b/Gemfile @@ -4,9 +4,11 @@ source 'https://rubygems.org' gemspec group :test do - gem 'activejob' + gem 'activejob', '~> 4' gem 'codeclimate-test-reporter', require: nil gem 'simplecov' gem 'multi_xml' gem 'httparty' + gem 'aws-sdk-sqs' + gem 'aws-sdk-core', '~> 3' end diff --git a/Gemfile.aws-sdk-core-v2 b/Gemfile.aws-sdk-core-v2 new file mode 100644 index 00000000..836747cd --- /dev/null +++ b/Gemfile.aws-sdk-core-v2 @@ -0,0 +1,13 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in shoryuken.gemspec +gemspec + +group :test do + gem 'activejob', '~> 4' + gem 'codeclimate-test-reporter', require: nil + gem 'simplecov' + gem 'multi_xml' + gem 'httparty' + gem 'aws-sdk-core', '~> 2' +end diff --git a/lib/shoryuken.rb b/lib/shoryuken.rb index 885cc7d3..7ae75486 100644 --- a/lib/shoryuken.rb +++ b/lib/shoryuken.rb @@ -1,6 +1,11 @@ require 'yaml' require 'json' require 'aws-sdk-core' +begin + require 'aws-sdk-sqs' unless defined?(Aws::SQS) +rescue LoadError + fail "AWS SDK 3 requires aws-sdk-sqs to be installed separately. Please add gem 'aws-sdk-sqs' to your Gemfile" +end require 'time' require 'concurrent' require 'forwardable' diff --git a/shoryuken.gemspec b/shoryuken.gemspec index b12d018c..4408b603 100644 --- a/shoryuken.gemspec +++ b/shoryuken.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry-byebug' spec.add_development_dependency 'dotenv' - spec.add_dependency 'aws-sdk-core', '~> 2' + spec.add_dependency 'aws-sdk-core', '>= 2' spec.add_dependency 'concurrent-ruby' spec.add_dependency 'thor' end