Class: Ufo::Setting::Profile

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/ufo/setting/profile.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, profile = 'default') ⇒ Profile

Returns a new instance of Profile.



5
6
7
8
# File 'lib/ufo/setting/profile.rb', line 5

def initialize(type, profile='default')
  @type = type.to_s # cfn or network
  @profile = profile
end

Instance Method Details

#dataObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ufo/setting/profile.rb', line 10

def data
  path = "#{Ufo.root}/.ufo/settings/#{@type}/#{@profile}.yml"
  unless File.exist?(path)
    puts "#{@type.camelize} profile #{path} not found. Please double check that it exists."
    exit 1
  end

  text = RenderMePretty.result(path)
  # puts "text:".color(:cyan)
  # puts text
  YAML.load(text).deep_symbolize_keys
end