Skip to content

Commit

Permalink
Merge pull request #25 from mame/no-backtick
Browse files Browse the repository at this point in the history
Use a single quote instead of a backtick as an open quote
  • Loading branch information
hsbt authored Feb 16, 2024
2 parents c62076f + 8ff43dc commit 2938931
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions lib/drb/drb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ def self.prepare_backtrace(uri, result) # :nodoc:
prefix = "(#{uri}) "
bt = []
result.backtrace.each do |x|
break if /`__send__'$/ =~ x
break if /[`']__send__'$/ =~ x
if /\A\(druby:\/\// =~ x
bt.push(x)
else
Expand Down Expand Up @@ -1594,26 +1594,26 @@ def any_to_s(obj)
def check_insecure_method(obj, msg_id)
return true if Proc === obj && msg_id == :__drb_yield
raise(ArgumentError, "#{any_to_s(msg_id)} is not a symbol") unless Symbol == msg_id.class
raise(SecurityError, "insecure method `#{msg_id}'") if insecure_method?(msg_id)
raise(SecurityError, "insecure method '#{msg_id}'") if insecure_method?(msg_id)

case obj
when Object
if obj.private_methods.include?(msg_id)
desc = any_to_s(obj)
raise NoMethodError, "private method `#{msg_id}' called for #{desc}"
raise NoMethodError, "private method '#{msg_id}' called for #{desc}"
elsif obj.protected_methods.include?(msg_id)
desc = any_to_s(obj)
raise NoMethodError, "protected method `#{msg_id}' called for #{desc}"
raise NoMethodError, "protected method '#{msg_id}' called for #{desc}"
else
true
end
else
if Kernel.instance_method(:private_methods).bind(obj).call.include?(msg_id)
desc = any_to_s(obj)
raise NoMethodError, "private method `#{msg_id}' called for #{desc}"
raise NoMethodError, "private method '#{msg_id}' called for #{desc}"
elsif Kernel.instance_method(:protected_methods).bind(obj).call.include?(msg_id)
desc = any_to_s(obj)
raise NoMethodError, "protected method `#{msg_id}' called for #{desc}"
raise NoMethodError, "protected method '#{msg_id}' called for #{desc}"
else
true
end
Expand Down
2 changes: 1 addition & 1 deletion lib/drb/unix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def self.temp_server
break
end
rescue
raise "cannot generate tempfile `%s'" % tmpname if n >= Max_try
raise "cannot generate tempfile '%s'" % tmpname if n >= Max_try
#sleep(1)
end
n += 1
Expand Down
8 changes: 4 additions & 4 deletions test/drb/drbtest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,26 +234,26 @@ def test_07_private_missing
e = assert_raise(NoMethodError) {
@there.method_missing(:eval, 'nil')
}
assert_match(/^private method \`eval\'/, e.message)
assert_match(/^private method [`']eval\'/, e.message)

e = assert_raise(NoMethodError) {
@there.call_private_method
}
assert_match(/^private method \`call_private_method\'/, e.message)
assert_match(/^private method [`']call_private_method\'/, e.message)
end

def test_07_protected_missing
e = assert_raise(NoMethodError) {
@there.call_protected_method
}
assert_match(/^protected method \`call_protected_method\'/, e.message)
assert_match(/^protected method [`']call_protected_method\'/, e.message)
end

def test_07_public_missing
e = assert_raise(NoMethodError) {
@there.method_missing(:undefined_method_test)
}
assert_match(/^undefined method \`undefined_method_test\'/, e.message)
assert_match(/^undefined method [`']undefined_method_test\'/, e.message)
end

def test_07_send_missing
Expand Down

0 comments on commit 2938931

Please sign in to comment.