lib/requirejs/rails/builder.rb in requirejs-rails-0.9.1 vs lib/requirejs/rails/builder.rb in requirejs-rails-0.9.2
- old
+ new
@@ -14,16 +14,20 @@
def build
@config.tmp_dir
end
def digest_for(path)
- Rails.application.assets.file_digest(path).hexdigest
+ 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}"
+ 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))
end
end
end
-end
\ No newline at end of file
+end