Module: Cream::GeneratorHelper

Included in:
Cancan::Generators::ConfigGenerator, Cream::Generators::AppGenerator, Cream::Generators::FullConfigGenerator, Devise::Customizers::RecoverLogin, Devise::Customizers::UserName, Devise::Customizers::UserName::AuthenticationKeys, Devise::Generators::ConfigGenerator, Devise::Generators::CustomizeGenerator, Devise::Generators::UsersGenerator, Permits::Generators::ConfigGenerator, Roles::Generators::ConfigGenerator
Defined in:
lib/generators/cream/helpers/all.rb,
lib/generators/cream/helpers/orm_helper.rb,
lib/generators/cream/helpers/args_helper.rb,
lib/generators/cream/helpers/execute_helper.rb,
lib/generators/cream/helpers/gemfile_helper.rb,
lib/generators/cream/helpers/strategy_helper.rb

Defined Under Namespace

Modules: Args, Executor, Gemfile, Orm, Strategy

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/generators/cream/helpers/all.rb', line 28

def self.included(base)
  base.class_eval do
    include Orm
    include Executor
    include Args
    include Strategy
    include Gemfile
  end
end

Instance Method Details

#add_loggerObject



13
14
15
16
17
18
# File 'lib/generators/cream/helpers/all.rb', line 13

def add_logger
  require 'logging_assist'
  class_eval do
    send :include, RailsAssist::BasicLogger
  end
end

#debug!(msg) ⇒ Object



20
21
22
# File 'lib/generators/cream/helpers/all.rb', line 20

def debug! msg
  logger.debug msg if logging?
end

#info!(msg) ⇒ Object



24
25
26
# File 'lib/generators/cream/helpers/all.rb', line 24

def info! msg
  logger.info msg if logging?
end

#logit!Object



6
7
8
9
10
11
# File 'lib/generators/cream/helpers/all.rb', line 6

def logit!  
  if logging?
    add_logger
    logger.add_logfile :logfile => logfile
  end
end