From c9458c74e0933fa9925b700f72dd14000f73766f Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 13 Nov 2016 22:27:52 +0000 Subject: Remove deprecated kernel debugger file --- activesupport/lib/active_support/core_ext/kernel/debugger.rb | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/kernel/debugger.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/kernel/debugger.rb b/activesupport/lib/active_support/core_ext/kernel/debugger.rb deleted file mode 100644 index dccfa3e9bb..0000000000 --- a/activesupport/lib/active_support/core_ext/kernel/debugger.rb +++ /dev/null @@ -1,3 +0,0 @@ -require "active_support/deprecation" - -ActiveSupport::Deprecation.warn("This file is deprecated and will be removed in Rails 5.1 with no replacement.") -- cgit v1.2.3 From c32ccd837ee37272b5b7abee6afec40cb45491ed Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 13 Nov 2016 22:28:18 +0000 Subject: Remove deprecated local_constants --- activesupport/lib/active_support/core_ext/module/introspection.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/module/introspection.rb b/activesupport/lib/active_support/core_ext/module/introspection.rb index 4f854a718b..0665aa88bc 100644 --- a/activesupport/lib/active_support/core_ext/module/introspection.rb +++ b/activesupport/lib/active_support/core_ext/module/introspection.rb @@ -55,12 +55,4 @@ class Module parents << Object unless parents.include? Object parents end - - def local_constants #:nodoc: - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Module#local_constants is deprecated and will be removed in Rails 5.1. - Use Module#constants(false) instead. - MSG - constants(false) - end end -- cgit v1.2.3 From 2ae41d24b9e8ba399293660d4dd900ff66742c97 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 13 Nov 2016 22:29:18 +0000 Subject: Remove deprecated module method_transplanting file --- .../lib/active_support/core_ext/module/method_transplanting.rb | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/module/method_transplanting.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/module/method_transplanting.rb b/activesupport/lib/active_support/core_ext/module/method_transplanting.rb deleted file mode 100644 index dccfa3e9bb..0000000000 --- a/activesupport/lib/active_support/core_ext/module/method_transplanting.rb +++ /dev/null @@ -1,3 +0,0 @@ -require "active_support/deprecation" - -ActiveSupport::Deprecation.warn("This file is deprecated and will be removed in Rails 5.1 with no replacement.") -- cgit v1.2.3 From 73b18eccdfe835694ed39d3b410a786516aa3076 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 13 Nov 2016 22:33:33 +0000 Subject: Remove deprecated struct core_ext file --- activesupport/lib/active_support/core_ext/struct.rb | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/struct.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/struct.rb b/activesupport/lib/active_support/core_ext/struct.rb deleted file mode 100644 index dccfa3e9bb..0000000000 --- a/activesupport/lib/active_support/core_ext/struct.rb +++ /dev/null @@ -1,3 +0,0 @@ -require "active_support/deprecation" - -ActiveSupport::Deprecation.warn("This file is deprecated and will be removed in Rails 5.1 with no replacement.") -- cgit v1.2.3 From 0e8d297301305af9ac5d64e7cd2b0a418c139fce Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 13 Nov 2016 22:34:48 +0000 Subject: Remove deprecated time marshal core_ext file --- activesupport/lib/active_support/core_ext/time/marshal.rb | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/time/marshal.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/time/marshal.rb b/activesupport/lib/active_support/core_ext/time/marshal.rb deleted file mode 100644 index d095d76ebb..0000000000 --- a/activesupport/lib/active_support/core_ext/time/marshal.rb +++ /dev/null @@ -1,3 +0,0 @@ -require "active_support/deprecation" - -ActiveSupport::Deprecation.warn("This is deprecated and will be removed in Rails 5.1 with no replacement.") -- cgit v1.2.3 From b93a2571864eb858abc8b2f02f393f6751affc27 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 14 Nov 2016 08:11:21 +0000 Subject: Remove deprecated Module.qualified_const_get/set/defined? --- .../lib/active_support/core_ext/module.rb | 1 - .../core_ext/module/qualified_const.rb | 70 ---------------------- 2 files changed, 71 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/module/qualified_const.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/module.rb b/activesupport/lib/active_support/core_ext/module.rb index 57feea69a5..2930255557 100644 --- a/activesupport/lib/active_support/core_ext/module.rb +++ b/activesupport/lib/active_support/core_ext/module.rb @@ -9,4 +9,3 @@ require "active_support/core_ext/module/concerning" require "active_support/core_ext/module/delegation" require "active_support/core_ext/module/deprecation" require "active_support/core_ext/module/remove_method" -require "active_support/core_ext/module/qualified_const" diff --git a/activesupport/lib/active_support/core_ext/module/qualified_const.rb b/activesupport/lib/active_support/core_ext/module/qualified_const.rb deleted file mode 100644 index b9814e1dbe..0000000000 --- a/activesupport/lib/active_support/core_ext/module/qualified_const.rb +++ /dev/null @@ -1,70 +0,0 @@ -require "active_support/core_ext/string/inflections" - -#-- -# Allows code reuse in the methods below without polluting Module. -#++ - -module ActiveSupport - module QualifiedConstUtils - def self.raise_if_absolute(path) - raise NameError.new("wrong constant name #$&") if path =~ /\A::[^:]+/ - end - - def self.names(path) - path.split("::") - end - end -end - -## -# Extends the API for constants to be able to deal with qualified names. Arguments -# are assumed to be relative to the receiver. -# -#-- -# Qualified names are required to be relative because we are extending existing -# methods that expect constant names, ie, relative paths of length 1. For example, -# Object.const_get('::String') raises NameError and so does qualified_const_get. -#++ -class Module - def qualified_const_defined?(path, search_parents = true) - ActiveSupport::Deprecation.warn(<<-MESSAGE.squish) - Module#qualified_const_defined? is deprecated in favour of the builtin - Module#const_defined? and will be removed in Rails 5.1. - MESSAGE - - ActiveSupport::QualifiedConstUtils.raise_if_absolute(path) - - ActiveSupport::QualifiedConstUtils.names(path).inject(self) do |mod, name| - return unless mod.const_defined?(name, search_parents) - mod.const_get(name) - end - return true - end - - def qualified_const_get(path) - ActiveSupport::Deprecation.warn(<<-MESSAGE.squish) - Module#qualified_const_get is deprecated in favour of the builtin - Module#const_get and will be removed in Rails 5.1. - MESSAGE - - ActiveSupport::QualifiedConstUtils.raise_if_absolute(path) - - ActiveSupport::QualifiedConstUtils.names(path).inject(self) do |mod, name| - mod.const_get(name) - end - end - - def qualified_const_set(path, value) - ActiveSupport::Deprecation.warn(<<-MESSAGE.squish) - Module#qualified_const_set is deprecated in favour of the builtin - Module#const_set and will be removed in Rails 5.1. - MESSAGE - - ActiveSupport::QualifiedConstUtils.raise_if_absolute(path) - - const_name = path.demodulize - mod_name = path.deconstantize - mod = mod_name.empty? ? self : const_get(mod_name) - mod.const_set(const_name, value) - end -end -- cgit v1.2.3 From 8e43fc5ace8039370f233570863b34821a3be46f Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 14 Nov 2016 11:25:52 +0000 Subject: Remove deprecated constant MissingSourceFIle --- activesupport/lib/active_support/core_ext/load_error.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/load_error.rb b/activesupport/lib/active_support/core_ext/load_error.rb index cd00d1b662..3cf7ea0a97 100644 --- a/activesupport/lib/active_support/core_ext/load_error.rb +++ b/activesupport/lib/active_support/core_ext/load_error.rb @@ -27,5 +27,3 @@ class LoadError location.sub(/\.rb$/, "".freeze) == path.sub(/\.rb$/, "".freeze) end end - -MissingSourceFile = ActiveSupport::Deprecation::DeprecatedConstantProxy.new("MissingSourceFile", "LoadError") -- cgit v1.2.3 From 7c848e6dd493ff236d33a0410a92f4c3e5cc3c7f Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 14 Nov 2016 11:57:30 +0000 Subject: Remove deprecated method alias_method_chain --- .../lib/active_support/core_ext/module/aliasing.rb | 48 ---------------------- 1 file changed, 48 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/module/aliasing.rb b/activesupport/lib/active_support/core_ext/module/aliasing.rb index 4a04bdd446..c48bd3354a 100644 --- a/activesupport/lib/active_support/core_ext/module/aliasing.rb +++ b/activesupport/lib/active_support/core_ext/module/aliasing.rb @@ -1,52 +1,4 @@ class Module - # NOTE: This method is deprecated. Please use Module#prepend that - # comes with Ruby 2.0 or newer instead. - # - # Encapsulates the common pattern of: - # - # alias_method :foo_without_feature, :foo - # alias_method :foo, :foo_with_feature - # - # With this, you simply do: - # - # alias_method_chain :foo, :feature - # - # And both aliases are set up for you. - # - # Query and bang methods (foo?, foo!) keep the same punctuation: - # - # alias_method_chain :foo?, :feature - # - # is equivalent to - # - # alias_method :foo_without_feature?, :foo? - # alias_method :foo?, :foo_with_feature? - # - # so you can safely chain foo, foo?, foo! and/or foo= with the same feature. - def alias_method_chain(target, feature) - ActiveSupport::Deprecation.warn("alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super.") - - # Strip out punctuation on predicates, bang or writer methods since - # e.g. target?_without_feature is not a valid method name. - aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ""), $1 - yield(aliased_target, punctuation) if block_given? - - with_method = "#{aliased_target}_with_#{feature}#{punctuation}" - without_method = "#{aliased_target}_without_#{feature}#{punctuation}" - - alias_method without_method, target - alias_method target, with_method - - case - when public_method_defined?(without_method) - public target - when protected_method_defined?(without_method) - protected target - when private_method_defined?(without_method) - private target - end - end - # Allows you to make aliases for attributes, which includes # getter, setter, and a predicate. # -- cgit v1.2.3 From 90520d2eee9093f46757a5e2e589d2237cc960f1 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 14 Nov 2016 12:03:48 +0000 Subject: Remove deprecated method Numeric#to_formatted_s --- activesupport/lib/active_support/core_ext/numeric/conversions.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/numeric/conversions.rb b/activesupport/lib/active_support/core_ext/numeric/conversions.rb index cebfda8d31..946f8ddeab 100644 --- a/activesupport/lib/active_support/core_ext/numeric/conversions.rb +++ b/activesupport/lib/active_support/core_ext/numeric/conversions.rb @@ -126,11 +126,6 @@ module ActiveSupport::NumericWithFormat end end end - - def to_formatted_s(*args) - to_s(*args) - end - deprecate to_formatted_s: :to_s end # Ruby 2.4+ unifies Fixnum & Bignum into Integer. -- cgit v1.2.3 From 0189f4db6fe518de8909b66b7f30046bac52dedc Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 14 Nov 2016 12:14:23 +0000 Subject: Remove deprecated separator argument from parameterize --- activesupport/lib/active_support/core_ext/string/inflections.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/string/inflections.rb b/activesupport/lib/active_support/core_ext/string/inflections.rb index 765c0919bb..4eabce79e2 100644 --- a/activesupport/lib/active_support/core_ext/string/inflections.rb +++ b/activesupport/lib/active_support/core_ext/string/inflections.rb @@ -178,11 +178,7 @@ class String # # <%= link_to(@person.name, person_path) %> # # => Donald E. Knuth - def parameterize(sep = :unused, separator: "-", preserve_case: false) - unless sep == :unused - ActiveSupport::Deprecation.warn("Passing the separator argument as a positional parameter is deprecated and will soon be removed. Use `separator: '#{sep}'` instead.") - separator = sep - end + def parameterize(separator: "-", preserve_case: false) ActiveSupport::Inflector.parameterize(self, separator: separator, preserve_case: preserve_case) end -- cgit v1.2.3