lib/requirejs/rails/rjs_driver.js.erb in requirejs-rails-0.6.1 vs lib/requirejs/rails/rjs_driver.js.erb in requirejs-rails-0.7.0

- old
+ new

@@ -1,33 +1,23 @@ //Load the requirejs optimizer var requirejs = require('<%= rjs_path %>'), - //Set up basic config, include config that is - //common to all the optimize() calls. - basConfig = <%= JSON.pretty_generate(build_config.reject {|k,v| k == 'modules'}) %>; + //Set up basic config, include config that is + //common to all the optimize() calls. + basConfig = <%= JSON.pretty_generate(build_config.reject {|k,v| k == 'modules'}) %>; // Function used to mix in baseConfig to a new config target function mix(target) { - for (var prop in basConfig) { - if (basConfig.hasOwnProperty(prop)) { - target[prop] = basConfig[prop]; - } + for (var prop in basConfig) { + if (basConfig.hasOwnProperty(prop)) { + target[prop] = basConfig[prop]; } - return target; + } + return target; } var module_specs = [ <% build_config['modules'].each do |m| %> - { - name: "<%= m['name'] %>", - <% if m['include'] %> - include: [<%= m['include'].map {|i| "'#{i}'" }.join(", ") %>], - <% end %> - <% if m['exclude'] %> - exclude: [<%= m['exclude'].map {|i| "'#{i}'" }.join(", ") %>], - <% end %> - - out: '<%= module_path_for m['name'] %>' - }, +<%= JSON.pretty_generate(m.merge 'out' => module_path_for(m).to_s ) %>, <% end %> ]; // Do a series of builds of individual files, using the args suggested by: // http://requirejs.org/docs/optimization.html#onejs