Class: Ufo::Upgrade::Upgrade43to44

Inherits:
Object
  • Object
show all
Defined in:
lib/ufo/upgrade/upgrade43to44.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Upgrade43to44

Returns a new instance of Upgrade43to44.



6
7
8
# File 'lib/ufo/upgrade/upgrade43to44.rb', line 6

def initialize(options)
  @options = options
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ufo/upgrade/upgrade43to44.rb', line 10

def run
  settings_path = ".ufo/settings.yml"
  settings = YAML.load_file(settings_path)
  if settings["base"]["stack_naming"]
    puts "Detected stack_naming in the #{settings_path}. Already upgraded to v4.4"
    return
  end

  puts "Upgrading to ufo v4.4..."
  settings["base"]["stack_naming"] = "append_env"
  text = YAML.dump(settings)
  IO.write(settings_path, text)
  puts "Updated .ufo/settings.yml"
end