Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Merge branch 'stjhimy-ruby_version'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Scott committed Jul 20, 2016
2 parents 485d317 + 5936e19 commit bb065f2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 28 deletions.
9 changes: 2 additions & 7 deletions Gemfile
Expand Up @@ -6,11 +6,7 @@ gem 'sinatra', github: 'sinatra/sinatra'

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
Expand All @@ -30,8 +26,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

Expand Down
2 changes: 1 addition & 1 deletion lib/sinatra/cookies.rb
Expand Up @@ -166,7 +166,7 @@ def hash
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

Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 2 additions & 0 deletions sinatra-contrib.gemspec
Expand Up @@ -213,6 +213,8 @@ Gem::Specification.new do |s|
"spec/params_spec.rb",
]

s.required_ruby_version = '>= 2.2.0'

s.add_dependency "sinatra", "> 1", "< 3"
s.add_dependency "mustermann", "~> 0.4"
s.add_dependency "backports", ">= 2.0"
Expand Down
2 changes: 1 addition & 1 deletion spec/capture_spec.rb
Expand Up @@ -44,7 +44,7 @@ def render(engine, template)

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

Expand Down
18 changes: 1 addition & 17 deletions spec/cookies_spec.rb
Expand Up @@ -492,7 +492,7 @@ def cookies(*set_cookies)
error = if defined? JRUBY_VERSION
IndexError
else
RUBY_VERSION >= '1.9' ? KeyError : IndexError
KeyError
end
expect { cookies.fetch('foo') }.to raise_exception(error)
end
Expand Down Expand Up @@ -560,22 +560,6 @@ def cookies(*set_cookies)
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')
Expand Down

0 comments on commit bb065f2

Please sign in to comment.