diff --git a/.travis.yml b/.travis.yml index b4d8d02..8f04827 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: ruby rvm: - - 1.9.3 - - 2.0.0 - - 2.1.1 \ No newline at end of file + - 2.0 + - 2.1 + - 2.2 + - 2.3 + - 2.4 diff --git a/lib/onesky.rb b/lib/onesky.rb index f2889c3..09a23b4 100644 --- a/lib/onesky.rb +++ b/lib/onesky.rb @@ -1,4 +1,3 @@ require 'onesky/version' require 'onesky/client' require 'onesky/errors' -require 'onesky/restclient' diff --git a/lib/onesky/restclient.rb b/lib/onesky/restclient.rb deleted file mode 100644 index 41007ee..0000000 --- a/lib/onesky/restclient.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Monkey patching RestClient::Request.process_url_params -# To support array in URL params -# RestClient.get('http://www.example.com', params: {weekday: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']}) -# => GET http://www.example.com?weekday[]=Mon&weekday[]=Tue&weekday[]=Wed&weekday[]=Thu&weekday[]=Fri - -module RestClient - class Request - - def process_url_params url, headers - url_params = {} - headers.delete_if do |key, value| - if 'params' == key.to_s.downcase && value.is_a?(Hash) - url_params.merge! value - true - else - false - end - end - unless url_params.empty? - query_string = url_params.collect { |k, v| build_url_params(k, v) }.join('&') - url + "?#{query_string}" - else - url - end - end - - private - - def build_url_params key, value - if value.is_a?(Array) - value.map { |v| "#{key.to_s}[]=#{CGI::escape(v.to_s)}" }.join('&') - else - "#{key.to_s}=#{CGI::escape(value.to_s)}" - end - end - - end -end diff --git a/lib/onesky/version.rb b/lib/onesky/version.rb index 9813e06..6409e53 100644 --- a/lib/onesky/version.rb +++ b/lib/onesky/version.rb @@ -1,3 +1,3 @@ module Onesky - VERSION = "1.0.1" + VERSION = "1.1.0" end diff --git a/onesky-ruby.gemspec b/onesky-ruby.gemspec index c96252b..4b602c4 100644 --- a/onesky-ruby.gemspec +++ b/onesky-ruby.gemspec @@ -13,6 +13,8 @@ Gem::Specification.new do |spec| spec.homepage = "http://github.com/onesky/onesky-ruby" spec.license = "MIT" + spec.required_ruby_version = '>= 2.0.0' + spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/})