aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r--railties/lib/rails/tasks/documentation.rake7
-rw-r--r--railties/lib/rails/tasks/framework.rake10
-rw-r--r--railties/lib/rails/tasks/misc.rake8
3 files changed, 12 insertions, 13 deletions
diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake
index abf9b33ae5..f2fee45594 100644
--- a/railties/lib/rails/tasks/documentation.rake
+++ b/railties/lib/rails/tasks/documentation.rake
@@ -66,13 +66,14 @@ namespace :doc do
task :plugins => plugins.collect { |plugin| "doc:plugins:#{plugin}" }
desc "Remove plugin documentation"
- task :clobber_plugins do
+ task :clobber_plugins do
rm_rf 'doc/plugins' rescue nil
end
desc "Generate Rails guides"
task :guides do
- require File.join(RAILTIES_PATH, "guides/rails_guides")
+ # FIXME: Reaching outside lib directory is a bad idea
+ require File.expand_path('../../../../guides/rails_guides', __FILE__)
RailsGuides::Generator.new(Rails.root.join("doc/guides")).generate
end
@@ -92,7 +93,7 @@ namespace :doc do
files.include("#{plugin_base}/lib/**/*.rb")
if File.exist?("#{plugin_base}/README")
- files.include("#{plugin_base}/README")
+ files.include("#{plugin_base}/README")
options << "--main '#{plugin_base}/README'"
end
files.include("#{plugin_base}/CHANGELOG") if File.exist?("#{plugin_base}/CHANGELOG")
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake
index dbe2ac54ed..cd9516033e 100644
--- a/railties/lib/rails/tasks/framework.rake
+++ b/railties/lib/rails/tasks/framework.rake
@@ -2,18 +2,18 @@ namespace :rails do
namespace :freeze do
desc "The rails:freeze:gems is deprecated, please use bundle install instead"
task :gems do
- puts "The rails:freeze:gems is deprecated, please use bundle install instead"
+ 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'
task :edge do
- puts 'The freeze:edge command has been deprecated, specify the path setting in your app Gemfile instead and bundle install'
+ 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'
task :unfreeze do
- puts 'The unfreeze command has been deprecated, please use bundler commands instead'
+ abort 'The unfreeze command has been deprecated, please use bundler commands instead'
end
desc "Update both configs, scripts and public/javascripts from Rails"
@@ -25,7 +25,7 @@ namespace :rails do
template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
require 'rails/generators'
- require 'generators/rails/app/app_generator'
+ require 'rails/generators/rails/app/app_generator'
generator = Rails::Generators::AppGenerator.new [ Rails.root ], {}, :destination_root => Rails.root
generator.apply template, :verbose => false
end
@@ -38,7 +38,7 @@ namespace :rails do
def app_generator
@app_generator ||= begin
require 'rails/generators'
- require 'generators/rails/app/app_generator'
+ require 'rails/generators/rails/app/app_generator'
gen = Rails::Generators::AppGenerator.new ["rails"], { :with_dispatchers => true },
:destination_root => Rails.root
gen.send(:valid_app_const?)
diff --git a/railties/lib/rails/tasks/misc.rake b/railties/lib/rails/tasks/misc.rake
index 48fce92215..0926707a04 100644
--- a/railties/lib/rails/tasks/misc.rake
+++ b/railties/lib/rails/tasks/misc.rake
@@ -15,8 +15,6 @@ end
desc 'Explain the current environment'
task :about do
- $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
- require 'rails/info'
puts Rails::Info
end
@@ -26,12 +24,12 @@ namespace :time do
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'
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'
task :local do
require 'active_support'
@@ -41,7 +39,7 @@ namespace :time do
offset = jan_offset < jul_offset ? jan_offset : jul_offset
build_time_zone_list(:all, offset)
end
-
+
# to find UTC -06:00 zones, OFFSET can be set to either -6, -6:00 or 21600
def build_time_zone_list(method, offset = ENV['OFFSET'])
require 'active_support'