Class: PropelApi::UnpackGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/propel_api/unpack/unpack_generator.rb

Instance Method Summary collapse

Instance Method Details

#unpack_propel_api_generatorObject



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/generators/propel_api/unpack/unpack_generator.rb', line 63

def unpack_propel_api_generator
  show_welcome_message
  
  components_to_unpack = determine_components
  destination_path = "lib/generators/propel_api"
  
  if File.exist?(destination_path) && !options[:force]
    say "⚠️  #{destination_path} already exists (use --force to overwrite)", :yellow
    return
  end

  say "📦 Extracting PropelApi generator components: #{components_to_unpack.join(', ')}", :green
  say ""

  unpack_components(components_to_unpack, destination_path)
  show_completion_message(destination_path)
end