Skip to content

Commit

Permalink
Switch alias to alias_method
Browse files Browse the repository at this point in the history
  • Loading branch information
TwP committed Jan 24, 2015
1 parent cb3f471 commit 5ec2d87
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/logging/appenders/string_io.rb
Expand Up @@ -57,7 +57,7 @@ def clear
@sio.truncate 0
}
end
alias :reset :clear
alias_method :reset, :clear

%w[read readline readlines].each do|m|
class_eval <<-CODE, __FILE__, __LINE__+1
Expand Down
4 changes: 2 additions & 2 deletions lib/logging/diagnostic_context.rb
Expand Up @@ -289,7 +289,7 @@ def push( message )
end
self
end
alias :<< :push
alias_method :<<, :push

# Public: Clients should call this method before leaving a diagnostic
# context. The returned value is the last pushed message. If no
Expand Down Expand Up @@ -405,7 +405,7 @@ class << self

%w[new start fork].each do |m|
class_eval <<-__, __FILE__, __LINE__
alias :_orig_#{m} :#{m}
alias_method :_orig_#{m}, :#{m}
private :_orig_#{m}
def #{m}( *a, &b )
create_with_logging_context(:_orig_#{m}, *a ,&b)
Expand Down
4 changes: 2 additions & 2 deletions lib/logging/logger.rb
Expand Up @@ -58,7 +58,7 @@ def new( *args )
logger
end
end
alias :[] :new
alias_method :[], :new

# This is where the actual logging methods are defined. Two methods
# are created for each log level. The first is a query method used to
Expand Down Expand Up @@ -170,7 +170,7 @@ def <<( msg )
@appenders.each {|a| a << msg}
@parent << msg if @additive
end
alias :write :<<
alias_method :write, :<<

# call-seq:
# add( severity, message = nil ) {block}
Expand Down
2 changes: 1 addition & 1 deletion lib/logging/utils.rb
Expand Up @@ -150,7 +150,7 @@ def initialize
@locker = nil
end

alias :original_synchronize :synchronize
alias_method :original_synchronize, :synchronize

def synchronize
if @locker == Thread.current
Expand Down

0 comments on commit 5ec2d87

Please sign in to comment.