1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Remove ruby 1.8/1.9 version check

This commit is contained in:
stjhimy 2016-05-07 06:57:06 -03:00
parent f4a59b87cc
commit c0142101c8
5 changed files with 5 additions and 28 deletions

View file

@ -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

View file

@ -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

View file

@ -1,8 +1,6 @@
require 'sinatra/json'
require 'sinatra/base'
$KCODE = "UTF-8" unless RUBY_VERSION > "1.9.0"
module Sinatra
#
# = Sinatra::RespondWith

View file

@ -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

View file

@ -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')