Class: ShouldaMatchmakers::ControllerMatcherGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Generator::ActionController::ControllerMatcherGeneratorHelper
Defined in:
lib/generators/shoulda_matchmakers/controller_matcher_generator.rb

Instance Method Summary collapse

Methods included from Generator::ActionController::ControllerMatcherGeneratorHelper

#filter_action_controller_controller_names_with_config_options, #filter_action_controller_controller_names_with_exclude_option, #filter_action_controller_controller_names_with_generator_exclude_and_config_options, #filter_action_controller_controller_names_with_generator_include_and_config_options, #filter_action_controller_controller_names_with_include_option, #filter_app_action_controller_descendants_names, #get_app_action_controller_descendants_names, #load_application, #save_generate

Instance Method Details

#create_controller_matchmakersObject



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/generators/shoulda_matchmakers/controller_matcher_generator.rb', line 53

def create_controller_matchmakers
  puts "\n"
  generator_options = options.to_hash
  working_generated_code_line_length = ShouldaMatchmakers.configuration.preferred_generated_code_line_length - 6
  SpinToWin.with_spinner('ShouldaMatchmakers:ControllerMatchers') do |spinner|
    spinner.banner('initializing...')
    load_application
    @app_action_controller_descendants_names = get_app_action_controller_descendants_names
  end
  puts "\n"
  generate_action_controller_controller_matchmakers(generator_options, @app_action_controller_descendants_names, working_generated_code_line_length)
end