class FigNewton::Config
Attributes
data[RW]
filename[RW]
Public Class Methods
filepath_from_stack(config_dir, stack_name)
click to toggle source
# File lib/fig-newton/config.rb, line 6 def self.filepath_from_stack(config_dir, stack_name) File.join(config_dir, "#{stack_name}.yml") end
from_file(config_dir, stack_name)
click to toggle source
# File lib/fig-newton/config.rb, line 10 def self.from_file(config_dir, stack_name) filename = absolute_path(config_dir, stack_name) data = YAML::load_file(filename) new(data, filename) end
new(data, filename)
click to toggle source
# File lib/fig-newton/config.rb, line 17 def initialize(data, filename) @data = data @filename = filename end
Private Class Methods
absolute_path(config_path, stack_name)
click to toggle source
# File lib/fig-newton/config.rb, line 38 def self.absolute_path(config_path, stack_name) dir = if config_path[0] =~ /\// config_path else File.absolute_path(File.join(".", config_path)) end filepath_from_stack(dir, stack_name) end
Public Instance Methods
apps()
click to toggle source
# File lib/fig-newton/config.rb, line 26 def apps @apps ||= data["apps"].each_with_object({}) do |app, apps| name, config = app.flatten apps[name] = FigNewton::App.new(name, config) apps end end
name()
click to toggle source
# File lib/fig-newton/config.rb, line 22 def name data["name"] end