Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Railties deprecated methods #1288

Merged
merged 4 commits into from May 25, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 0 additions & 13 deletions railties/lib/rails/generators/rails/plugin/USAGE

This file was deleted.

54 changes: 0 additions & 54 deletions railties/lib/rails/generators/rails/plugin/plugin_generator.rb

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions railties/lib/rails/generators/rails/plugin/templates/README.tt

This file was deleted.

23 changes: 0 additions & 23 deletions railties/lib/rails/generators/rails/plugin/templates/Rakefile.tt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions railties/lib/rails/paths.rb
Expand Up @@ -2,24 +2,6 @@

module Rails
module Paths
module PathParent #:nodoc:
def method_missing(id, *args)
match = id.to_s.match(/^(.*)=$/)
full = [@current, $1 || id].compact.join("/")

ActiveSupport::Deprecation.warn 'config.paths.app.controller API is deprecated in ' <<
'favor of config.paths["app/controller"] API.'

if match || args.any?
@root[full] = Path.new(@root, full, *args)
elsif path = @root[full]
path
else
super
end
end
end

# This object is an extended hash that behaves as root of the Rails::Paths system.
# It allows you to collect information about how you want to structure your application
# paths by a Hash like API. It requires you to give a physical path on initialization.
Expand Down Expand Up @@ -63,7 +45,6 @@ def method_missing(id, *args)
#
# Check the Path documentation for more information.
class Root < ::Hash
include PathParent
attr_accessor :path

def initialize(path)
Expand Down Expand Up @@ -121,8 +102,6 @@ def filter_by(constraint)
end

class Path < Array
include PathParent

attr_reader :path
attr_accessor :glob

Expand Down Expand Up @@ -194,11 +173,6 @@ def existent
expanded.select { |f| File.exists?(f) }
end

def paths
ActiveSupport::Deprecation.warn "paths is deprecated. Please call expand instead."
expanded
end

alias to_a expanded
end
end
Expand Down
5 changes: 0 additions & 5 deletions railties/lib/rails/railtie/configuration.rb
Expand Up @@ -26,11 +26,6 @@ def app_generators
@@app_generators
end

def generators(&block) #:nodoc
ActiveSupport::Deprecation.warn "config.generators in Rails::Railtie is deprecated. Please use config.app_generators instead."
app_generators(&block)
end

# First configurable block to run. Called before any initializers are run.
def before_configuration(&block)
ActiveSupport.on_load(:before_configuration, :yield => true, &block)
Expand Down
2 changes: 1 addition & 1 deletion railties/test/application/paths_test.rb
Expand Up @@ -61,7 +61,7 @@ def assert_not_in_load_path(*path)
end

test "environments has a glob equal to the current environment" do
assert_equal "#{Rails.env}.rb", @paths.config.environments.glob
assert_equal "#{Rails.env}.rb", @paths["config/environments"].glob
end

test "load path includes each of the paths in config.paths as long as the directories exist" do
Expand Down
71 changes: 0 additions & 71 deletions railties/test/generators/plugin_generator_test.rb

This file was deleted.

53 changes: 0 additions & 53 deletions railties/test/paths_test.rb
Expand Up @@ -227,57 +227,4 @@ def setup
assert @root["app"].autoload?
assert_equal ["/app"], @root.autoload_paths
end

# Deprecated API tests

test "reading a root level path with assignment" do
@root.add "app"
assert_deprecated do
assert_equal ["/foo/bar/app"], @root.app.to_a
end
end

test "creating a root level path with assignment" do
assert_deprecated do
@root.app = "/foo/bar"
end
assert_equal ["/foo/bar"], @root["app"].to_a
end

test "creating a root level path without assignment" do
assert_deprecated do
@root.app "/foo/bar"
end
assert_equal ["/foo/bar"], @root["app"].to_a
end

test "reading a nested level path with assignment" do
@root.add "app"
@root.add "app/model"
assert_deprecated do
assert_equal ["/foo/bar/app/model"], @root.app.model.to_a
end
end

test "creating a nested level path with assignment" do
@root.add "app"
assert_deprecated do
@root.app.model = "/foo/bar"
end
assert_equal ["/foo/bar"], @root["app/model"].to_a
end

test "creating a nested level path without assignment" do
@root.add "app"
assert_deprecated do
@root.app.model "/foo/bar"
end
assert_equal ["/foo/bar"], @root["app/model"].to_a
end

test "trying to access a path that does not exist raises NoMethodError" do
assert_deprecated do
assert_raises(NoMethodError) { @root.app }
end
end
end