Class: MrMurano::Config::ConfigFile
- Inherits:
-
Struct
- Object
- Struct
- MrMurano::Config::ConfigFile
- Defined in:
- lib/MrMurano/configFile.rb
Overview
internal transient this-run-only things (also -c options)
specified from --configfile
private .mrmuranorc.private at project dir (for things you don't want to commit)
project .mrmuranorc at project dir
user .mrmuranorc at $HOME
system .mrmuranorc at /etc
defaults Internal hardcoded defaults
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
16 17 18 |
# File 'lib/MrMurano/configFile.rb', line 16 def data @data end |
#kind ⇒ Object
Returns the value of attribute kind
16 17 18 |
# File 'lib/MrMurano/configFile.rb', line 16 def kind @kind end |
#path ⇒ Object
Returns the value of attribute path
16 17 18 |
# File 'lib/MrMurano/configFile.rb', line 16 def path @path end |
Instance Method Details
#load ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/MrMurano/configFile.rb', line 17 def load() return if kind == :internal return if kind == :defaults self[:path] = Pathname.new(path) unless path.kind_of? Pathname self[:data] = IniFile.new(:filename=>path.to_s) if self[:data].nil? self[:data].restore end |
#write ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/MrMurano/configFile.rb', line 25 def write() return if kind == :internal return if kind == :defaults self[:path] = Pathname.new(path) unless path.kind_of? Pathname self[:data] = IniFile.new(:filename=>path.to_s) if self[:data].nil? self[:data].save path.chmod(0600) end |