Module: JuicerRails

Defined in:
lib/juicer-rails.rb,
lib/juicer-rails/railtie.rb,
lib/juicer-rails/version.rb

Defined Under Namespace

Classes: Railtie

Constant Summary collapse

VERSION =
"0.1.2"
@@config_file =

Rails 3 set this with Railtie. Rails.root is nil at this stage Rails 2 has Rails.root defined so we can use it

Rails.root.join('config/assets.yml')
@@config =
YAML.load_file(config_file)
@@environment =
Rails.env
@@compile_environments =
%w[production]
@@always_compile =
false
@@compiled_assets_directory =
'assets'

Class Method Summary collapse

Class Method Details

.perform_compilation?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/juicer-rails.rb', line 32

def self.perform_compilation?
  always_compile || compile_environments.include?(environment)
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (JuicerRails)

    the object that the method was called on



36
37
38
# File 'lib/juicer-rails.rb', line 36

def self.setup
  yield self
end

.warn(text) ⇒ Object



40
41
42
# File 'lib/juicer-rails.rb', line 40

def self.warn(text)
  ActiveSupport::Deprecation.warn("** JUICER-RAILS: #{text}")
end