mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use frozen-string-literal in ActiveSupport
This commit is contained in:
parent
6f2b0eb44a
commit
72950568dd
429 changed files with 434 additions and 0 deletions
|
@ -77,6 +77,12 @@ Layout/SpaceBeforeFirstArg:
|
||||||
Style/MethodDefParentheses:
|
Style/MethodDefParentheses:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: true
|
||||||
|
EnforcedStyle: always
|
||||||
|
Include:
|
||||||
|
- 'activesupport/**/*'
|
||||||
|
|
||||||
# Use `foo {}` not `foo{}`.
|
# Use `foo {}` not `foo{}`.
|
||||||
Layout/SpaceBeforeBlockBraces:
|
Layout/SpaceBeforeBlockBraces:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "rake/testtask"
|
require "rake/testtask"
|
||||||
|
|
||||||
task default: :test
|
task default: :test
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip
|
version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
begin
|
begin
|
||||||
$:.unshift(File.expand_path("../lib", __dir__))
|
$:.unshift(File.expand_path("../lib", __dir__))
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
COMPONENT_ROOT = File.expand_path("..", __dir__)
|
COMPONENT_ROOT = File.expand_path("..", __dir__)
|
||||||
require_relative "../../tools/test"
|
require_relative "../../tools/test"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
#--
|
#--
|
||||||
# Copyright (c) 2005-2017 David Heinemeier Hansson
|
# Copyright (c) 2005-2017 David Heinemeier Hansson
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "active_support"
|
require "active_support"
|
||||||
require_relative "time"
|
require_relative "time"
|
||||||
require_relative "core_ext"
|
require_relative "core_ext"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
# Wrapping an array in an +ArrayInquirer+ gives a friendlier way to check
|
# Wrapping an array in an +ArrayInquirer+ gives a friendlier way to check
|
||||||
# its string-like contents:
|
# its string-like contents:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
# Backtraces often include many lines that are not relevant for the context
|
# Backtraces often include many lines that are not relevant for the context
|
||||||
# under review. This makes it hard to find the signal amongst the backtrace
|
# under review. This makes it hard to find the signal amongst the backtrace
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "core_ext/benchmark"
|
require_relative "core_ext/benchmark"
|
||||||
require_relative "core_ext/hash/keys"
|
require_relative "core_ext/hash/keys"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
begin
|
begin
|
||||||
require "builder"
|
require "builder"
|
||||||
rescue LoadError => e
|
rescue LoadError => e
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "zlib"
|
require "zlib"
|
||||||
require_relative "core_ext/array/extract_options"
|
require_relative "core_ext/array/extract_options"
|
||||||
require_relative "core_ext/array/wrap"
|
require_relative "core_ext/array/wrap"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../core_ext/marshal"
|
require_relative "../core_ext/marshal"
|
||||||
require_relative "../core_ext/file/atomic"
|
require_relative "../core_ext/file/atomic"
|
||||||
require_relative "../core_ext/string/conversions"
|
require_relative "../core_ext/string/conversions"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
begin
|
begin
|
||||||
require "dalli"
|
require "dalli"
|
||||||
rescue LoadError => e
|
rescue LoadError => e
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "monitor"
|
require "monitor"
|
||||||
|
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
module Cache
|
module Cache
|
||||||
# A cache store implementation which doesn't actually store anything. Useful in
|
# A cache store implementation which doesn't actually store anything. Useful in
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../core_ext/object/duplicable"
|
require_relative "../../core_ext/object/duplicable"
|
||||||
require_relative "../../core_ext/string/inflections"
|
require_relative "../../core_ext/string/inflections"
|
||||||
require_relative "../../per_thread_registry"
|
require_relative "../../per_thread_registry"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "rack/body_proxy"
|
require "rack/body_proxy"
|
||||||
require "rack/utils"
|
require "rack/utils"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "concern"
|
require_relative "concern"
|
||||||
require_relative "descendants_tracker"
|
require_relative "descendants_tracker"
|
||||||
require_relative "core_ext/array/extract_options"
|
require_relative "core_ext/array/extract_options"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
# A typical module looks like this:
|
# A typical module looks like this:
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "thread"
|
require "thread"
|
||||||
require "monitor"
|
require "monitor"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "concern"
|
require_relative "concern"
|
||||||
require_relative "ordered_options"
|
require_relative "ordered_options"
|
||||||
require_relative "core_ext/array/extract_options"
|
require_relative "core_ext/array/extract_options"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
Dir.glob(File.expand_path("core_ext/*.rb", __dir__)).each do |path|
|
Dir.glob(File.expand_path("core_ext/*.rb", __dir__)).each do |path|
|
||||||
require path
|
require path
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "array/wrap"
|
require_relative "array/wrap"
|
||||||
require_relative "array/access"
|
require_relative "array/access"
|
||||||
require_relative "array/conversions"
|
require_relative "array/conversions"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Array
|
class Array
|
||||||
# Returns the tail of the array from +position+.
|
# Returns the tail of the array from +position+.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../xml_mini"
|
require_relative "../../xml_mini"
|
||||||
require_relative "../hash/keys"
|
require_relative "../hash/keys"
|
||||||
require_relative "../string/inflections"
|
require_relative "../string/inflections"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
# By default, only instances of Hash itself are extractable.
|
# By default, only instances of Hash itself are extractable.
|
||||||
# Subclasses of Hash may implement this method and return
|
# Subclasses of Hash may implement this method and return
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Array
|
class Array
|
||||||
# Splits or iterates over the array in groups of size +number+,
|
# Splits or iterates over the array in groups of size +number+,
|
||||||
# padding any remaining slots with +fill_with+ unless it is +false+.
|
# padding any remaining slots with +fill_with+ unless it is +false+.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../array_inquirer"
|
require_relative "../../array_inquirer"
|
||||||
|
|
||||||
class Array
|
class Array
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Array
|
class Array
|
||||||
# The human way of thinking about adding stuff to the end of a list is with append.
|
# The human way of thinking about adding stuff to the end of a list is with append.
|
||||||
alias_method :append, :push unless [].respond_to?(:append)
|
alias_method :append, :push unless [].respond_to?(:append)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Array
|
class Array
|
||||||
# Wraps its argument in an array unless it is already an array (or array-like).
|
# Wraps its argument in an array unless it is already an array (or array-like).
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "benchmark"
|
require "benchmark"
|
||||||
|
|
||||||
class << Benchmark
|
class << Benchmark
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "big_decimal/conversions"
|
require_relative "big_decimal/conversions"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "bigdecimal"
|
require "bigdecimal"
|
||||||
require "bigdecimal/util"
|
require "bigdecimal/util"
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "class/attribute"
|
require_relative "class/attribute"
|
||||||
require_relative "class/subclasses"
|
require_relative "class/subclasses"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../kernel/singleton_class"
|
require_relative "../kernel/singleton_class"
|
||||||
require_relative "../module/remove_method"
|
require_relative "../module/remove_method"
|
||||||
require_relative "../array/extract_options"
|
require_relative "../array/extract_options"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
# cattr_* became mattr_* aliases in 7dfbd91b0780fbd6a1dd9bfbc176e10894871d2d,
|
# cattr_* became mattr_* aliases in 7dfbd91b0780fbd6a1dd9bfbc176e10894871d2d,
|
||||||
# but we keep this around for libraries that directly require it knowing they
|
# but we keep this around for libraries that directly require it knowing they
|
||||||
# want cattr_*. No need to deprecate.
|
# want cattr_*. No need to deprecate.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../module/anonymous"
|
require_relative "../module/anonymous"
|
||||||
require_relative "../module/reachable"
|
require_relative "../module/reachable"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "date/acts_like"
|
require_relative "date/acts_like"
|
||||||
require_relative "date/blank"
|
require_relative "date/blank"
|
||||||
require_relative "date/calculations"
|
require_relative "date/calculations"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../object/acts_like"
|
require_relative "../object/acts_like"
|
||||||
|
|
||||||
class Date
|
class Date
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
|
|
||||||
class Date #:nodoc:
|
class Date #:nodoc:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
require_relative "../../duration"
|
require_relative "../../duration"
|
||||||
require_relative "../object/acts_like"
|
require_relative "../object/acts_like"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
require_relative "../../inflector/methods"
|
require_relative "../../inflector/methods"
|
||||||
require_relative "zones"
|
require_relative "zones"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
require_relative "../date_and_time/zones"
|
require_relative "../date_and_time/zones"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../object/try"
|
require_relative "../object/try"
|
||||||
|
|
||||||
module DateAndTime
|
module DateAndTime
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../module/attribute_accessors"
|
require_relative "../module/attribute_accessors"
|
||||||
|
|
||||||
module DateAndTime
|
module DateAndTime
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module DateAndTime
|
module DateAndTime
|
||||||
module Zones
|
module Zones
|
||||||
# Returns the simultaneous time in <tt>Time.zone</tt> if a zone is given or
|
# Returns the simultaneous time in <tt>Time.zone</tt> if a zone is given or
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "date_time/acts_like"
|
require_relative "date_time/acts_like"
|
||||||
require_relative "date_time/blank"
|
require_relative "date_time/blank"
|
||||||
require_relative "date_time/calculations"
|
require_relative "date_time/calculations"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
require_relative "../object/acts_like"
|
require_relative "../object/acts_like"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
|
|
||||||
class DateTime #:nodoc:
|
class DateTime #:nodoc:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
|
|
||||||
class DateTime
|
class DateTime
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../date_and_time/compatibility"
|
require_relative "../date_and_time/compatibility"
|
||||||
require_relative "../module/remove_method"
|
require_relative "../module/remove_method"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "date"
|
require "date"
|
||||||
require_relative "../../inflector/methods"
|
require_relative "../../inflector/methods"
|
||||||
require_relative "../time/conversions"
|
require_relative "../time/conversions"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "securerandom"
|
require "securerandom"
|
||||||
|
|
||||||
module Digest
|
module Digest
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module Enumerable
|
module Enumerable
|
||||||
# Enumerable#sum was added in Ruby 2.4, but it only works with Numeric elements
|
# Enumerable#sum was added in Ruby 2.4, but it only works with Numeric elements
|
||||||
# when we omit an identity.
|
# when we omit an identity.
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "file/atomic"
|
require_relative "file/atomic"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
|
|
||||||
class File
|
class File
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "hash/compact"
|
require_relative "hash/compact"
|
||||||
require_relative "hash/conversions"
|
require_relative "hash/conversions"
|
||||||
require_relative "hash/deep_merge"
|
require_relative "hash/deep_merge"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
unless Hash.instance_methods(false).include?(:compact)
|
unless Hash.instance_methods(false).include?(:compact)
|
||||||
# Returns a hash with non +nil+ values.
|
# Returns a hash with non +nil+ values.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../xml_mini"
|
require_relative "../../xml_mini"
|
||||||
require_relative "../../time"
|
require_relative "../../time"
|
||||||
require_relative "../object/blank"
|
require_relative "../object/blank"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
# Returns a new hash with +self+ and +other_hash+ merged recursively.
|
# Returns a new hash with +self+ and +other_hash+ merged recursively.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
# Returns a hash that includes everything except given keys.
|
# Returns a hash that includes everything except given keys.
|
||||||
# hash = { a: true, b: false, c: nil }
|
# hash = { a: true, b: false, c: nil }
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../hash_with_indifferent_access"
|
require_relative "../../hash_with_indifferent_access"
|
||||||
|
|
||||||
class Hash
|
class Hash
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
# Returns a new hash with all keys converted using the +block+ operation.
|
# Returns a new hash with all keys converted using the +block+ operation.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
# Merges the caller into +other_hash+. For example,
|
# Merges the caller into +other_hash+. For example,
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
# Slices a hash to include only the given keys. Returns a hash containing
|
# Slices a hash to include only the given keys. Returns a hash containing
|
||||||
# the given keys.
|
# the given keys.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Hash
|
class Hash
|
||||||
# Returns a new hash with the results of running +block+ once for every value.
|
# Returns a new hash with the results of running +block+ once for every value.
|
||||||
# The keys are unchanged.
|
# The keys are unchanged.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "integer/multiple"
|
require_relative "integer/multiple"
|
||||||
require_relative "integer/inflections"
|
require_relative "integer/inflections"
|
||||||
require_relative "integer/time"
|
require_relative "integer/time"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../inflector"
|
require_relative "../../inflector"
|
||||||
|
|
||||||
class Integer
|
class Integer
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Integer
|
class Integer
|
||||||
# Check whether the integer is evenly divisible by the argument.
|
# Check whether the integer is evenly divisible by the argument.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../duration"
|
require_relative "../../duration"
|
||||||
require_relative "../numeric/time"
|
require_relative "../numeric/time"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "kernel/agnostics"
|
require_relative "kernel/agnostics"
|
||||||
require_relative "kernel/concern"
|
require_relative "kernel/concern"
|
||||||
require_relative "kernel/reporting"
|
require_relative "kernel/reporting"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Object
|
class Object
|
||||||
# Makes backticks behave (somewhat more) similarly on all platforms.
|
# Makes backticks behave (somewhat more) similarly on all platforms.
|
||||||
# On win32 `nonexistent_command` raises Errno::ENOENT; on Unix, the
|
# On win32 `nonexistent_command` raises Errno::ENOENT; on Unix, the
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../module/concerning"
|
require_relative "../module/concerning"
|
||||||
|
|
||||||
module Kernel
|
module Kernel
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module Kernel
|
module Kernel
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module Kernel
|
module Kernel
|
||||||
# class_eval on an object acts like singleton_class.class_eval.
|
# class_eval on an object acts like singleton_class.class_eval.
|
||||||
def class_eval(*args, &block)
|
def class_eval(*args, &block)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class LoadError
|
class LoadError
|
||||||
REGEXPS = [
|
REGEXPS = [
|
||||||
/^no such file to load -- (.+)$/i,
|
/^no such file to load -- (.+)$/i,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
module MarshalWithAutoloading # :nodoc:
|
module MarshalWithAutoloading # :nodoc:
|
||||||
def load(source, proc = nil)
|
def load(source, proc = nil)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "module/aliasing"
|
require_relative "module/aliasing"
|
||||||
require_relative "module/introspection"
|
require_relative "module/introspection"
|
||||||
require_relative "module/anonymous"
|
require_relative "module/anonymous"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Module
|
class Module
|
||||||
# Allows you to make aliases for attributes, which includes
|
# Allows you to make aliases for attributes, which includes
|
||||||
# getter, setter, and a predicate.
|
# getter, setter, and a predicate.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Module
|
class Module
|
||||||
# A module may or may not have a name.
|
# A module may or may not have a name.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Module
|
class Module
|
||||||
# Declares an attribute reader backed by an internally-named instance variable.
|
# Declares an attribute reader backed by an internally-named instance variable.
|
||||||
def attr_internal_reader(*attrs)
|
def attr_internal_reader(*attrs)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../array/extract_options"
|
require_relative "../array/extract_options"
|
||||||
require_relative "../regexp"
|
require_relative "../regexp"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../array/extract_options"
|
require_relative "../array/extract_options"
|
||||||
require_relative "../regexp"
|
require_relative "../regexp"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../concern"
|
require_relative "../../concern"
|
||||||
|
|
||||||
class Module
|
class Module
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require "set"
|
require "set"
|
||||||
require_relative "../regexp"
|
require_relative "../regexp"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Module
|
class Module
|
||||||
# deprecate :foo
|
# deprecate :foo
|
||||||
# deprecate bar: 'message'
|
# deprecate bar: 'message'
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../inflector"
|
require_relative "../../inflector"
|
||||||
|
|
||||||
class Module
|
class Module
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "anonymous"
|
require_relative "anonymous"
|
||||||
require_relative "../string/inflections"
|
require_relative "../string/inflections"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Module
|
class Module
|
||||||
# Removes the named method, if it exists.
|
# Removes the named method, if it exists.
|
||||||
def remove_possible_method(method)
|
def remove_possible_method(method)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class NameError
|
class NameError
|
||||||
# Extract the name of the missing constant from the exception message.
|
# Extract the name of the missing constant from the exception message.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "numeric/bytes"
|
require_relative "numeric/bytes"
|
||||||
require_relative "numeric/time"
|
require_relative "numeric/time"
|
||||||
require_relative "numeric/inquiry"
|
require_relative "numeric/inquiry"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Numeric
|
class Numeric
|
||||||
KILOBYTE = 1024
|
KILOBYTE = 1024
|
||||||
MEGABYTE = KILOBYTE * 1024
|
MEGABYTE = KILOBYTE * 1024
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../big_decimal/conversions"
|
require_relative "../big_decimal/conversions"
|
||||||
require_relative "../../number_helper"
|
require_relative "../../number_helper"
|
||||||
require_relative "../module/deprecation"
|
require_relative "../module/deprecation"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
unless 1.respond_to?(:positive?) # TODO: Remove this file when we drop support to ruby < 2.3
|
unless 1.respond_to?(:positive?) # TODO: Remove this file when we drop support to ruby < 2.3
|
||||||
class Numeric
|
class Numeric
|
||||||
# Returns true if the number is positive.
|
# Returns true if the number is positive.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../../duration"
|
require_relative "../../duration"
|
||||||
require_relative "../time/calculations"
|
require_relative "../time/calculations"
|
||||||
require_relative "../time/acts_like"
|
require_relative "../time/acts_like"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "object/acts_like"
|
require_relative "object/acts_like"
|
||||||
require_relative "object/blank"
|
require_relative "object/blank"
|
||||||
require_relative "object/duplicable"
|
require_relative "object/duplicable"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
class Object
|
class Object
|
||||||
# A duck-type assistant method. For example, Active Support extends Date
|
# A duck-type assistant method. For example, Active Support extends Date
|
||||||
# to define an <tt>acts_like_date?</tt> method, and extends Time to define
|
# to define an <tt>acts_like_date?</tt> method, and extends Time to define
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "../regexp"
|
require_relative "../regexp"
|
||||||
|
|
||||||
class Object
|
class Object
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
require_relative "to_param"
|
require_relative "to_param"
|
||||||
require_relative "to_query"
|
require_relative "to_query"
|
||||||
require_relative "../array/conversions"
|
require_relative "../array/conversions"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue