class Ufo::Docker::Variables
Public Class Methods
new(full_image_name, options={})
click to toggle source
# File lib/ufo/docker/variables.rb, line 5 def initialize(full_image_name, options={}) @full_image_name, @options = full_image_name, options end
Public Instance Methods
current_data()
click to toggle source
# File lib/ufo/docker/variables.rb, line 22 def current_data File.exist?(@@variables_path) ? YAML.load_file(@@variables_path) : {} end
update()
click to toggle source
# File lib/ufo/docker/variables.rb, line 9 def update data = current_data data[Ufo.env] ||= {} data[Ufo.env]["base_image"] = @full_image_name pretty_path = @@variables_path.sub("#{Ufo.root}/", "") IO.write(@@variables_path, YAML.dump(data)) unless @options[:mute] puts "The #{pretty_path} base_image has been updated with the latest base image:".color(:green) puts " #{@full_image_name}".color(:green) end end