Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1549 from leocassarani/convert_to_name

Clean up changes introduced in 9e0c903 by removing duplication
  • Loading branch information...
commit 07ae26afda2b2459d1bb1ffc0f2726b7a3dd2566 2 parents 25fbde1 + 3475130
Dirkjan Bussink authored February 07, 2012
5  kernel/bootstrap/rubinius.rb
... ...
@@ -1,11 +1,6 @@
1 1
 # -*- encoding: us-ascii -*-
2 2
 
3 3
 module Rubinius
4  
-  # Ruby 1.8 returns strings for method and constant names
5  
-  def self.convert_to_names(list)
6  
-    list.map! { |x| x.to_s }
7  
-  end
8  
-
9 4
   def self.watch_signal(sig, ignored)
10 5
     Rubinius.primitive :vm_watch_signal
11 6
     watch_signal(sig.to_signal, ignored)
4  kernel/bootstrap/rubinius18.rb
@@ -6,6 +6,10 @@ def self.convert_to_names(list)
6 6
     list.map { |x| x.to_s }
7 7
   end
8 8
 
  9
+  def self.convert_to_name(sym)
  10
+    sym.to_s
  11
+  end
  12
+
9 13
   def self.binary_string(string)
10 14
     string
11 15
   end
4  kernel/bootstrap/rubinius19.rb
@@ -5,6 +5,10 @@ def self.convert_to_names(list)
5 5
     list
6 6
   end
7 7
 
  8
+  def self.convert_to_name(sym)
  9
+    sym
  10
+  end
  11
+
8 12
   def self.binary_string(string)
9 13
     string.force_encoding(Encoding::BINARY)
10 14
   end
10  kernel/common/exception.rb
@@ -12,6 +12,16 @@ def initialize(message = nil)
12 12
     @custom_backtrace = nil
13 13
   end
14 14
 
  15
+  # This is here rather than in yaml.rb because it contains "private"
  16
+  # information, ie, the list of ivars. Putting it over in the yaml
  17
+  # source means it's easy to forget about.
  18
+  def to_yaml_properties
  19
+    list = super
  20
+    list.delete Rubinius.convert_to_name(:@backtrace)
  21
+    list.delete Rubinius.convert_to_name(:@custom_backtrace)
  22
+    return list
  23
+  end
  24
+
15 25
   def message
16 26
     @reason_message
17 27
   end
10  kernel/common/exception18.rb
@@ -6,14 +6,4 @@ class Exception
6 6
   def to_s
7 7
     @reason_message || self.class.to_s
8 8
   end
9  
-
10  
-  # This is here rather than in yaml.rb because it contains "private"
11  
-  # information, ie, the list of ivars. Putting it over in the yaml
12  
-  # source means it's easy to forget about.
13  
-  def to_yaml_properties
14  
-    list = super
15  
-    list.delete "@backtrace"
16  
-    list.delete "@custom_backtrace"
17  
-    return list
18  
-  end
19 9
 end
10  kernel/common/exception19.rb
@@ -14,14 +14,4 @@ def to_s
14 14
       self.class.to_s
15 15
     end
16 16
   end
17  
-
18  
-  # This is here rather than in yaml.rb because it contains "private"
19  
-  # information, ie, the list of ivars. Putting it over in the yaml
20  
-  # source means it's easy to forget about.
21  
-  def to_yaml_properties
22  
-    list = super
23  
-    list.delete :@backtrace
24  
-    list.delete :@custom_backtrace
25  
-    return list
26  
-  end
27 17
 end

0 notes on commit 07ae26a

Please sign in to comment.
Something went wrong with that request. Please try again.