Class: MVCLI::ConfigProvider
- Inherits:
-
Object
- Object
- MVCLI::ConfigProvider
- Defined in:
- lib/mvcli/std/providers/config_provider.rb
Instance Attribute Summary collapse
-
#home ⇒ Object
readonly
Returns the value of attribute home.
Class Method Summary collapse
Instance Method Summary collapse
- #directory(name) {|pathname| ... } ⇒ Object
-
#initialize ⇒ ConfigProvider
constructor
A new instance of ConfigProvider.
Constructor Details
#initialize ⇒ ConfigProvider
Returns a new instance of ConfigProvider.
12 13 14 |
# File 'lib/mvcli/std/providers/config_provider.rb', line 12 def initialize @home = find_or_create "#{ENV['HOME']}/.#{app.name}" end |
Instance Attribute Details
#home ⇒ Object (readonly)
Returns the value of attribute home.
10 11 12 |
# File 'lib/mvcli/std/providers/config_provider.rb', line 10 def home @home end |
Class Method Details
.value ⇒ Object
6 7 8 |
# File 'lib/mvcli/std/providers/config_provider.rb', line 6 def self.value new end |
Instance Method Details
#directory(name) {|pathname| ... } ⇒ Object
16 17 18 19 20 |
# File 'lib/mvcli/std/providers/config_provider.rb', line 16 def directory(name) pathname = find_or_create @home.join name yield pathname if block_given? return pathname end |