method
display_tasks_and_comments
ruby latest stable - Class:
Rake::Application
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.
display_tasks_and_comments()public
Display the tasks and comments.
# File lib/rake/application.rb, line 284
def display_tasks_and_comments # :nodoc:
displayable_tasks = tasks.select { |t|
(options.show_all_tasks || t.comment) &&
t.name =~ options.show_task_pattern
}
case options.show_tasks
when :tasks
width = displayable_tasks.map { |t| t.name_with_args.length }.max || 10
if truncate_output?
max_column = terminal_width - name.size - width - 7
else
max_column = nil
end
displayable_tasks.each do |t|
printf("#{name} %-#{width}s # %s\n",
t.name_with_args,
max_column ? truncate(t.comment, max_column) : t.comment)
end
when :describe
displayable_tasks.each do |t|
puts "#{name} #{t.name_with_args}"
comment = t.full_comment || ""
comment.split("\n").each do |line|
puts " #{line}"
end
puts
end
when :lines
displayable_tasks.each do |t|
t.locations.each do |loc|
printf "#{name} %-30s %s\n", t.name_with_args, loc
end
end
else
fail "Unknown show task mode: '#{options.show_tasks}'"
end
end Related methods
- Instance methods
- add_import
- add_loader
- collect_command_line_tasks
- default_task_name
- deprecate
- display_error_message
- display_exception_backtrace
- display_exception_details
- display_exception_message_details
- display_prerequisites
- display_tasks_and_comments
- dynamic_width
- dynamic_width_stty
- dynamic_width_tput
- exit_because_of_exception
- find_rakefile_location
- handle_options
- has_cause?
- have_rakefile
- init
- invoke_task
- load_imports
- load_rakefile
- options
- parse_task_string
- print_rakefile_directory
- rake_require
- rakefile_location
- raw_load_rakefile
- run
- run_with_threads
- standard_exception_handling
- standard_rake_options
- system_dir
- terminal_width
- thread_pool
- top_level
- trace
- truncate
- truncate_output?
- tty_output=
- tty_output?
- unix?
- windows?
- Class methods
- new
- Private methods
-
glob -
has_chain? -
select_tasks_to_show -
select_trace_output -
sort_options -
standard_system_dir