diff --git a/sinatra-contrib/Gemfile b/sinatra-contrib/Gemfile index 31800961..53cbce2a 100644 --- a/sinatra-contrib/Gemfile +++ b/sinatra-contrib/Gemfile @@ -3,11 +3,7 @@ gemspec group :development, :test do - platform :ruby_18 do - gem 'libv8', '3.16.14.7' - end - - platform :ruby_18, :jruby do + platform :jruby do gem 'json' gem 'rdoc' end @@ -27,8 +23,7 @@ group :development, :test do gem 'redcarpet', '2.3.0' gem 'yajl-ruby' # ref is a dependency of therubyracer - # version 2 drops support for Rubies earlier than 1.9.3 - gem 'ref', '< 2.0' + gem 'ref' gem 'therubyracer' end diff --git a/sinatra-contrib/lib/sinatra/cookies.rb b/sinatra-contrib/lib/sinatra/cookies.rb index bd06315d..1373aadc 100644 --- a/sinatra-contrib/lib/sinatra/cookies.rb +++ b/sinatra-contrib/lib/sinatra/cookies.rb @@ -166,7 +166,7 @@ module Sinatra alias member? has_key? def index(value) - warn "Hash#index is deprecated; use Hash#key" if RUBY_VERSION > '1.9' + warn "Hash#index is deprecated; use Hash#key" key(value) end diff --git a/sinatra-contrib/lib/sinatra/respond_with.rb b/sinatra-contrib/lib/sinatra/respond_with.rb index 1ff89897..29c9a57c 100644 --- a/sinatra-contrib/lib/sinatra/respond_with.rb +++ b/sinatra-contrib/lib/sinatra/respond_with.rb @@ -1,8 +1,6 @@ require 'sinatra/json' require 'sinatra/base' -$KCODE = "UTF-8" unless RUBY_VERSION > "1.9.0" - module Sinatra # # = Sinatra::RespondWith diff --git a/sinatra-contrib/spec/capture_spec.rb b/sinatra-contrib/spec/capture_spec.rb index f21b6f07..3ca8a602 100644 --- a/sinatra-contrib/spec/capture_spec.rb +++ b/sinatra-contrib/spec/capture_spec.rb @@ -44,7 +44,7 @@ describe Sinatra::Capture do it "handles ISO-8859-1 encoding" do render(:erb, "iso_8859_1").should == "ISO-8859-1 -" - end if RUBY_VERSION >= '1.9' + end end end diff --git a/sinatra-contrib/spec/cookies_spec.rb b/sinatra-contrib/spec/cookies_spec.rb index 59e65127..bd387387 100644 --- a/sinatra-contrib/spec/cookies_spec.rb +++ b/sinatra-contrib/spec/cookies_spec.rb @@ -492,7 +492,7 @@ describe Sinatra::Cookies do error = if defined? JRUBY_VERSION IndexError else - RUBY_VERSION >= '1.9' ? KeyError : IndexError + KeyError end expect { cookies.fetch('foo') }.to raise_exception(error) end @@ -560,22 +560,6 @@ describe Sinatra::Cookies do end end - describe :index do - it 'checks request cookies' do - cookies('foo=bar').index('bar').should be == 'foo' - end - - it 'checks response cookies' do - jar = cookies - jar['foo'] = 'bar' - jar.index('bar').should be == 'foo' - end - - it 'returns nil when missing' do - cookies('foo=bar').index('baz').should be_nil - end - end if RUBY_VERSION < '1.9' - describe :keep_if do it 'removes entries' do jar = cookies('foo=bar', 'bar=baz')