lib/requirejs/rails/builder.rb in requirejs-rails-0.9.5 vs lib/requirejs/rails/builder.rb in requirejs-rails-0.9.6

- old
+ new

@@ -1,33 +1,25 @@ -require 'requirejs/rails' +require "ostruct" +require "pathname" -require 'pathname' -require 'ostruct' +require "requirejs/rails" -module Requirejs::Rails - class Builder - # config should be an instance of Requirejs::Rails::Config - - def initialize(config) - @config = config - end - - def build - @config.tmp_dir - end +module Requirejs + module Rails + class Builder + def initialize(config) + @config = config + end - def digest_for(path) - if !Rails.application.assets.file_digest(path).nil? - Rails.application.assets.file_digest(path).hexdigest - else - raise Requirejs::BuildError, "Cannot compute digest for missing asset: #{path}" + def build + @config.tmp_dir end - end - def generate_rjs_driver - templ = Erubis::Eruby.new(@config.driver_template_path.read) - @config.driver_path.open('w') do |f| - f.write(templ.result(@config.get_binding)) + def generate_rjs_driver + templ = Erubis::Eruby.new(@config.driver_template_path.read) + @config.driver_path.open('w') do |f| + f.write(templ.result(@config.get_binding)) + end end end end end