summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2020-11-05 20:54:34 +0900
committerNARUSE, Yui <naruse@airemix.jp>2020-11-05 20:54:34 +0900
commit3407b7d8a620562d0584cd2968965317f331f8cc (patch)
treec1aa1764e2f28f30280030aa511a4ff5665d382c
parentb29fe5eb2ded0363c631b2739676e631ed024d66 (diff)
Revert "Prefer #send over #__send__ when it is clear there is no possible conflict"
This reverts commit 4dba0c1a8e3cc08664872e637099c4e7d58d24d3. Matz's comment is "send is not deprecated. __send__ is safer". But "Prefer #send over #__send__" is not reasonable.
-rw-r--r--lib/forwardable.rb2
-rw-r--r--lib/irb/cmd/fork.rb2
-rw-r--r--lib/irb/completion.rb2
-rw-r--r--lib/irb/easter-egg.rb2
-rw-r--r--lib/un.rb8
5 files changed, 8 insertions, 8 deletions
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index 95596ba18d..c720feb4a4 100644
--- a/lib/forwardable.rb
+++ b/lib/forwardable.rb
@@ -189,7 +189,7 @@ module Forwardable
# If it's not a class or module, it's an instance
mod = Module === self ? self : singleton_class
ret = mod.module_eval(&gen)
- mod.send(:ruby2_keywords, ali) if RUBY_VERSION >= '2.7'
+ mod.__send__(:ruby2_keywords, ali) if RUBY_VERSION >= '2.7'
ret
end
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb
index 19c78fc910..7566d10be0 100644
--- a/lib/irb/cmd/fork.rb
+++ b/lib/irb/cmd/fork.rb
@@ -16,7 +16,7 @@ module IRB
module ExtendCommand
class Fork < Nop
def execute
- pid = send ExtendCommand.irb_original_method_name("fork")
+ pid = __send__ ExtendCommand.irb_original_method_name("fork")
unless pid
class << self
alias_method :exit, ExtendCommand.irb_original_method_name('exit')
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index c9328e5c5a..6d82139aeb 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -268,7 +268,7 @@ module IRB
PerfectMatchedProc = ->(matched, bind: IRB.conf[:MAIN_CONTEXT].workspace.binding) {
RDocRIDriver ||= RDoc::RI::Driver.new
if matched =~ /\A(?:::)?RubyVM/ and not ENV['RUBY_YES_I_AM_NOT_A_NORMAL_USER']
- IRB.send(:easter_egg)
+ IRB.__send__(:easter_egg)
return
end
namespace = retrieve_completion_data(matched, bind: bind, doc_namespace: true)
diff --git a/lib/irb/easter-egg.rb b/lib/irb/easter-egg.rb
index be7f47197e..3e79692de9 100644
--- a/lib/irb/easter-egg.rb
+++ b/lib/irb/easter-egg.rb
@@ -135,4 +135,4 @@ module IRB
end
end
-IRB.send(:easter_egg, ARGV[0]&.to_sym) if $0 == __FILE__
+IRB.__send__(:easter_egg, ARGV[0]&.to_sym) if $0 == __FILE__
diff --git a/lib/un.rb b/lib/un.rb
index 628260a7fa..a759328ec4 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -88,7 +88,7 @@ def cp
options[:preserve] = true if options.delete :p
dest = argv.pop
argv = argv[0] if argv.size == 1
- FileUtils.send cmd, argv, dest, **options
+ FileUtils.__send__ cmd, argv, dest, **options
end
end
@@ -109,7 +109,7 @@ def ln
options[:force] = true if options.delete :f
dest = argv.pop
argv = argv[0] if argv.size == 1
- FileUtils.send cmd, argv, dest, **options
+ FileUtils.__send__ cmd, argv, dest, **options
end
end
@@ -144,7 +144,7 @@ def rm
cmd = "rm"
cmd += "_r" if options.delete :r
options[:force] = true if options.delete :f
- FileUtils.send cmd, argv, **options
+ FileUtils.__send__ cmd, argv, **options
end
end
@@ -161,7 +161,7 @@ def mkdir
setup("p") do |argv, options|
cmd = "mkdir"
cmd += "_p" if options.delete :p
- FileUtils.send cmd, argv, **options
+ FileUtils.__send__ cmd, argv, **options
end
end