Permalink
Browse files

Merge pull request #1 from haugstrup/master

Make sure jslint won't complain about the generated routes
  • Loading branch information...
2 parents c78c3e5 + 39e6cdf commit e223af1914c4b533c7c0a9818fd4a9151599b1b8 @RSpace committed Mar 7, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/js_routes.rb
View
@@ -64,7 +64,7 @@ def generate!(file_name, opts = {})
# full environment will be available during asset compilation.
# This is required to ensure routes are loaded.
def assert_usable_configuration!
- unless Rails.application.config.assets.initialize_on_precompile
+ unless Rails.application.config.assets.initialize_on_precompile
raise("Cannot precompile js-routes unless environment is initialized. Please set config.assets.initialize_on_precompile to true.")
end
true
@@ -127,7 +127,7 @@ def build_js(route)
_ = <<-JS.strip!
// #{route.name} => #{route.path.spec}
#{route.name}_path: function(#{build_params(route)}) {
- return Utils.build_path(#{json(route.required_parts)}, #{json(serialize(route.path.spec))}, arguments)
+ return Utils.build_path(#{json(route.required_parts)}, #{json(serialize(route.path.spec))}, arguments);
}
JS
end
@@ -152,7 +152,7 @@ def build_params route
def serialize(spec)
return nil unless spec
return spec.tr(':', '') if spec.is_a?(String)
- [
+ [
NODE_TYPES[spec.type],
serialize(spec.left),
spec.respond_to?(:right) && serialize(spec.right)

0 comments on commit e223af1

Please sign in to comment.