提交 61864909 编写于 作者: M Marcel Molina

Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 df26041c
*SVN*
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
* Correct spurious documentation example code which results in a SyntaxError. [Marcel Molina Jr.] * Correct spurious documentation example code which results in a SyntaxError. [Marcel Molina Jr.]
*1.2.1* (April 6th, 2006) *1.2.1* (April 6th, 2006)
......
module ActionMailer module ActionMailer
module AdvAttrAccessor #:nodoc: module AdvAttrAccessor #:nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
module ActionMailer module ActionMailer
module Helpers #:nodoc: module Helpers #:nodoc:
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
# Initialize the base module to aggregate its helpers. # Initialize the base module to aggregate its helpers.
base.class_inheritable_accessor :master_helper_module base.class_inheritable_accessor :master_helper_module
base.master_helper_module = Module.new base.master_helper_module = Module.new
......
*SVN* *SVN*
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
* Use #flush between switching from #write to #syswrite. Closes #4907. [Blair Zajac <blair@orcaware.com>] * Use #flush between switching from #write to #syswrite. Closes #4907. [Blair Zajac <blair@orcaware.com>]
* Documentation fix: integration test scripts don't require integration_test. Closes #4914. [Frederick Ros <sl33p3r@free.fr>] * Documentation fix: integration test scripts don't require integration_test. Closes #4914. [Frederick Ros <sl33p3r@free.fr>]
...@@ -1930,7 +1932,7 @@ Default YAML web services were retired, ActionController::Base.param_parsers car ...@@ -1930,7 +1932,7 @@ Default YAML web services were retired, ActionController::Base.param_parsers car
Before: Before:
module WeblogHelper module WeblogHelper
def self.append_features(controller) #:nodoc: def self.included(controller) #:nodoc:
controller.ancestors.include?(ActionController::Base) ? controller.add_template_helper(self) : super controller.ancestors.include?(ActionController::Base) ? controller.add_template_helper(self) : super
end end
end end
......
...@@ -156,8 +156,7 @@ def caching_allowed ...@@ -156,8 +156,7 @@ def caching_allowed
# "david.somewhere.com/lists/show/1". This allows the cacher to differentiate between "david.somewhere.com/lists/" and # "david.somewhere.com/lists/show/1". This allows the cacher to differentiate between "david.somewhere.com/lists/" and
# "jamis.somewhere.com/lists/" -- which is a helpful way of assisting the subdomain-as-account-key pattern. # "jamis.somewhere.com/lists/" -- which is a helpful way of assisting the subdomain-as-account-key pattern.
module Actions module Actions
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
base.send(:attr_accessor, :rendered_action_cache) base.send(:attr_accessor, :rendered_action_cache)
end end
...@@ -246,8 +245,7 @@ def after(controller) ...@@ -246,8 +245,7 @@ def after(controller)
# ActionController::Base.fragment_cache_store = :mem_cache_store, "localhost" # ActionController::Base.fragment_cache_store = :mem_cache_store, "localhost"
# ActionController::Base.fragment_cache_store = MyOwnStore.new("parameter") # ActionController::Base.fragment_cache_store = MyOwnStore.new("parameter")
module Fragments module Fragments
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.class_eval do base.class_eval do
@@fragment_cache_store = MemoryStore.new @@fragment_cache_store = MemoryStore.new
cattr_reader :fragment_cache_store cattr_reader :fragment_cache_store
...@@ -493,8 +491,7 @@ def initialize(cache_path) ...@@ -493,8 +491,7 @@ def initialize(cache_path)
# #
# In the example above, four actions are cached and three actions are responsible for expiring those caches. # In the example above, four actions are cached and three actions are responsible for expiring those caches.
module Sweeping module Sweeping
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
module ActionController #:nodoc: module ActionController #:nodoc:
module Dependencies #:nodoc: module Dependencies #:nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
module ActionController #:nodoc: module ActionController #:nodoc:
module Helpers #:nodoc: module Helpers #:nodoc:
def self.append_features(base) def self.included(base)
super
# Initialize the base module to aggregate its helpers. # Initialize the base module to aggregate its helpers.
base.class_inheritable_accessor :master_helper_module base.class_inheritable_accessor :master_helper_module
......
...@@ -4,8 +4,7 @@ module ActionController ...@@ -4,8 +4,7 @@ module ActionController
# backing. # backing.
module Macros module Macros
module AutoComplete #:nodoc: module AutoComplete #:nodoc:
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
module ActionController module ActionController
module Macros module Macros
module InPlaceEditing #:nodoc: module InPlaceEditing #:nodoc:
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
...@@ -6,8 +6,7 @@ module ActionController #:nodoc: ...@@ -6,8 +6,7 @@ module ActionController #:nodoc:
# #
# You can tailor the rescuing behavior and appearance by overwriting the following two stub methods. # You can tailor the rescuing behavior and appearance by overwriting the following two stub methods.
module Rescue module Rescue
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
base.class_eval do base.class_eval do
alias_method :perform_action_without_rescue, :perform_action alias_method :perform_action_without_rescue, :perform_action
......
module ActionController module ActionController
module Scaffolding # :nodoc: module Scaffolding # :nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
module ActionController #:nodoc: module ActionController #:nodoc:
module Verification #:nodoc: module Verification #:nodoc:
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
*SVN* *SVN*
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
* Fix test database name typo. [Marcel Molina Jr.] * Fix test database name typo. [Marcel Molina Jr.]
*1.1.2* (April 9th, 2005) *1.1.2* (April 9th, 2005)
......
module ActionWebService # :nodoc: module ActionWebService # :nodoc:
module Container # :nodoc: module Container # :nodoc:
module ActionController # :nodoc: module ActionController # :nodoc:
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
class << base class << base
include ClassMethods include ClassMethods
alias_method :inherited_without_api, :inherited alias_method :inherited_without_api, :inherited
......
...@@ -4,8 +4,7 @@ module Delegated # :nodoc: ...@@ -4,8 +4,7 @@ module Delegated # :nodoc:
class ContainerError < ActionWebServiceError # :nodoc: class ContainerError < ActionWebServiceError # :nodoc:
end end
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
base.send(:include, ActionWebService::Container::Delegated::InstanceMethods) base.send(:include, ActionWebService::Container::Delegated::InstanceMethods)
end end
......
...@@ -4,8 +4,7 @@ module Direct # :nodoc: ...@@ -4,8 +4,7 @@ module Direct # :nodoc:
class ContainerError < ActionWebServiceError # :nodoc: class ContainerError < ActionWebServiceError # :nodoc:
end end
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
...@@ -5,8 +5,7 @@ module Dispatcher # :nodoc: ...@@ -5,8 +5,7 @@ module Dispatcher # :nodoc:
class DispatcherError < ActionWebService::ActionWebServiceError # :nodoc: class DispatcherError < ActionWebService::ActionWebServiceError # :nodoc:
end end
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
super
base.class_inheritable_option(:web_service_dispatching_mode, :direct) base.class_inheritable_option(:web_service_dispatching_mode, :direct)
base.class_inheritable_option(:web_service_exception_reporting, true) base.class_inheritable_option(:web_service_exception_reporting, true)
base.send(:include, ActionWebService::Dispatcher::InstanceMethods) base.send(:include, ActionWebService::Dispatcher::InstanceMethods)
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
module ActionWebService # :nodoc: module ActionWebService # :nodoc:
module Dispatcher # :nodoc: module Dispatcher # :nodoc:
module ActionController # :nodoc: module ActionController # :nodoc:
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
super
class << base class << base
include ClassMethods include ClassMethods
alias_method :inherited_without_action_controller, :inherited alias_method :inherited_without_action_controller, :inherited
......
...@@ -3,8 +3,7 @@ module Invocation # :nodoc: ...@@ -3,8 +3,7 @@ module Invocation # :nodoc:
class InvocationError < ActionWebService::ActionWebServiceError # :nodoc: class InvocationError < ActionWebService::ActionWebServiceError # :nodoc:
end end
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
base.send(:include, ActionWebService::Invocation::InstanceMethods) base.send(:include, ActionWebService::Invocation::InstanceMethods)
end end
...@@ -125,8 +124,7 @@ def condition_hash(interceptors, *methods) ...@@ -125,8 +124,7 @@ def condition_hash(interceptors, *methods)
end end
module InstanceMethods # :nodoc: module InstanceMethods # :nodoc:
def self.append_features(base) def self.included(base)
super
base.class_eval do base.class_eval do
alias_method :perform_invocation_without_interception, :perform_invocation alias_method :perform_invocation_without_interception, :perform_invocation
alias_method :perform_invocation, :perform_invocation_with_interception alias_method :perform_invocation, :perform_invocation_with_interception
......
...@@ -6,8 +6,7 @@ module Scaffolding # :nodoc: ...@@ -6,8 +6,7 @@ module Scaffolding # :nodoc:
class ScaffoldingError < ActionWebServiceError # :nodoc: class ScaffoldingError < ActionWebServiceError # :nodoc:
end end
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
*SVN* *SVN*
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
* Remove duplicate fixture entry in comments.yml. Closes #4923. [Blair Zajac <blair@orcaware.com>] * Remove duplicate fixture entry in comments.yml. Closes #4923. [Blair Zajac <blair@orcaware.com>]
* Update FrontBase adapter to check binding version. Closes #4920. [mlaster@metavillage.com] * Update FrontBase adapter to check binding version. Closes #4920. [mlaster@metavillage.com]
......
module ActiveRecord module ActiveRecord
module Acts #:nodoc: module Acts #:nodoc:
module List #:nodoc: module List #:nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
module ActiveRecord module ActiveRecord
module Acts #:nodoc: module Acts #:nodoc:
module NestedSet #:nodoc: module NestedSet #:nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
module ActiveRecord module ActiveRecord
module Acts #:nodoc: module Acts #:nodoc:
module Tree #:nodoc: module Tree #:nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
...@@ -77,8 +77,7 @@ def message ...@@ -77,8 +77,7 @@ def message
end end
module Associations # :nodoc: module Associations # :nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
...@@ -170,9 +170,7 @@ module Callbacks ...@@ -170,9 +170,7 @@ module Callbacks
after_validation_on_update before_destroy after_destroy after_validation_on_update before_destroy after_destroy
) )
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.extend(ClassMethods) base.extend(ClassMethods)
base.class_eval do base.class_eval do
class << self class << self
......
...@@ -21,8 +21,7 @@ module ActiveRecord ...@@ -21,8 +21,7 @@ module ActiveRecord
# To override the name of the lock_version column, invoke the <tt>set_locking_column</tt> method. # To override the name of the lock_version column, invoke the <tt>set_locking_column</tt> method.
# This method uses the same syntax as <tt>set_table_name</tt> # This method uses the same syntax as <tt>set_table_name</tt>
module Locking module Locking
def self.append_features(base) #:nodoc: def self.included(base) #:nodoc:
super
base.class_eval do base.class_eval do
alias_method :update_without_lock, :update alias_method :update_without_lock, :update
alias_method :update, :update_with_lock alias_method :update, :update_with_lock
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
module ActiveRecord module ActiveRecord
module Observing # :nodoc: module Observing # :nodoc:
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
...@@ -6,9 +6,7 @@ module ActiveRecord ...@@ -6,9 +6,7 @@ module ActiveRecord
# This behavior can be turned off by setting <tt>ActiveRecord::Base.record_timestamps = false</tt>. # This behavior can be turned off by setting <tt>ActiveRecord::Base.record_timestamps = false</tt>.
# This behavior by default uses local time, but can use UTC by setting <tt>ActiveRecord::Base.default_timezone = :utc</tt> # This behavior by default uses local time, but can use UTC by setting <tt>ActiveRecord::Base.default_timezone = :utc</tt>
module Timestamp module Timestamp
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
super
base.class_eval do base.class_eval do
alias_method :create_without_timestamps, :create alias_method :create_without_timestamps, :create
alias_method :create, :create_with_timestamps alias_method :create, :create_with_timestamps
......
...@@ -9,8 +9,7 @@ module Transactions # :nodoc: ...@@ -9,8 +9,7 @@ module Transactions # :nodoc:
class TransactionError < ActiveRecordError # :nodoc: class TransactionError < ActiveRecordError # :nodoc:
end end
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
base.class_eval do base.class_eval do
......
...@@ -214,8 +214,7 @@ def to_xml(options={}) ...@@ -214,8 +214,7 @@ def to_xml(options={})
module Validations module Validations
VALIDATIONS = %w( validate validate_on_create validate_on_update ) VALIDATIONS = %w( validate validate_on_create validate_on_update )
def self.append_features(base) # :nodoc: def self.included(base) # :nodoc:
super
base.extend ClassMethods base.extend ClassMethods
base.class_eval do base.class_eval do
alias_method :save_without_validation, :save alias_method :save_without_validation, :save
......
...@@ -9,8 +9,7 @@ def wrap_with(wrapper, *attributes) ...@@ -9,8 +9,7 @@ def wrap_with(wrapper, *attributes)
end end
end end
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
end end
......
*SVN* *SVN*
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
* Allow default options in with_options to be overridden. Closes #4480. [murphy@cYcnus.de] * Allow default options in with_options to be overridden. Closes #4480. [murphy@cYcnus.de]
* Added Module#alias_method_chain [Jamis Buck] * Added Module#alias_method_chain [Jamis Buck]
......
...@@ -13,8 +13,7 @@ module Conversions ...@@ -13,8 +13,7 @@ module Conversions
:rfc822 => "%a, %d %b %Y %H:%M:%S %z" :rfc822 => "%a, %d %b %Y %H:%M:%S %z"
} }
def self.append_features(klass) def self.included(klass)
super
klass.send(:alias_method, :to_default_s, :to_s) klass.send(:alias_method, :to_default_s, :to_s)
klass.send(:alias_method, :to_s, :to_formatted_s) klass.send(:alias_method, :to_s, :to_formatted_s)
end end
......
*SVN* *SVN*
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
* Added script/process/inspector to do simple process status information on Rails dispatchers keeping pid files in tmp/pids [DHH] * Added script/process/inspector to do simple process status information on Rails dispatchers keeping pid files in tmp/pids [DHH]
* Added pid file usage to script/process/spawner and script/process/reaper along with a directive in default config/lighttpd.conf file to record the pid. They will all save their pid file in tmp/pids [DHH] * Added pid file usage to script/process/spawner and script/process/reaper along with a directive in default config/lighttpd.conf file to record the pid. They will all save their pid file in tmp/pids [DHH]
......
...@@ -16,7 +16,7 @@ def self.instance(command, generator) ...@@ -16,7 +16,7 @@ def self.instance(command, generator)
# Even more convenient access to commands. Include Commands in # Even more convenient access to commands. Include Commands in
# the generator Base class to get a nice #command instance method # the generator Base class to get a nice #command instance method
# which returns a delegate for the requested command. # which returns a delegate for the requested command.
def self.append_features(base) def self.included(base)
base.send(:define_method, :command) do |command| base.send(:define_method, :command) do |command|
Commands.instance(command, self) Commands.instance(command, self)
end end
......
...@@ -48,8 +48,7 @@ module Generator ...@@ -48,8 +48,7 @@ module Generator
# the generator and how to create it. A source is anything that # the generator and how to create it. A source is anything that
# yields generators from #each. PathSource and GemSource are provided. # yields generators from #each. PathSource and GemSource are provided.
module Lookup module Lookup
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
base.use_component_sources! base.use_component_sources!
end end
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
module Rails module Rails
module Generator module Generator
module Options module Options
def self.append_features(base) def self.included(base)
super
base.extend(ClassMethods) base.extend(ClassMethods)
class << base class << base
if respond_to?(:inherited) if respond_to?(:inherited)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册