Sha256: e4e049d45015736fb6d089d6848d0531532a40a0f7bef69991bb4b30cefe519b

Contents?: true

Size: 577 Bytes

Versions: 23

Compression:

Stored size: 577 Bytes

Contents

class Ufo::Setting
  class Profile
    extend Memoist

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

    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
    memoize :data
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ufo-4.6.3 lib/ufo/setting/profile.rb
ufo-4.6.2 lib/ufo/setting/profile.rb
ufo-4.6.1 lib/ufo/setting/profile.rb
ufo-4.6.0 lib/ufo/setting/profile.rb
ufo-4.5.11 lib/ufo/setting/profile.rb
ufo-4.5.10 lib/ufo/setting/profile.rb
ufo-4.5.9 lib/ufo/setting/profile.rb
ufo-4.5.8 lib/ufo/setting/profile.rb
ufo-4.5.7 lib/ufo/setting/profile.rb
ufo-4.5.6 lib/ufo/setting/profile.rb
ufo-4.5.5 lib/ufo/setting/profile.rb
ufo-4.5.4 lib/ufo/setting/profile.rb
ufo-4.5.3 lib/ufo/setting/profile.rb
ufo-4.5.2 lib/ufo/setting/profile.rb
ufo-4.5.1 lib/ufo/setting/profile.rb
ufo-4.5.0 lib/ufo/setting/profile.rb
ufo-4.4.3 lib/ufo/setting/profile.rb
ufo-4.4.2 lib/ufo/setting/profile.rb
ufo-4.4.1 lib/ufo/setting/profile.rb
ufo-4.4.0 lib/ufo/setting/profile.rb