mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Encapsulate date/time core extensions and constant autoloads in active_support/core/time
This commit is contained in:
parent
48068bc1a4
commit
d848b7817f
6 changed files with 25 additions and 13 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
def self.load_all!
|
def self.load_all!
|
||||||
[Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte, SecureRandom, TimeWithZone]
|
[Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte, SecureRandom] + Core.load_all!
|
||||||
end
|
end
|
||||||
|
|
||||||
autoload :BacktraceCleaner, 'active_support/backtrace_cleaner'
|
autoload :BacktraceCleaner, 'active_support/backtrace_cleaner'
|
||||||
|
@ -46,11 +46,11 @@ module ActiveSupport
|
||||||
autoload :Rescuable, 'active_support/rescuable'
|
autoload :Rescuable, 'active_support/rescuable'
|
||||||
autoload :SecureRandom, 'active_support/secure_random'
|
autoload :SecureRandom, 'active_support/secure_random'
|
||||||
autoload :StringInquirer, 'active_support/string_inquirer'
|
autoload :StringInquirer, 'active_support/string_inquirer'
|
||||||
autoload :TimeWithZone, 'active_support/time_with_zone'
|
|
||||||
autoload :TimeZone, 'active_support/values/time_zone'
|
|
||||||
autoload :XmlMini, 'active_support/xml_mini'
|
autoload :XmlMini, 'active_support/xml_mini'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require 'active_support/core/all'
|
||||||
|
|
||||||
require 'active_support/vendor'
|
require 'active_support/vendor'
|
||||||
require 'active_support/core_ext'
|
require 'active_support/core_ext'
|
||||||
require 'active_support/dependencies'
|
require 'active_support/dependencies'
|
||||||
|
|
7
activesupport/lib/active_support/core.rb
Normal file
7
activesupport/lib/active_support/core.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
module ActiveSupport
|
||||||
|
module Core
|
||||||
|
def self.load_all!
|
||||||
|
[TimeWithZone]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
4
activesupport/lib/active_support/core/all.rb
Normal file
4
activesupport/lib/active_support/core/all.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
require 'active_support/core'
|
||||||
|
Dir["#{File.dirname(__FILE__)}/core/*.rb"].sort.each do |path|
|
||||||
|
require "active_support/core/#{File.basename(path, '.rb')}"
|
||||||
|
end
|
4
activesupport/lib/active_support/core/time.rb
Normal file
4
activesupport/lib/active_support/core/time.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
require 'active_support/core/time/autoload'
|
||||||
|
require 'active_support/core_ext/time'
|
||||||
|
require 'active_support/core_ext/date'
|
||||||
|
require 'active_support/core_ext/datetime'
|
4
activesupport/lib/active_support/core/time/autoload.rb
Normal file
4
activesupport/lib/active_support/core/time/autoload.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
module ActiveSupport
|
||||||
|
autoload :TimeWithZone, 'active_support/time_with_zone'
|
||||||
|
autoload :TimeZone, 'active_support/values/time_zone'
|
||||||
|
end
|
|
@ -1,13 +1,6 @@
|
||||||
require 'active_support/core_ext/time/publicize_conversion_methods'
|
require 'active_support/core_ext/time'
|
||||||
require 'active_support/core_ext/time/acts_like'
|
require 'active_support/core_ext/date'
|
||||||
require 'active_support/core_ext/time/calculations'
|
require 'active_support/core_ext/date_time'
|
||||||
require 'active_support/core_ext/time/zones'
|
|
||||||
|
|
||||||
require 'active_support/core_ext/date/acts_like'
|
|
||||||
|
|
||||||
require 'active_support/core_ext/date_time/acts_like'
|
|
||||||
require 'active_support/core_ext/date_time/calculations'
|
|
||||||
require 'active_support/core_ext/date_time/zones'
|
|
||||||
|
|
||||||
# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
|
# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue