Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 6 files changed
  • 0 commit comments
  • 2 contributors
Commits on Oct 09, 2011
@smgt smgt Compatibility with Sinatra 1.3 3fb7e04
Commits on Nov 17, 2011
@cehoffman Merge pull request #12 from simon/master
Compatibility with Sinatra 1.3 (Second go)
c235edc
View
4 Changelog.rdoc
@@ -1,3 +1,7 @@
+=== 0.8.0 / 2011-10-09
+
+* Compatibility with Sinatra 1.3
+
=== 0.7.0 / 2011-03-20
* Compatibility with Sinatra 1.2
View
8 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- sinatra-respond_to (0.7.0)
+ sinatra-respond_to (0.8.0)
sinatra (~> 1.2)
GEM
@@ -22,10 +22,10 @@ GEM
rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.5.0)
- sinatra (1.2.1)
+ sinatra (1.2.6)
rack (~> 1.1)
- tilt (< 2.0, >= 1.2.2)
- tilt (1.2.2)
+ tilt (>= 1.2.2, < 2.0)
+ tilt (1.3.3)
PLATFORMS
ruby
View
6 lib/sinatra/respond_to.rb
@@ -36,7 +36,7 @@ def self.registered(app)
# Let through sinatra image urls in development
next if self.class.development? && request.path_info =~ %r{/__sinatra__/.*?.png}
- unless options.static? && options.public? && (request.get? || request.head?) && static_file?(request.path_info)
+ unless settings.static? && settings.public_folder? && (request.get? || request.head?) && static_file?(request.path_info)
if request.params.has_key? 'format'
format params['format']
else
@@ -46,7 +46,7 @@ def self.registered(app)
# for.
request.path_info = request.path_info.sub %r{\.([^\./]+)$}, ''
- format $1 || (request.xhr? && options.assume_xhr_is_js? ? :js : options.default_content)
+ format $1 || (request.xhr? && settings.assume_xhr_is_js? ? :js : settings.default_content)
end
end
end
@@ -174,7 +174,7 @@ def format(val=nil)
# This is mostly just a helper so request.path_info isn't changed when
# serving files from the public directory
def static_file?(path)
- public_dir = File.expand_path(options.public)
+ public_dir = File.expand_path(settings.public_folder)
path = File.expand_path(File.join(public_dir, unescape(path)))
path[0, public_dir.length] == public_dir && File.file?(path)
View
2  lib/sinatra/respond_to/version.rb
@@ -1,5 +1,5 @@
module Sinatra
module RespondTo
- Version = '0.7.0'
+ Version = '0.8.0'
end
end
View
4 spec/app/test_app.rb
@@ -8,7 +8,7 @@ class TestApp < Sinatra::Base
register Sinatra::RespondTo
set :views, File.join(File.dirname(__FILE__), 'views')
- set :public, File.join(File.dirname(__FILE__), 'public')
+ set :public_folder, File.join(File.dirname(__FILE__), 'public')
get '/resource' do
respond_to do |wants|
@@ -52,4 +52,4 @@ class TestApp < Sinatra::Base
wants.css { sass :missing }
end
end
-end
+end
View
4 spec/extension_spec.rb
@@ -5,7 +5,7 @@ def mime_type(sym)
::Sinatra::Base.mime_type(sym)
end
- describe "options" do
+ describe "settings" do
it "should initialize with :default_content set to :html" do
TestApp.default_content.should == :html
end
@@ -341,7 +341,7 @@ def mime_type(sym)
TestApp.disable :static
end
- def options
+ def settings
TestApp
end

No commit comments for this range

Something went wrong with that request. Please try again.