Module: Protocore
- Defined in:
- lib/protocore.rb,
lib/protocore/cli.rb,
lib/protocore/version.rb,
lib/protocore/description.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.0.1"- DESCRIPTION =
"CoreOS cluster configuration generator"
Class Method Summary collapse
Class Method Details
.load(path) ⇒ Object
7 8 9 |
# File 'lib/protocore.rb', line 7 def self.load(path) parse read path end |
.parse(yaml) ⇒ Object
16 17 18 19 20 |
# File 'lib/protocore.rb', line 16 def self.parse(yaml) hosts = YAML.load(yaml)["hosts"] raise "could not parse 'hosts' key is missing" if hosts == nil return hosts.map { |host| Host.new(host) } end |
.read(path) ⇒ Object
11 12 13 14 |
# File 'lib/protocore.rb', line 11 def self.read(path) File.read(path). gsub(/(?<=\:\s)(off)(?=\n)/, '"\1"') end |