aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuji Yaginuma <yuuji.yaginuma@gmail.com>2019-02-01 08:53:04 +0900
committerGitHub <noreply@github.com>2019-02-01 08:53:04 +0900
commitd929b95bc8e222014184e7b34fb53a201c5fd2d5 (patch)
tree6a82063e33e04f9dadb7d02ba83776c579caef41
parenteda0f574f129fcd5ad1fc58b55cb6d1db71ea95c (diff)
parent545b6e5820fa933ff2918913e758c6ccc1a55dfe (diff)
downloadrails-d929b95bc8e222014184e7b34fb53a201c5fd2d5.tar.gz
rails-d929b95bc8e222014184e7b34fb53a201c5fd2d5.tar.bz2
rails-d929b95bc8e222014184e7b34fb53a201c5fd2d5.zip
Merge pull request #31253 from knu/backquote_returns_string
Make the backquote operator always return a string
-rw-r--r--activesupport/CHANGELOG.md4
-rw-r--r--activesupport/lib/active_support/core_ext/kernel.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/kernel/agnostics.rb13
3 files changed, 4 insertions, 14 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 684ecddb18..1e726ceb54 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Remove the `` Kernel#` `` override that suppresses ENOENT and accidentally returns nil on Unix systems
+
+ *Akinori Musha*
+
* Add `ActiveSupport::HashWithIndifferentAccess#assoc`.
`assoc` can now be called with either a string or a symbol.
diff --git a/activesupport/lib/active_support/core_ext/kernel.rb b/activesupport/lib/active_support/core_ext/kernel.rb
index 0f4356fbdd..7708069301 100644
--- a/activesupport/lib/active_support/core_ext/kernel.rb
+++ b/activesupport/lib/active_support/core_ext/kernel.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "active_support/core_ext/kernel/agnostics"
require "active_support/core_ext/kernel/concern"
require "active_support/core_ext/kernel/reporting"
require "active_support/core_ext/kernel/singleton_class"
diff --git a/activesupport/lib/active_support/core_ext/kernel/agnostics.rb b/activesupport/lib/active_support/core_ext/kernel/agnostics.rb
deleted file mode 100644
index 403b5f31f0..0000000000
--- a/activesupport/lib/active_support/core_ext/kernel/agnostics.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class Object
- # Makes backticks behave (somewhat more) similarly on all platforms.
- # On win32 `nonexistent_command` raises Errno::ENOENT; on Unix, the
- # spawned shell prints a message to stderr and sets $?. We emulate
- # Unix on the former but not the latter.
- def `(command) #:nodoc:
- super
- rescue Errno::ENOENT => e
- STDERR.puts "#$0: #{e}"
- end
-end