From 243fcb71a54510bae18da7b6d1ad9002de0e73c9 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Sun, 20 Jul 2014 20:29:27 +0200 Subject: [PATCH] Require Ruby 1.9.3 or higher --- .travis.yml | 15 ++++++--------- Gemfile | 9 +-------- README.md | 2 -- gems.gemspec | 1 + lib/gems/request.rb | 2 +- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index df6d6d7..251ca4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,17 @@ bundler_args: --without development +env: + global: + - JRUBY_OPTS="$JRUBY_OPTS --debug" language: ruby rvm: - - 1.8.7 - 1.9.3 - 2.0.0 - - 2.1.0 + - 2.1 + - jruby-19mode + - jruby-head - rbx-2 - ruby-head matrix: - include: - - rvm: jruby-18mode - env: JRUBY_OPTS="$JRUBY_OPTS --debug" - - rvm: jruby-19mode - env: JRUBY_OPTS="$JRUBY_OPTS --debug" - - rvm: jruby-head - env: JRUBY_OPTS="$JRUBY_OPTS --debug" allow_failures: - rvm: jruby-head - rvm: ruby-head diff --git a/Gemfile b/Gemfile index b8976fb..0a0f16b 100644 --- a/Gemfile +++ b/Gemfile @@ -6,20 +6,13 @@ gem 'jruby-openssl', :platforms => :jruby group :development do gem 'pry' - platforms :ruby_19, :ruby_20 do - gem 'pry-debugger' - gem 'pry-stack_explorer' - end end group :test do gem 'backports' gem 'coveralls' - gem 'json', :platforms => [:rbx, :ruby_19, :ruby_18] - gem 'mime-types', '~> 1.25', :platforms => [:jruby, :ruby_18] - gem 'rest-client', '~> 1.6.0', :platforms => [:jruby, :ruby_18] gem 'rspec', '>= 2.11' - gem 'rubocop', '>= 0.23', :platforms => [:ruby_19, :ruby_20, :ruby_21] + gem 'rubocop', '>= 0.23' gem 'simplecov', '>= 0.9' gem 'webmock' gem 'yardstick' diff --git a/README.md b/README.md index 91e970a..42aa307 100644 --- a/README.md +++ b/README.md @@ -119,8 +119,6 @@ Ruby wrapper for the RubyGems.org API. This library aims to support and is [tested against][travis] the following Ruby implementations: -* Ruby 1.8.7 -* Ruby 1.9.2 * Ruby 1.9.3 * Ruby 2.0.0 * Ruby 2.1.0 diff --git a/gems.gemspec b/gems.gemspec index 13032da..65956ff 100644 --- a/gems.gemspec +++ b/gems.gemspec @@ -17,6 +17,7 @@ Gem::Specification.new do |spec| spec.licenses = %w(MIT) spec.name = 'gems' spec.require_paths = %w(lib) + spec.required_ruby_version = '>= 1.9.3' spec.summary = spec.description spec.test_files = Dir.glob('spec/**/*') spec.version = Gems::VERSION diff --git a/lib/gems/request.rb b/lib/gems/request.rb index 2b2840c..2f105c4 100644 --- a/lib/gems/request.rb +++ b/lib/gems/request.rb @@ -52,7 +52,7 @@ def request(method, path, data, content_type, request_host = host) # rubocop:dis end def hash_to_query_string(hash) - hash.keys.inject('') do |query_string, key| + hash.keys.each_with_object('') do |key, query_string| query_string << '&' unless key == hash.keys.first query_string << "#{URI.encode(key.to_s)}=#{URI.encode(hash[key])}" end