lib/barista.rb in barista-0.1.1 vs lib/barista.rb in barista-0.1.2

- old
+ new

@@ -1,12 +1,12 @@ require 'active_support' require 'pathname' module Barista - autoload :Compiler, 'barista/compiler' - autoload :AroundFilter, 'barista/around_filter' + autoload :Compiler, 'barista/compiler' + autoload :Filter, 'barista/filter' class << self def root @root ||= Rails.root.join("app", "scripts") @@ -35,10 +35,11 @@ def compile_file!(file, force = false) file = file.to_s file = root.join(file).to_s unless file.include?(root.to_s) destination_path = file.gsub(/\.(coffee|js)\Z/, '').gsub(root.to_s, output_root.to_s) + ".js" return unless force || should_compile_file?(file, destination_path) + Rails.logger.debug "[Barista] Compiling #{file} to #{destination_path}" File.open(destination_path, "w+") do |f| f.write Compiler.compile(File.read(file)) end true rescue SysCallError @@ -67,10 +68,10 @@ rake_tasks do load File.expand_path('./barista/tasks/barista.rake', File.dirname(__FILE__)) end initializer "barista.wrap_filter" do - ApplicationController.around_filter(Barista::AroundFilter) if Barista.add_filter? + ActionController::Base.before_filter(Barista::Filter) if Barista.add_filter? end end end \ No newline at end of file