Class: MVCLI::ConfigProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/mvcli/std/providers/config_provider.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigProvider

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

#homeObject (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

.valueObject



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

Yields:

  • (pathname)


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