Class: PropelAuthentication::UnpackGenerator

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

Overview

PropelAuth unpacker that extracts the authentication GENERATOR into the host application

Usage:

rails generate propel_authentication:unpack                 # Unpack entire generator (code + templates)
rails generate propel_authentication:unpack --force         # Overwrite existing generator files
rails generate propel_authentication:unpack --templates-only # Only copy templates, not generator logic
rails generate propel_authentication:unpack --models-only   # Only copy model templates
rails generate propel_authentication:unpack --controllers-only # Only copy controller templates

This extracts the PropelAuthentication generator from the gem into lib/generators/propel_authentication/ so you can customize the generator logic and templates for your specific needs.

Instance Method Summary collapse

Instance Method Details

#unpack_propel_auth_generatorObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/generators/propel_authentication/unpack_generator.rb', line 46

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

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

  unpack_components(components_to_unpack, destination_path)
  show_completion_message(destination_path)
end