module ActiveSupport
Active Support – Утилитарные классы и расширения Ruby из Rails
Active Support — это набор утилитарных классов и расширений стандартной библиотеки Ruby, которые оказались полезными для фреймворка Rails. Эти добавления находятся в этом пакете, чтобы их можно было загружать по мере необходимости в проектах Ruby вне Rails.
Подробнее об расширениях можно узнать в руководстве Active Support Core Extensions.
Загрузка и установка
Последнюю версию Active Support можно установить с помощью RubyGems:
$ gem install activesupport
Исходный код можно загрузить как часть проекта Rails на GitHub:
Лицензия
Active Support распространяется под лицензией MIT:
Поддержка
Документация API находится по адресу:
Отчёты об ошибках для проекта Ruby on Rails можно отправить сюда:
Заявки на новые функции следует обсуждать на списке рассылки rails-core здесь:
Публичные методы класса
# File activesupport/lib/active_support.rb, line 106 def self.cache_format_version Cache.format_version end
# File activesupport/lib/active_support.rb, line 110 def self.cache_format_version=(value) Cache.format_version = value end
# File activesupport/lib/active_support.rb, line 94 def self.eager_load! super NumberHelper.eager_load! end
# File activesupport/lib/active_support/gem_version.rb, line 5 def self.gem_version Gem::Version.new VERSION::STRING end
Возвращает текущую загруженную версию Active Support в виде Gem::Version.
# File activesupport/lib/active_support.rb, line 114 def self.to_time_preserves_timezone DateAndTime::Compatibility.preserve_timezone end
# File activesupport/lib/active_support.rb, line 118
def self.to_time_preserves_timezone=(value)
if !value
ActiveSupport.deprecator.warn(
"`to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1. " \
"To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
)
elsif value != :zone
ActiveSupport.deprecator.warn(
"`to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1. " \
"To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
)
end
DateAndTime::Compatibility.preserve_timezone = value
end # File activesupport/lib/active_support.rb, line 134 def self.utc_to_local_returns_utc_offset_times DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times end
# File activesupport/lib/active_support.rb, line 138 def self.utc_to_local_returns_utc_offset_times=(value) DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times = value end
# File activesupport/lib/active_support/version.rb, line 7 def self.version gem_version end
Возвращает текущую загруженную версию Active Support в виде Gem::Version.
© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.