app/helpers/requirejs_helper.rb in requirejs-rails-0.9.9 vs app/helpers/requirejs_helper.rb in requirejs-rails-1.0.0
- old
+ new
@@ -1,9 +1,17 @@
require "requirejs/error"
require "requirejs/rails/view_proxy"
module RequirejsHelper
+ if defined?(Sass::Rails::VERSION)
+ sass_rails_version_pattern = Regexp.new("\\A(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\z")
+
+ SASS_RAILS_3_COMPATIBILITY = sass_rails_version_pattern.match(Sass::Rails::VERSION)[1].to_i < 4
+ else
+ SASS_RAILS_3_COMPATIBILITY = false
+ end
+
# EXPERIMENTAL: Additional priority settings appended to
# any user-specified priority setting by requirejs_include_tag.
# Used for JS test suite integration.
mattr_accessor :_priority
@@_priority = []
@@ -77,10 +85,14 @@
end
end
def javascript_path(source, options = {})
if defined?(super)
- super
+ if !SASS_RAILS_3_COMPATIBILITY
+ super
+ else
+ super(source)
+ end
else
view_proxy.javascript_path(source, options)
end
end