Class: RubyJard::Config
- Inherits:
-
Object
- Object
- RubyJard::Config
- Defined in:
- lib/ruby_jard/config.rb
Overview
Another reinvent-the-wheel configuration
Constant Summary collapse
- CONFIG_FILE_NAME =
'.jardrc'
- DEFAULTS =
[ DEFAULT_COLOR_SCHEME = '256', DEFAULT_ALIAS_TO_DEBUGGER = false, DEFAULT_LAYOUT = nil, # Pick layout automatically DEFAULT_FILTER = RubyJard::PathFilter::FILTER_APPLICATION, DEFAULT_FILTER_INCLUDED = [].freeze, DEFAULT_FILTER_EXCLUDED = [].freeze ].freeze
Instance Attribute Summary collapse
-
#alias_to_debugger ⇒ Object
Returns the value of attribute alias_to_debugger.
-
#color_scheme ⇒ Object
Returns the value of attribute color_scheme.
-
#enabled_screens ⇒ Object
Returns the value of attribute enabled_screens.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#filter_excluded ⇒ Object
Returns the value of attribute filter_excluded.
-
#filter_included ⇒ Object
Returns the value of attribute filter_included.
-
#layout ⇒ Object
Returns the value of attribute layout.
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
54 55 56 57 58 59 60 61 62 |
# File 'lib/ruby_jard/config.rb', line 54 def initialize @color_scheme = DEFAULT_COLOR_SCHEME @alias_to_debugger = DEFAULT_ALIAS_TO_DEBUGGER @layout = DEFAULT_LAYOUT @enabled_screens = RubyJard::Screens.names @filter = DEFAULT_FILTER @filter_included = DEFAULT_FILTER_INCLUDED.dup @filter_excluded = DEFAULT_FILTER_EXCLUDED.dup end |
Instance Attribute Details
#alias_to_debugger ⇒ Object
Returns the value of attribute alias_to_debugger.
41 42 43 |
# File 'lib/ruby_jard/config.rb', line 41 def alias_to_debugger @alias_to_debugger end |
#color_scheme ⇒ Object
Returns the value of attribute color_scheme.
41 42 43 |
# File 'lib/ruby_jard/config.rb', line 41 def color_scheme @color_scheme end |
#enabled_screens ⇒ Object
Returns the value of attribute enabled_screens.
41 42 43 |
# File 'lib/ruby_jard/config.rb', line 41 def enabled_screens @enabled_screens end |
#filter ⇒ Object
Returns the value of attribute filter.
41 42 43 |
# File 'lib/ruby_jard/config.rb', line 41 def filter @filter end |
#filter_excluded ⇒ Object
Returns the value of attribute filter_excluded.
41 42 43 |
# File 'lib/ruby_jard/config.rb', line 41 def filter_excluded @filter_excluded end |
#filter_included ⇒ Object
Returns the value of attribute filter_included.
41 42 43 |
# File 'lib/ruby_jard/config.rb', line 41 def filter_included @filter_included end |
#layout ⇒ Object
Returns the value of attribute layout.
41 42 43 |
# File 'lib/ruby_jard/config.rb', line 41 def layout @layout end |
Class Method Details
.smart_load ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ruby_jard/config.rb', line 8 def smart_load config = RubyJard::Config.new unless ENV['JARD_CONFIG_FILE'].nil? unless File.exist?(ENV['JARD_CONFIG_FILE']) raise "Config file '#{ENV['JARD_CONFIG_FILE']}' does not exist" end return load_config(config, ENV['JARD_CONFIG_FILE']) end path = File.(File.join(Dir.pwd, CONFIG_FILE_NAME)) load_config(config, path) if File.exist?(path) path = File.(File.join('~/', CONFIG_FILE_NAME)) load_config(config, path) if File.exist?(path) config end |
Instance Method Details
#config ⇒ Object
64 65 66 |
# File 'lib/ruby_jard/config.rb', line 64 def config self end |