Module: Chanko::Config

Defined in:
lib/chanko/config.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.auto_reloadObject

Returns the value of attribute auto_reload.



6
7
8
# File 'lib/chanko/config.rb', line 6

def auto_reload
  @auto_reload
end

.backtrace_limitObject

Returns the value of attribute backtrace_limit.



6
7
8
# File 'lib/chanko/config.rb', line 6

def backtrace_limit
  @backtrace_limit
end

.cache_unitsObject

Returns the value of attribute cache_units.



6
7
8
# File 'lib/chanko/config.rb', line 6

def cache_units
  @cache_units
end

.compatible_css_classObject

Returns the value of attribute compatible_css_class.



6
7
8
# File 'lib/chanko/config.rb', line 6

def compatible_css_class
  @compatible_css_class
end

.enable_loggerObject

Returns the value of attribute enable_logger.



6
7
8
# File 'lib/chanko/config.rb', line 6

def enable_logger
  @enable_logger
end

.propagated_errorsObject

Returns the value of attribute propagated_errors.



6
7
8
# File 'lib/chanko/config.rb', line 6

def propagated_errors
  @propagated_errors
end

.proxy_method_nameObject

Returns the value of attribute proxy_method_name.



6
7
8
# File 'lib/chanko/config.rb', line 6

def proxy_method_name
  @proxy_method_name
end

.raise_errorObject

Returns the value of attribute raise_error.



6
7
8
# File 'lib/chanko/config.rb', line 6

def raise_error
  @raise_error
end

Class Method Details

.resetObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/chanko/config.rb', line 18

def reset
  self.auto_reload          = Rails.env.development? || Rails.env.test?
  self.backtrace_limit      = 10
  self.compatible_css_class = false
  self.enable_logger        = true
  self.propagated_errors    = []
  self.proxy_method_name    = :unit
  self.raise_error          = Rails.env.development?
  self.resolver = resolver_for_using_rails_and_env
  self.units_directory_path = "app/units"
end

.resolver_for_using_rails_and_envObject



38
39
40
41
42
# File 'lib/chanko/config.rb', line 38

def resolver_for_using_rails_and_env
  return ActionView::FileSystemResolver if Rails::VERSION::MAJOR >= 7
  return Chanko::Resolver::NoCacheFileSystemResolver if Rails.env.development?
  return ActionView::OptimizedFileSystemResolver
end

.units_directory_pathObject



34
35
36
# File 'lib/chanko/config.rb', line 34

def units_directory_path
  @resolved_units_directory_path ||= Rails.root.join(@units_directory_path).to_s
end

.units_directory_path=(path) ⇒ Object



30
31
32
# File 'lib/chanko/config.rb', line 30

def units_directory_path=(path)
  @units_directory_path = path
end