Class: FuncE::Config
Overview
Singleton class for configuring FuncE.
Constant Summary collapse
- DEFAULT_INSTALL_DIR =
'funcs'
Instance Attribute Summary collapse
-
#fn_dir_path ⇒ Object
Returns the value of attribute fn_dir_path.
Class Method Summary collapse
Instance Attribute Details
#fn_dir_path ⇒ Object
Returns the value of attribute fn_dir_path.
13 14 15 |
# File 'lib/func_e/config.rb', line 13 def fn_dir_path @fn_dir_path end |
Class Method Details
.config ⇒ Object
19 20 21 |
# File 'lib/func_e/config.rb', line 19 def self.config instance end |
.configure {|instance| ... } ⇒ Object
15 16 17 |
# File 'lib/func_e/config.rb', line 15 def self.configure yield instance end |
.get(key) ⇒ Object
23 24 25 |
# File 'lib/func_e/config.rb', line 23 def self.get(key) instance.send(key) end |
.install_path ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/func_e/config.rb', line 27 def self.install_path if defined?(Rails) Rails.root.join(@fn_dir_path || DEFAULT_INSTALL_DIR) elsif defined?(Bundler) Bundler.root.join(@fn_dir_path || DEFAULT_INSTALL_DIR) else Pathname.new(Dir.pwd).join(@fn_dir_path || DEFAULT_INSTALL_DIR) end end |