lib/barista.rb in barista-0.5.1 vs lib/barista.rb in barista-0.6.0
- old
+ new
@@ -6,10 +6,11 @@
Error = Class.new(StandardError)
CompilationError = Class.new(Error)
CompilerUnavailableError = Class.new(Error)
autoload :Compiler, 'barista/compiler'
+ autoload :Compilers, 'barista/compilers'
autoload :Filter, 'barista/filter'
autoload :Framework, 'barista/framework'
autoload :Hooks, 'barista/hooks'
class << self
@@ -133,25 +134,41 @@
def debug(message)
Rails.logger.debug "[Barista] #{message}" if defined?(Rails.logger) && Rails.logger
end
- # By default, only add it in dev / test
- def add_filter?
- Rails.env.test? || Rails.env.development?
+ def verbose?
+ @verbose ||= (defined?(Rails) && (Rails.env.test? || Rails.env.development?))
end
+
+ def verbose!
+ self.verbose = true
+ end
+
+ def verbose=(value)
+ @verbose = !!value
+ end
+ alias add_filter? verbose?
+ alias add_preamble? verbose?
+
def no_wrap?
defined?(@no_wrap) && @no_wrap
end
+ alias bare? no_wrap?
def no_wrap!
self.no_wrap = true
end
+ alias bare! no_wrap!
def no_wrap=(value)
@no_wrap = !!value
end
+ alias bare= no_wrap=
+
+ delegate :bin_path, :bin_path=, :js_path, :js_path=, :compiler, :compiler=,
+ :compiler_klass, :compiler_klass=, :to => Compiler
end
if defined?(Rails::Engine)
class Engine < Rails::Engine