Class: Alphonse::Config
- Inherits:
-
Hash
- Object
- Hash
- Alphonse::Config
- Defined in:
- lib/alphonse/config.rb
Constant Summary collapse
- FONZFILE =
"./Fonzfile"
Instance Attribute Summary collapse
-
#loaded ⇒ Object
readonly
Returns the value of attribute loaded.
Attributes included from Alphonse::Configs::Operation
Class Method Summary collapse
-
.init ⇒ Object
Initialise the Fonzfile.
Instance Method Summary collapse
- #config ⇒ Object
- #config_loaded? ⇒ Boolean
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #operator ⇒ Object
- #set_attr(hash) ⇒ Object
Methods included from Alphonse::Configs::Operation
Methods included from Alphonse::Configs::Setting
#app_name, #branch, #env_path, #git_repo, #hosts, #path, #restart_command, #ruby_bin_path, #start_command, #user
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
27 28 29 30 31 |
# File 'lib/alphonse/config.rb', line 27 def initialize( = {}) @loaded = false self.merge! run_fonzfile end |
Instance Attribute Details
#loaded ⇒ Object (readonly)
Returns the value of attribute loaded.
11 12 13 |
# File 'lib/alphonse/config.rb', line 11 def loaded @loaded end |
Class Method Details
.init ⇒ Object
Initialise the Fonzfile
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/alphonse/config.rb', line 14 def self.init puts "Fonzie Initialise!" pwd = File.dirname(__FILE__) if RUBY_VERSION == /1.8/ require 'ftools' File.copy("#{pwd}/default/fonzfile.rb", FONZFILE) else require 'fileutils' ::FileUtils.copy("#{pwd}/default/fonzfile.rb", FONZFILE) end end |
Instance Method Details
#config ⇒ Object
42 43 44 |
# File 'lib/alphonse/config.rb', line 42 def config self end |
#config_loaded? ⇒ Boolean
46 47 48 |
# File 'lib/alphonse/config.rb', line 46 def config_loaded? loaded end |
#operator ⇒ Object
33 34 35 |
# File 'lib/alphonse/config.rb', line 33 def operator Operator.new(self) end |
#set_attr(hash) ⇒ Object
38 39 40 |
# File 'lib/alphonse/config.rb', line 38 def set_attr(hash) config.merge! hash end |