Permalink
Browse files

Merge pull request #1549 from leocassarani/convert_to_name

Clean up changes introduced in 9e0c903 by removing duplication
  • Loading branch information...
2 parents 25fbde1 + 3475130 commit 07ae26afda2b2459d1bb1ffc0f2726b7a3dd2566 @dbussink dbussink committed Feb 7, 2012
@@ -1,11 +1,6 @@
# -*- encoding: us-ascii -*-
module Rubinius
- # Ruby 1.8 returns strings for method and constant names
- def self.convert_to_names(list)
- list.map! { |x| x.to_s }
- end
-
def self.watch_signal(sig, ignored)
Rubinius.primitive :vm_watch_signal
watch_signal(sig.to_signal, ignored)
@@ -6,6 +6,10 @@ def self.convert_to_names(list)
list.map { |x| x.to_s }
end
+ def self.convert_to_name(sym)
+ sym.to_s
+ end
+
def self.binary_string(string)
string
end
@@ -5,6 +5,10 @@ def self.convert_to_names(list)
list
end
+ def self.convert_to_name(sym)
+ sym
+ end
+
def self.binary_string(string)
string.force_encoding(Encoding::BINARY)
end
@@ -12,6 +12,16 @@ def initialize(message = nil)
@custom_backtrace = nil
end
+ # This is here rather than in yaml.rb because it contains "private"
+ # information, ie, the list of ivars. Putting it over in the yaml
+ # source means it's easy to forget about.
+ def to_yaml_properties
+ list = super
+ list.delete Rubinius.convert_to_name(:@backtrace)
+ list.delete Rubinius.convert_to_name(:@custom_backtrace)
+ return list
+ end
+
def message
@reason_message
end
@@ -6,14 +6,4 @@ class Exception
def to_s
@reason_message || self.class.to_s
end
-
- # This is here rather than in yaml.rb because it contains "private"
- # information, ie, the list of ivars. Putting it over in the yaml
- # source means it's easy to forget about.
- def to_yaml_properties
- list = super
- list.delete "@backtrace"
- list.delete "@custom_backtrace"
- return list
- end
end
@@ -14,14 +14,4 @@ def to_s
self.class.to_s
end
end
-
- # This is here rather than in yaml.rb because it contains "private"
- # information, ie, the list of ivars. Putting it over in the yaml
- # source means it's easy to forget about.
- def to_yaml_properties
- list = super
- list.delete :@backtrace
- list.delete :@custom_backtrace
- return list
- end
end

0 comments on commit 07ae26a

Please sign in to comment.