Module: BangBang::AppConfig::ClassMethods

Defined in:
lib/bang-bang/app_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#application_nameObject

Returns the value of attribute application_name.



8
9
10
# File 'lib/bang-bang/app_config.rb', line 8

def application_name
  @application_name
end

#stderr_dirObject

Returns the value of attribute stderr_dir.



8
9
10
# File 'lib/bang-bang/app_config.rb', line 8

def stderr_dir
  @stderr_dir
end

#stdout_dirObject

Returns the value of attribute stdout_dir.



8
9
10
# File 'lib/bang-bang/app_config.rb', line 8

def stdout_dir
  @stdout_dir
end

Instance Method Details

#init(params = {}) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/bang-bang/app_config.rb', line 10

def init(params={})
  params[:root_dir] || raise(ArgumentError, "You must provide a :root_dir param")
  params[:named_routes] || raise(ArgumentError, "You must provide a :named_routes param")
  params[:views_class] || raise(ArgumentError, "You must provide a :views_class param")
  self.application_name = params[:application_name] || raise(ArgumentError, "You must provide an :application_name param")
  params[:app_config] = self
  super
end

#stderr_loggerObject



19
20
21
# File 'lib/bang-bang/app_config.rb', line 19

def stderr_logger
  @stderr_logger ||= Logger.new(stderr_dir)
end

#stdout_loggerObject



23
24
25
# File 'lib/bang-bang/app_config.rb', line 23

def stdout_logger
  @stdout_logger ||= Logger.new(stdout_dir)
end