Remove deprecation warnings in railties

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Carlos Antonio da Silva 2010-09-05 13:35:46 -03:00 committed by José Valim
parent 3bd3e992ff
commit 7204bb0feb
3 changed files with 0 additions and 79 deletions

View File

@ -1,5 +1,4 @@
require 'open-uri'
require 'active_support/deprecation'
require 'rbconfig'
module Rails
@ -53,20 +52,6 @@ module Rails
options = args.extract_options!
name, version = args
# Deal with deprecated options
{ :env => :group, :only => :group,
:lib => :require, :require_as => :require }.each do |old, new|
next unless options[old]
options[new] = options.delete(old)
ActiveSupport::Deprecation.warn "#{old.inspect} option in gem is deprecated, use #{new.inspect} instead"
end
# Deal with deprecated source
if source = options.delete(:source)
ActiveSupport::Deprecation.warn ":source option in gem is deprecated, use add_source method instead"
add_source(source)
end
# Set the message to be shown in logs. Uses the git repo if one is given,
# otherwise use name (version).
parts, message = [ name.inspect ], name
@ -257,16 +242,6 @@ module Rails
in_root { run("#{extify(:capify)} .", :verbose => false) }
end
# Add Rails to /vendor/rails
#
# ==== Example
#
# freeze!
#
def freeze!(args={})
ActiveSupport::Deprecation.warn "freeze! is deprecated since your rails app now comes bundled with Rails by default, please check your Gemfile"
end
# Make an entry in Rails routing file config/routes.rb
#
# === Example

View File

@ -1,21 +1,4 @@
namespace :rails do
namespace :freeze do
# 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'
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'
task :unfreeze do
abort 'The unfreeze command has been deprecated, please use bundler commands instead'
end
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" ]

View File

@ -79,37 +79,6 @@ class ActionsTest < Rails::Generators::TestCase
assert_file 'Gemfile', /gem "will\-paginate"/
end
def test_gem_with_options_should_include_all_options_in_gemfile
run_generator
assert_deprecated do
action :gem, 'mislav-will-paginate', :lib => 'will-paginate', :source => 'http://gems.github.com'
end
assert_deprecated do
action :gem, 'thoughtbot-factory_girl', :require_as => 'factory_girl', :source => 'http://gems.github.com'
end
assert_file 'Gemfile', /gem "mislav\-will\-paginate", :require => "will\-paginate"/
assert_file 'Gemfile', /source "http:\/\/gems\.github\.com"/
assert_file 'Gemfile', /gem "thoughtbot-factory_girl", :require => "factory_girl"/
end
def test_gem_with_env_should_include_all_dependencies_in_gemfile
run_generator
assert_deprecated do
action :gem, 'rspec', :env => %w(development test)
end
assert_deprecated do
action :gem, 'rspec-rails', :only => %w(development test)
end
assert_file 'Gemfile', /gem "rspec", :group => \["development", "test"\]/
assert_file 'Gemfile', /gem "rspec-rails", :group => \["development", "test"\]/
end
def test_gem_with_version_should_include_version_in_gemfile
run_generator
@ -204,12 +173,6 @@ class ActionsTest < Rails::Generators::TestCase
action :capify!
end
def test_freeze_is_deprecated
assert_deprecated do
action :freeze!
end
end
def test_route_should_add_data_to_the_routes_block_in_config_routes
run_generator
route_command = "route '/login', :controller => 'sessions', :action => 'new'"