Class: Dployr::Init

Inherits:
Object
  • Object
show all
Includes:
Config::FileUtils
Defined in:
lib/dployr/init.rb

Constant Summary collapse

@@instance =
nil

Constants included from Config::Constants

Config::Constants::EXTENSIONS, Config::Constants::FILENAME, Config::Constants::FILENAMES

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Config::FileUtils

discover, read_yaml, yaml_file?

Constructor Details

#initialize(attributes = {}) ⇒ Init

Returns a new instance of Init.



35
36
37
38
39
# File 'lib/dployr/init.rb', line 35

def initialize(attributes = {})
  @@instance = self
  @config = Dployr::Configuration.new attributes
  @file_path = nil
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



30
31
32
# File 'lib/dployr/init.rb', line 30

def config
  @config
end

#file_pathObject

Returns the value of attribute file_path.



31
32
33
# File 'lib/dployr/init.rb', line 31

def file_path
  @file_path
end

Class Method Details

.instanceObject



41
42
43
# File 'lib/dployr/init.rb', line 41

def self.instance
  @@instance
end

Instance Method Details

#load_config(file_path = nil) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/dployr/init.rb', line 45

def load_config(file_path = nil)
  @file_path =
    if file_path
      file_path
    else
      discover
    end
  set_config @file_path
end