Skip to content

Commit

Permalink
Remove privated methods unused since ruby#487
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jul 1, 2023
1 parent da3b799 commit a602a5e
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lib/psych.rb
Original file line number Diff line number Diff line change
Expand Up @@ -694,21 +694,6 @@ def self.add_tag tag, klass
dump_tags[klass] = tag
end

# Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower.
def self.warn_with_uplevel(message, uplevel: 1)
at = parse_caller(caller[uplevel]).join(':')
warn "#{at}: #{message}"
end

def self.parse_caller(at)
if /^(.+?):(\d+)(?::in `.*')?/ =~ at
file = $1
line = $2.to_i
[file, line]
end
end
private_class_method :warn_with_uplevel, :parse_caller

class << self
if defined?(Ractor)
require 'forwardable'
Expand Down

0 comments on commit a602a5e

Please sign in to comment.