Class: Yoker::CLI::Update

Inherits:
Base
  • Object
show all
Defined in:
lib/yoker/cli/update.rb

Instance Method Summary collapse

Methods inherited from Base

#append_to_file, #create_file, source_root, #template

Instance Method Details

#executeObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/yoker/cli/update.rb', line 56

def execute
  detect_rails_app!

  info "Updating development environment for Rails application: #{current_directory_name}"

  current_config = detect_current_configuration
  new_config = build_updated_configuration(current_config)

  if configs_identical?(current_config, new_config)
    success "No changes detected. Environment is up to date!"
    return
  end

  display_configuration_changes(current_config, new_config)

  if options[:dry_run]
    info "Dry run mode - no changes made"
    return
  end

  unless prompt.yes?("Apply these changes?")
    info "Update cancelled"
    return
  end

  perform_update(current_config, new_config)
end