Cut down on tasks shown in rake -T

上级 c9d156f0
require 'rails/source_annotation_extractor'
desc "Enumerate all annotations"
desc "Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)"
task :notes do
SourceAnnotationExtractor.enumerate "OPTIMIZE|FIXME|TODO", :tag => true
end
namespace :notes do
["OPTIMIZE", "FIXME", "TODO"].each do |annotation|
desc "Enumerate all #{annotation} annotations"
# desc "Enumerate all #{annotation} annotations"
task annotation.downcase.intern do
SourceAnnotationExtractor.enumerate annotation
end
......
......@@ -79,7 +79,7 @@ namespace :doc do
rm_rf 'doc/plugins' rescue nil
end
desc "Generate Rails guides"
desc "Generate Rails Guides"
task :guides do
# FIXME: Reaching outside lib directory is a bad idea
require File.expand_path('../../../../guides/rails_guides', __FILE__)
......
namespace :rails do
namespace :freeze do
desc "The rails:freeze:gems is deprecated, please use bundle install instead"
# desc "The rails:freeze:gems is deprecated, please use bundle install instead"
task :gems do
abort "The rails:freeze:gems is deprecated, please use bundle install instead"
end
desc 'The freeze:edge command has been deprecated, specify the path setting in your app Gemfile instead and bundle install'
# desc 'The freeze:edge command has been deprecated, specify the path setting in your app Gemfile instead and bundle install'
task :edge do
abort 'The freeze:edge command has been deprecated, specify the path setting in your app Gemfile instead and bundle install'
end
end
desc 'The unfreeze command has been deprecated, please use bundler commands instead'
# desc 'The unfreeze command has been deprecated, please use bundler commands instead'
task :unfreeze do
abort 'The unfreeze command has been deprecated, please use bundler commands instead'
end
desc "Update both configs, scripts and public/javascripts from Rails"
desc "Update both configs and public/javascripts from Rails (or use just update:javascripts or update:configs)"
task :update => [ "update:configs", "update:javascripts", "update:scripts", "update:application_controller" ]
desc "Applies the template supplied by LOCATION=/path/to/template"
......@@ -31,7 +31,7 @@ namespace :rails do
end
namespace :templates do
desc "Copy all the templates from rails to the application directory for customization. Already existing local copies will be overwritten"
# desc "Copy all the templates from rails to the application directory for customization. Already existing local copies will be overwritten"
task :copy do
generators_lib = File.expand_path("../../generators", __FILE__)
project_templates = "#{Rails.root}/lib/templates"
......@@ -69,23 +69,23 @@ namespace :rails do
end
end
desc "Update config/boot.rb from your current rails install"
# desc "Update config/boot.rb from your current rails install"
task :configs do
invoke_from_app_generator :create_boot_file
invoke_from_app_generator :create_config_files
end
desc "Update Prototype javascripts from your current rails install"
# desc "Update Prototype javascripts from your current rails install"
task :javascripts do
invoke_from_app_generator :create_prototype_files
end
desc "Adds new scripts to the application script/ directory"
# desc "Adds new scripts to the application script/ directory"
task :scripts do
invoke_from_app_generator :create_script_files
end
desc "Rename application.rb to application_controller.rb"
# desc "Rename application.rb to application_controller.rb"
task :application_controller do
old_style = Rails.root + '/app/controllers/application.rb'
new_style = Rails.root + '/app/controllers/application_controller.rb'
......
......@@ -7,7 +7,7 @@ task :rails_env do
end
end
desc 'Generate a crytographically secure secret key. This is typically used to generate a secret for cookie sessions.'
desc 'Generate a crytographically secure secret key (rhis is typically used to generate a secret for cookie sessions).'
task :secret do
require 'active_support/secure_random'
puts ActiveSupport::SecureRandom.hex(64)
......@@ -20,17 +20,17 @@ end
namespace :time do
namespace :zones do
desc 'Displays names of all time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
desc 'Displays all time zones, also available: time:zones:us, time:zones:local -- filter with OFFSET parameter, e.g., OFFSET=-6'
task :all do
build_time_zone_list(:all)
end
desc 'Displays names of US time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
# desc 'Displays names of US time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
task :us do
build_time_zone_list(:us_zones)
end
desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time'
# desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time'
task :local do
require 'active_support'
require 'active_support/time'
......
namespace :tmp do
desc "Clear session, cache, and socket files from tmp/"
desc "Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sockets:clear)"
task :clear => [ "tmp:sessions:clear", "tmp:cache:clear", "tmp:sockets:clear"]
desc "Creates tmp directories for sessions, cache, sockets, and pids"
......@@ -8,28 +8,28 @@ namespace :tmp do
end
namespace :sessions do
desc "Clears all files in tmp/sessions"
# desc "Clears all files in tmp/sessions"
task :clear do
FileUtils.rm(Dir['tmp/sessions/[^.]*'])
end
end
namespace :cache do
desc "Clears all files and directories in tmp/cache"
# desc "Clears all files and directories in tmp/cache"
task :clear do
FileUtils.rm_rf(Dir['tmp/cache/[^.]*'])
end
end
namespace :sockets do
desc "Clears all files in tmp/sockets"
# desc "Clears all files in tmp/sockets"
task :clear do
FileUtils.rm(Dir['tmp/sockets/[^.]*'])
end
end
namespace :pids do
desc "Clears all files in tmp/pids"
# desc "Clears all files in tmp/pids"
task :clear do
FileUtils.rm(Dir['tmp/pids/[^.]*'])
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册