Class: Solidus::UpdateGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/solidus/update/update_generator.rb

Constant Summary collapse

FROM =
Spree.previous_solidus_minor_version

Instance Method Summary collapse

Instance Method Details

#create_new_defaults_initializerObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/generators/solidus/update/update_generator.rb', line 40

def create_new_defaults_initializer
  previous_version_prompt = options[:previous_version_prompt]
  return if previous_version_prompt && !yes?("    The update process is only supported if you are coming from version \#{FROM}. If this is not the case, please, skip it and update your application to use Solidus \#{FROM} before retrying.\n    If you are confident you want to upgrade from a previous version, you must rerun the generator with the \"--from={OLD_VERSION}\" argument.\n    Are you sure you want to continue? (y/N)\n  MSG\n\n  from = options[:from]\n  to = options[:to]\n  @from = from\n  @core_changes = core_changes_template(from, to)\n  @frontend_changes = frontend_changes_template(from, to)\n  @backend_changes = backend_changes_template(from, to)\n  @api_changes = api_changes_template(from, to)\n\n  template 'config/initializers/new_solidus_defaults.rb.tt',\n           File.join(options[:initializer_directory], \"\#{options[:initializer_basename]}.rb\")\nend\n", :red)


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/generators/solidus/update/update_generator.rb', line 60

def print_message
  say "\n    ***********************************************************************\n\n    Other tasks may be needed to update to the new Solidus version. Please,\n    check https://github.com/solidusio/solidus/blob/v\#{options[:to]}/CHANGELOG.md\n    for details.\n\n    Thanks for using Solidus!\n\n    ***********************************************************************\n\n  MSG\nend\n"