Module: Rails::Generators

Defined in:
card/lib/cardio/generators.rb

Overview

override to hide all the rails generators that don’t apply in a card/decko context

Class Method Summary collapse

Class Method Details

.generator_namesObject

TODO: autogenerate



48
49
50
# File 'card/lib/cardio/generators.rb', line 48

def generator_names
  %i[mod set migration]
end

.help(command = "generate") ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'card/lib/cardio/generators.rb', line 52

def help command="generate"
  caller = Cardio::Command.bin_name
  puts "Usage:"
  puts "  #{caller} #{command} GENERATOR [args] [options]".green
  puts
  puts "General options:"
  puts "  -h, [--help]     # Print generator's options and usage"
  puts "  -p, [--pretend]  # Run but do not make any changes"
  puts "  -f, [--force]    # Overwrite files that already exist"
  puts "  -s, [--skip]     # Skip files that already exist"
  puts "  -q, [--quiet]    # Suppress status output"
  puts
  puts "Please choose a generator below."
  puts
  generator_names.each do |name|
    puts "  #{name}".light_cyan
  end
  puts
end