mirror of https://github.com/rails/rails
Clean up module docs [ci skip]
Removed some useless docstrings and no-doc'ed some.
This commit is contained in:
parent
f3a3203b00
commit
7c90d91c3c
|
@ -1,10 +1,10 @@
|
|||
# Includes +url_for+ into the host class (e.g. an abstract controller or mailer). The class
|
||||
# has to provide a +RouteSet+ by implementing the <tt>_routes</tt> methods. Otherwise, an
|
||||
# exception will be raised.
|
||||
#
|
||||
# Note that this module is completely decoupled from HTTP - the only requirement is a valid
|
||||
# <tt>_routes</tt> implementation.
|
||||
module AbstractController
|
||||
# Includes +url_for+ into the host class (e.g. an abstract controller or mailer). The class
|
||||
# has to provide a +RouteSet+ by implementing the <tt>_routes</tt> methods. Otherwise, an
|
||||
# exception will be raised.
|
||||
#
|
||||
# Note that this module is completely decoupled from HTTP - the only requirement is a valid
|
||||
# <tt>_routes</tt> implementation.
|
||||
module UrlFor
|
||||
extend ActiveSupport::Concern
|
||||
include ActionDispatch::Routing::UrlFor
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
# Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing
|
||||
# the <tt>_routes</tt> method. Otherwise, an exception will be raised.
|
||||
#
|
||||
# In addition to <tt>AbstractController::UrlFor</tt>, this module accesses the HTTP layer to define
|
||||
# url options like the +host+. In order to do so, this module requires the host class
|
||||
# to implement +env+ and +request+, which need to be a Rack-compatible.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# class RootUrl
|
||||
# include ActionController::UrlFor
|
||||
# include Rails.application.routes.url_helpers
|
||||
#
|
||||
# delegate :env, :request, :to => :controller
|
||||
#
|
||||
# def initialize(controller)
|
||||
# @controller = controller
|
||||
# @url = root_path # named route from the application.
|
||||
# end
|
||||
# end
|
||||
#
|
||||
module ActionController
|
||||
# Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing
|
||||
# the <tt>_routes</tt> method. Otherwise, an exception will be raised.
|
||||
#
|
||||
# In addition to <tt>AbstractController::UrlFor</tt>, this module accesses the HTTP layer to define
|
||||
# url options like the +host+. In order to do so, this module requires the host class
|
||||
# to implement +env+ and +request+, which need to be a Rack-compatible.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# class RootUrl
|
||||
# include ActionController::UrlFor
|
||||
# include Rails.application.routes.url_helpers
|
||||
#
|
||||
# delegate :env, :request, :to => :controller
|
||||
#
|
||||
# def initialize(controller)
|
||||
# @controller = controller
|
||||
# @url = root_path # named route from the application.
|
||||
# end
|
||||
# end
|
||||
#
|
||||
module UrlFor
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#FIXME Remove if ArJdbcMysql will give.
|
||||
module ArJdbcMySQL #:nodoc:
|
||||
class Error < StandardError
|
||||
class Error < StandardError #:nodoc:
|
||||
attr_accessor :error_number, :sql_state
|
||||
|
||||
def initialize msg
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
require 'active_support/core_ext/hash/keys'
|
||||
|
||||
# This class has dubious semantics and we only have it so that
|
||||
# people can write <tt>params[:key]</tt> instead of <tt>params['key']</tt>
|
||||
# and they get the same value for both keys.
|
||||
|
||||
module ActiveSupport
|
||||
# This class has dubious semantics and we only have it so that
|
||||
# people can write <tt>params[:key]</tt> instead of <tt>params['key']</tt>
|
||||
# and they get the same value for both keys.
|
||||
class HashWithIndifferentAccess < Hash
|
||||
|
||||
# Always returns true, so that <tt>Array#extract_options!</tt> finds members of this class.
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
# lazy_load_hooks allows rails to lazily load a lot of components and thus making the app boot faster. Because of
|
||||
# this feature now there is no need to require <tt>ActiveRecord::Base</tt> at boot time purely to apply configuration. Instead
|
||||
# a hook is registered that applies configuration once <tt>ActiveRecord::Base</tt> is loaded. Here <tt>ActiveRecord::Base</tt> is used
|
||||
# as example but this feature can be applied elsewhere too.
|
||||
#
|
||||
# Here is an example where +on_load+ method is called to register a hook.
|
||||
#
|
||||
# initializer "active_record.initialize_timezone" do
|
||||
# ActiveSupport.on_load(:active_record) do
|
||||
# self.time_zone_aware_attributes = true
|
||||
# self.default_timezone = :utc
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# When the entirety of +activerecord/lib/active_record/base.rb+ has been evaluated then +run_load_hooks+ is invoked.
|
||||
# The very last line of +activerecord/lib/active_record/base.rb+ is:
|
||||
#
|
||||
# ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
|
||||
#
|
||||
module ActiveSupport
|
||||
# lazy_load_hooks allows rails to lazily load a lot of components and thus making the app boot faster. Because of
|
||||
# this feature now there is no need to require <tt>ActiveRecord::Base</tt> at boot time purely to apply configuration. Instead
|
||||
# a hook is registered that applies configuration once <tt>ActiveRecord::Base</tt> is loaded. Here <tt>ActiveRecord::Base</tt> is used
|
||||
# as example but this feature can be applied elsewhere too.
|
||||
#
|
||||
# Here is an example where +on_load+ method is called to register a hook.
|
||||
#
|
||||
# initializer "active_record.initialize_timezone" do
|
||||
# ActiveSupport.on_load(:active_record) do
|
||||
# self.time_zone_aware_attributes = true
|
||||
# self.default_timezone = :utc
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# When the entirety of +activerecord/lib/active_record/base.rb+ has been evaluated then +run_load_hooks+ is invoked.
|
||||
# The very last line of +activerecord/lib/active_record/base.rb+ is:
|
||||
#
|
||||
# ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
|
||||
#
|
||||
@load_hooks = Hash.new {|h,k| h[k] = [] }
|
||||
@loaded = {}
|
||||
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
require 'active_support/core_ext/object/blank'
|
||||
require 'active_support/core_ext/object/try'
|
||||
|
||||
# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
|
||||
#
|
||||
# * Limit the set of zones provided by TZInfo to a meaningful subset of 142 zones.
|
||||
# * Retrieve and display zones with a friendlier name (e.g., "Eastern Time (US & Canada)" instead of "America/New_York").
|
||||
# * Lazily load TZInfo::Timezone instances only when they're needed.
|
||||
# * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, +parse+, +at+ and +now+ methods.
|
||||
#
|
||||
# If you set <tt>config.time_zone</tt> in the Rails Application, you can access this TimeZone object via <tt>Time.zone</tt>:
|
||||
#
|
||||
# # application.rb:
|
||||
# class Application < Rails::Application
|
||||
# config.time_zone = "Eastern Time (US & Canada)"
|
||||
# end
|
||||
#
|
||||
# Time.zone # => #<TimeZone:0x514834...>
|
||||
# Time.zone.name # => "Eastern Time (US & Canada)"
|
||||
# Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00
|
||||
#
|
||||
# The version of TZInfo bundled with Active Support only includes the definitions necessary to support the zones
|
||||
# defined by the TimeZone class. If you need to use zones that aren't defined by TimeZone, you'll need to install the TZInfo gem
|
||||
# (if a recent version of the gem is installed locally, this will be used instead of the bundled version.)
|
||||
module ActiveSupport
|
||||
# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
|
||||
#
|
||||
# * Limit the set of zones provided by TZInfo to a meaningful subset of 142 zones.
|
||||
# * Retrieve and display zones with a friendlier name (e.g., "Eastern Time (US & Canada)" instead of "America/New_York").
|
||||
# * Lazily load TZInfo::Timezone instances only when they're needed.
|
||||
# * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, +parse+, +at+ and +now+ methods.
|
||||
#
|
||||
# If you set <tt>config.time_zone</tt> in the Rails Application, you can access this TimeZone object via <tt>Time.zone</tt>:
|
||||
#
|
||||
# # application.rb:
|
||||
# class Application < Rails::Application
|
||||
# config.time_zone = "Eastern Time (US & Canada)"
|
||||
# end
|
||||
#
|
||||
# Time.zone # => #<TimeZone:0x514834...>
|
||||
# Time.zone.name # => "Eastern Time (US & Canada)"
|
||||
# Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00
|
||||
#
|
||||
# The version of TZInfo bundled with Active Support only includes the definitions necessary to support the zones
|
||||
# defined by the TimeZone class. If you need to use zones that aren't defined by TimeZone, you'll need to install the TZInfo gem
|
||||
# (if a recent version of the gem is installed locally, this will be used instead of the bundled version.)
|
||||
class TimeZone
|
||||
# Keys are Rails TimeZone names, values are TZInfo identifiers
|
||||
MAPPING = {
|
||||
|
|
|
@ -12,7 +12,6 @@ java_import org.xml.sax.InputSource unless defined? InputSource
|
|||
java_import org.xml.sax.Attributes unless defined? Attributes
|
||||
java_import org.w3c.dom.Node unless defined? Node
|
||||
|
||||
# = XmlMini JRuby JDOM implementation
|
||||
module ActiveSupport
|
||||
module XmlMini_JDOM #:nodoc:
|
||||
extend self
|
||||
|
|
|
@ -2,7 +2,6 @@ require 'libxml'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
require 'stringio'
|
||||
|
||||
# = XmlMini LibXML implementation
|
||||
module ActiveSupport
|
||||
module XmlMini_LibXML #:nodoc:
|
||||
extend self
|
||||
|
|
|
@ -2,9 +2,8 @@ require 'libxml'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
require 'stringio'
|
||||
|
||||
# = XmlMini LibXML implementation using a SAX-based parser
|
||||
module ActiveSupport
|
||||
module XmlMini_LibXMLSAX
|
||||
module XmlMini_LibXMLSAX #:nodoc:
|
||||
extend self
|
||||
|
||||
# Class that will build the hash while the XML document
|
||||
|
|
|
@ -7,7 +7,6 @@ end
|
|||
require 'active_support/core_ext/object/blank'
|
||||
require 'stringio'
|
||||
|
||||
# = XmlMini Nokogiri implementation
|
||||
module ActiveSupport
|
||||
module XmlMini_Nokogiri #:nodoc:
|
||||
extend self
|
||||
|
|
|
@ -7,9 +7,8 @@ end
|
|||
require 'active_support/core_ext/object/blank'
|
||||
require 'stringio'
|
||||
|
||||
# = XmlMini Nokogiri implementation using a SAX-based parser
|
||||
module ActiveSupport
|
||||
module XmlMini_NokogiriSAX
|
||||
module XmlMini_NokogiriSAX #:nodoc:
|
||||
extend self
|
||||
|
||||
# Class that will build the hash while the XML document
|
||||
|
|
|
@ -2,7 +2,6 @@ require 'active_support/core_ext/kernel/reporting'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
require 'stringio'
|
||||
|
||||
# = XmlMini ReXML implementation
|
||||
module ActiveSupport
|
||||
module XmlMini_REXML #:nodoc:
|
||||
extend self
|
||||
|
|
Loading…
Reference in New Issue