Module: Rails

Defined in:
lib/generator-spec/namespaces.rb,
lib/generator-spec/rails/configure.rb,
lib/generator-spec/rails/configure.rb

Class Method Summary collapse

Class Method Details

.loggerObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/generator-spec/rails/configure.rb', line 33

def self.logger
  logger_type = RSpec::Generator.logger
  case logger_type
  when Hash
    file = logger_type[:file]      
  when :stdout
    return Logger.new(STDOUT)     
  when :file               
    file = File.expand_path "#{Rails.application.config.root_dir}/../rails_generator.log"
  else
    return Logger.new(STDOUT)
  end                 
  if file != @logger_file
    @logger_file = file
    RSpec::Generator.logfile = file 
    @logger = Logger.new(file) if file
  else
    @logger ||= Logger.new(file) if file
  end
end

.rootObject



22
23
24
# File 'lib/generator-spec/rails/configure.rb', line 22

def self.root
  @root ||= File.join(Rails.application.config.root_dir, 'rails_app')
end