Browse files

Support Sinatra 1.3 (with backward compat), closes #476

  • Loading branch information...
1 parent 6ce8571 commit f03205cd5ff643b51d42467f94ab13be71f277b8 @bensie bensie committed Oct 4, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/carrierwave.rb
View
8 lib/carrierwave.rb
@@ -105,6 +105,12 @@ class Railtie < Rails::Railtie
elsif defined?(Sinatra)
- CarrierWave.root = Sinatra::Application.public
+ CarrierWave.root = if Sinatra::Application.respond_to?(:public_folder)
+ # Sinatra >= 1.3
+ Sinatra::Application.public_folder
+ else
+ # Sinatra < 1.3
+ Sinatra::Application.public
+ end
end

0 comments on commit f03205c

Please sign in to comment.