Class: Rails::Command::RakeCommand

Inherits:
Base show all
Extended by:
Actions
Defined in:
railties/lib/rails/commands/rake/rake_command.rb

Overview

:nodoc:

Class Method Summary collapse

Methods included from Actions

boot_application!, load_environment_config!, load_generators, load_tasks, require_application!, set_application_directory!

Methods inherited from Base

banner, base_name, class_usage, command_name, default_command_root, desc, engine?, executable, exit_on_failure?, help, hide_command!, inherited, namespace, usage_path

Class Method Details

.perform(task, args, config) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'railties/lib/rails/commands/rake/rake_command.rb', line 19

def perform(task, args, config)
  with_rake(task, *args) do |rake|
    if unrecognized_task = rake.top_level_tasks.find { |task| !rake.lookup(task[/[^\[]+/]) }
      @rake_tasks = rake.tasks
      raise UnrecognizedCommandError.new(unrecognized_task)
    end

    rake.options.suppress_backtrace_pattern = non_app_file_pattern
    rake.standard_exception_handling { rake.top_level }
  end
end

.printing_commandsObject



11
12
13
14
15
16
17
# File 'railties/lib/rails/commands/rake/rake_command.rb', line 11

def printing_commands
  rake_tasks.filter_map do |task|
    if task.comment && task.locations.any?(non_app_file_pattern)
      [task.name_with_args, task.comment]
    end
  end
end