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/annotations.rake2
-rw-r--r--railties/lib/rails/tasks/documentation.rake2
-rw-r--r--railties/lib/rails/tasks/framework.rake75
-rw-r--r--railties/lib/rails/tasks/misc.rake7
-rw-r--r--railties/lib/rails/tasks/routes.rake1
5 files changed, 17 insertions, 70 deletions
diff --git a/railties/lib/rails/tasks/annotations.rake b/railties/lib/rails/tasks/annotations.rake
index 79973b3145..10a9311b2d 100644
--- a/railties/lib/rails/tasks/annotations.rake
+++ b/railties/lib/rails/tasks/annotations.rake
@@ -13,7 +13,7 @@ namespace :notes do
end
end
- desc "Enumerate a custom annotation, specify with ANNOTATION=WTFHAX"
+ desc "Enumerate a custom annotation, specify with ANNOTATION=CUSTOM"
task :custom do
SourceAnnotationExtractor.enumerate ENV['ANNOTATION']
end
diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake
index 3f49a9a720..7095046f21 100644
--- a/railties/lib/rails/tasks/documentation.rake
+++ b/railties/lib/rails/tasks/documentation.rake
@@ -14,7 +14,7 @@ namespace :doc do
desc 'Generate documentation for the Rails framework. Specify path with PATH="/path/to/rails"'
Rake::RDocTask.new("rails") { |rdoc|
path = ENV['RAILS_PATH'] || 'vendor/gems/gems'
- version = '-3.0.pre' unless ENV['RAILS_PATH']
+ version = '-3.0.0.beta' unless ENV['RAILS_PATH']
rdoc.rdoc_dir = 'doc/api'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.title = "Rails Framework Documentation"
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake
index 5d7c094d8b..65d3c48f2d 100644
--- a/railties/lib/rails/tasks/framework.rake
+++ b/railties/lib/rails/tasks/framework.rake
@@ -1,80 +1,19 @@
namespace :rails do
namespace :freeze do
- desc "Lock this application to the current gems (by unpacking them into vendor/rails)"
+ desc "The rails:freeze:gems is deprecated, please use bundle install instead"
task :gems do
- deps = %w(actionpack activerecord actionmailer activesupport activeresource)
- require 'rubygems'
- require 'rubygems/gem_runner'
-
- rails = (version = ENV['VERSION']) ?
- Gem.cache.find_name('rails', "= #{version}").first :
- Gem.cache.find_name('rails').sort_by { |g| g.version }.last
-
- version ||= rails.version
-
- unless rails
- puts "No rails gem #{version} is installed. Do 'gem list rails' to see what you have available."
- exit
- end
-
- puts "Freezing to the gems for Rails #{rails.version}"
- rm_rf "vendor/rails"
- mkdir_p "vendor/rails"
-
- begin
- chdir("vendor/rails") do
- rails.dependencies.select { |g| deps.include? g.name }.each do |g|
- Gem::GemRunner.new.run(["unpack", g.name, "--version", g.version_requirements.to_s])
- mv(Dir.glob("#{g.name}*").first, g.name)
- end
-
- Gem::GemRunner.new.run(["unpack", "rails", "--version", "=#{version}"])
- FileUtils.mv(Dir.glob("rails*").first, "railties")
- end
- rescue Exception
- rm_rf "vendor/rails"
- raise
- end
+ puts "The rails:freeze:gems is deprecated, please use bundle install instead"
end
- desc 'Lock to latest Edge Rails, for a specific release use RELEASE=1.2.0'
+ desc 'The freeze:edge command has been deprecated, specify the path setting in your app Gemfile instead and bundle install'
task :edge do
- require 'open-uri'
- version = ENV["RELEASE"] || "edge"
- target = "rails_#{version}.zip"
- commits = "http://github.com/api/v1/yaml/rails/rails/commits/master"
- url = "http://dev.rubyonrails.org/archives/#{target}"
-
- chdir 'vendor' do
- latest_revision = YAML.load(open(commits))["commits"].first["id"]
-
- puts "Downloading Rails from #{url}"
- File.open('rails.zip', 'wb') do |dst|
- open url do |src|
- while chunk = src.read(4096)
- dst << chunk
- end
- end
- end
-
- puts 'Unpacking Rails'
- rm_rf 'rails'
- `unzip rails.zip`
- %w(rails.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner|
- rm_f goner
- end
-
- touch "rails/REVISION_#{latest_revision}"
- end
-
- puts 'Updating current scripts, javascripts, and configuration settings'
- Rake::Task['rails:update'].invoke
+ puts 'The freeze:edge command has been deprecated, specify the path setting in your app Gemfile instead and bundle install'
end
end
- desc "Unlock this application from freeze of gems or edge and return to a fluid use of system gems"
+ desc 'The unfreeze command has been deprecated, please use bundler commands instead'
task :unfreeze do
- rm_rf "vendor/rails"
+ puts 'The unfreeze command has been deprecated, please use bundler commands instead'
end
desc "Update both configs, scripts and public/javascripts from Rails"
@@ -112,7 +51,7 @@ namespace :rails do
invoke_from_app_generator :create_prototype_files
end
- desc "Add 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
diff --git a/railties/lib/rails/tasks/misc.rake b/railties/lib/rails/tasks/misc.rake
index 4696f02a98..48fce92215 100644
--- a/railties/lib/rails/tasks/misc.rake
+++ b/railties/lib/rails/tasks/misc.rake
@@ -13,6 +13,13 @@ task :secret do
puts ActiveSupport::SecureRandom.hex(64)
end
+desc 'Explain the current environment'
+task :about do
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
+ require 'rails/info'
+ puts Rails::Info
+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'
diff --git a/railties/lib/rails/tasks/routes.rake b/railties/lib/rails/tasks/routes.rake
index e8da72db4d..ac0f440896 100644
--- a/railties/lib/rails/tasks/routes.rake
+++ b/railties/lib/rails/tasks/routes.rake
@@ -7,6 +7,7 @@ task :routes => :environment do
reqs = route.requirements.empty? ? "" : route.requirements.inspect
{:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}
end
+ routes.reject!{ |r| r[:path] == "/rails/info/properties" } # skip the route if it's internal info route
name_width = routes.collect {|r| r[:name]}.collect {|n| n.length}.max
verb_width = routes.collect {|r| r[:verb]}.collect {|v| v.length}.max
path_width = routes.collect {|r| r[:path]}.collect {|s| s.length}.max