Class: Capistrano::Campout::Sources::YAMLSource
- Inherits:
-
Object
- Object
- Capistrano::Campout::Sources::YAMLSource
- Defined in:
- lib/capistrano-campout/options.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ YAMLSource
constructor
A new instance of YAMLSource.
-
#load ⇒ Object
returns a config hash from the YML file.
Constructor Details
#initialize(path) ⇒ YAMLSource
Returns a new instance of YAMLSource.
19 20 21 |
# File 'lib/capistrano-campout/options.rb', line 19 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
17 18 19 |
# File 'lib/capistrano-campout/options.rb', line 17 def path @path end |
Instance Method Details
#load ⇒ Object
returns a config hash from the YML file
24 25 26 27 28 29 |
# File 'lib/capistrano-campout/options.rb', line 24 def load if @path and File.exists?(@path.to_s) result = YAML.load(IO.read(@path.to_s)) end result || {} end |