Merge branch 'drop-1.8.6'

Conflicts:
	Gemfile
	README.rdoc
This commit is contained in:
Konstantin Haase 2011-03-19 10:15:58 +01:00
commit ee2e348f5d
4 changed files with 11 additions and 28 deletions

14
Gemfile
View File

@ -1,5 +1,5 @@
# Why use bundler? # Why use bundler?
# Well, not all development dependencies install on all rubies. Moreover, `gem # Well, not all development dependencies install on all rubies. Moreover, `gem
# install sinatra --development` doesn't work, as it will also try to install # install sinatra --development` doesn't work, as it will also try to install
# development dependencies of our dependencies, and those are not conflict free. # development dependencies of our dependencies, and those are not conflict free.
# So, here we are, `bundle install`. # So, here we are, `bundle install`.
@ -22,14 +22,8 @@ gem 'liquid', :group => 'liquid'
gem 'nokogiri', :group => 'nokogiri' gem 'nokogiri', :group => 'nokogiri'
gem 'slim', :group => 'slim' gem 'slim', :group => 'slim'
gem 'RedCloth', :group => 'redcloth' gem 'RedCloth', :group => 'redcloth'
gem 'coffee-script', '>= 2.0', :group => 'coffee-script'
gem 'rdoc', :group => 'rdoc'
if RUBY_VERSION > '1.8.6'
gem 'coffee-script', '>= 2.0', :group => 'coffee-script'
gem 'rdoc', :group => 'rdoc'
else
gem 'rack', '~> 1.1.0'
end
platforms :ruby do platforms :ruby do
gem 'rdiscount', :group => 'rdiscount' gem 'rdiscount', :group => 'rdiscount'
@ -43,6 +37,6 @@ end
platforms :mri_18 do platforms :mri_18 do
# bundler platforms are broken # bundler platforms are broken
next unless RUBY_ENGINE == 'ruby' next if RUBY_ENGINE != 'ruby' or RUBY_VERSION > "1.8"
gem 'rcov', :group => 'rcov' gem 'rcov', :group => 'rcov'
end end

View File

@ -1273,8 +1273,7 @@ You can access those options via <tt>settings</tt>:
[public] folder public files are served from [public] folder public files are served from
[reload_templates] whether or not to reload templates between requests. [reload_templates] whether or not to reload templates between requests.
Enabled in development mode and on Ruby 1.8.6 (to Enabled in development mode.
compensate a bug in Ruby causing a memory leak).
[root] project root folder. [root] project root folder.
@ -1689,21 +1688,10 @@ Options are:
-s # specify rack server/handler (default is thin) -s # specify rack server/handler (default is thin)
-x # turn on the mutex lock (default is off) -x # turn on the mutex lock (default is off)
== Requirements == Requirement
It is recommended to install Sinatra on Ruby 1.8.7, 1.9.2, JRuby or Rubinius.
The following Ruby versions are officially supported: The following Ruby versions are officially supported:
[ Ruby 1.8.6 ]
It is not recommended to use 1.8.6 for Sinatra. However, it will be
officially supported until Sinatra 1.3.0 is released. RDoc and CoffeeScript
templates are not supported by this Ruby version. 1.8.6 includes a major
memory leak in its Hash implementation, which is triggered by Sinatra
versions prior to 1.1.1. The current version explicitly prevents this leak
at the cost of performance. You will have to downgrade Rack to 1.1.x, as
Rack >= 1.2 no longer supports 1.8.6.
[ Ruby 1.8.7 ] [ Ruby 1.8.7 ]
1.8.7 is fully supported, however, if nothing is keeping you from it, we 1.8.7 is fully supported, however, if nothing is keeping you from it, we
recommend upgrading to 1.9.2 or switching to JRuby or Rubinius. recommend upgrading to 1.9.2 or switching to JRuby or Rubinius.
@ -1724,6 +1712,8 @@ The following Ruby versions are officially supported:
on JRuby. JRuby's support for C extensions is still experimental, which only on JRuby. JRuby's support for C extensions is still experimental, which only
affects RDiscount at the moment. affects RDiscount at the moment.
<b>Ruby 1.8.6 is no longer supported.</b>
We also keep an eye on upcoming Ruby versions. We also keep an eye on upcoming Ruby versions.
The following Ruby implementations are not officially supported but still are The following Ruby implementations are not officially supported but still are

View File

@ -765,8 +765,7 @@ module Sinatra
public_dir = File.expand_path(public_dir) public_dir = File.expand_path(public_dir)
path = File.expand_path(public_dir + unescape(request.path_info)) path = File.expand_path(public_dir + unescape(request.path_info))
return if path[0, public_dir.length] != public_dir return unless path.start_with?(public_dir) and File.file?(path)
return unless File.file?(path)
env['sinatra.static_file'] = path env['sinatra.static_file'] = path
send_file path, :disposition => nil send_file path, :disposition => nil
@ -1368,7 +1367,7 @@ module Sinatra
set :app_file, nil set :app_file, nil
set :root, Proc.new { app_file && File.expand_path(File.dirname(app_file)) } set :root, Proc.new { app_file && File.expand_path(File.dirname(app_file)) }
set :views, Proc.new { root && File.join(root, 'views') } set :views, Proc.new { root && File.join(root, 'views') }
set :reload_templates, Proc.new { development? or RUBY_VERSION < '1.8.7' } set :reload_templates, Proc.new { development? }
set :lock, false set :lock, false
set :public, Proc.new { root && File.join(root, 'public') } set :public, Proc.new { root && File.join(root, 'public') }

View File

@ -120,7 +120,7 @@ Gem::Specification.new do |s|
s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/} s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/}
s.extra_rdoc_files = %w[README.rdoc README.de.rdoc README.jp.rdoc README.fr.rdoc README.es.rdoc README.hu.rdoc README.zh.rdoc LICENSE] s.extra_rdoc_files = %w[README.rdoc README.de.rdoc README.jp.rdoc README.fr.rdoc README.es.rdoc README.hu.rdoc README.zh.rdoc LICENSE]
s.add_dependency 'rack', '~> 1.1' s.add_dependency 'rack', '~> 1.2'
s.add_dependency 'tilt', '>= 1.2.2', '< 2.0' s.add_dependency 'tilt', '>= 1.2.2', '< 2.0'
s.add_development_dependency 'shotgun', '~> 0.6' s.add_development_dependency 'shotgun', '~> 0.6'