diff --git a/lib/drb/acl.rb b/lib/drb/acl.rb index 8d06b25..72e034e 100644 --- a/lib/drb/acl.rb +++ b/lib/drb/acl.rb @@ -223,7 +223,7 @@ class ACL when 'deny' @deny.add(domain) else - raise "Invalid ACL entry #{list.to_s}" + raise "Invalid ACL entry #{list}" end i += 2 end diff --git a/lib/erb.rb b/lib/erb.rb index b30812f..c372f56 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -548,7 +548,7 @@ class ERB def initialize(compiler, enc=nil) @compiler = compiler @line = [] - @script = enc ? "#coding:#{enc.to_s}\n" : "" + @script = enc ? "#coding:#{enc}\n" : "" @compiler.pre_cmd.each do |x| push(x) end diff --git a/lib/observer.rb b/lib/observer.rb index 99610f7..10f2eb0 100644 --- a/lib/observer.rb +++ b/lib/observer.rb @@ -127,7 +127,7 @@ module Observable def add_observer(observer, func=:update) @observer_peers = {} unless defined? @observer_peers unless observer.respond_to? func - raise NoMethodError, "observer does not respond to `#{func.to_s}'" + raise NoMethodError, "observer does not respond to `#{func}'" end @observer_peers[observer] = func end diff --git a/lib/rake/invocation_chain.rb b/lib/rake/invocation_chain.rb index 6904351..25ad766 100644 --- a/lib/rake/invocation_chain.rb +++ b/lib/rake/invocation_chain.rb @@ -31,7 +31,7 @@ module Rake private def prefix - "#{tail.to_s} => " + "#{tail} => " end # Null object for an empty chain. diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb index fdee064..54636bf 100644 --- a/lib/rubygems/command_manager.rb +++ b/lib/rubygems/command_manager.rb @@ -136,7 +136,7 @@ class Gem::CommandManager def run(args, build_args=nil) process_args(args, build_args) rescue StandardError, Timeout::Error => ex - alert_error "While executing gem ... (#{ex.class})\n #{ex.to_s}" + alert_error "While executing gem ... (#{ex.class})\n #{ex}" ui.backtrace ex terminate_interaction(1) diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index cf14017..1f4afba 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -337,7 +337,7 @@ if you believe they were disclosed to a third party. end return content rescue *YAMLErrors => e - warn "Failed to load #{filename}, #{e.to_s}" + warn "Failed to load #{filename}, #{e}" rescue Errno::EACCES warn "Failed to load #{filename} due to permissions problem." end diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 00051a8..facca4b 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -51,7 +51,7 @@ module URI end else raise ArgumentError, - "expected Array of or Hash of components of #{klass.to_s} (#{klass.component[1..-1].join(', ')})" + "expected Array of or Hash of components of #{klass} (#{klass.component[1..-1].join(', ')})" end tmp[:scheme] = klass.to_s.sub(/\A.*::/, '').downcase