ruby2ruby 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/lib/ruby2ruby.rb +12 -4
- data/test/test_ruby2ruby.rb +1 -1
- metadata +3 -3
data/History.txt
CHANGED
data/lib/ruby2ruby.rb
CHANGED
@@ -5,7 +5,7 @@ require 'sexp_processor'
|
|
5
5
|
require 'unified_ruby'
|
6
6
|
|
7
7
|
class Ruby2Ruby < SexpProcessor
|
8
|
-
VERSION = '1.2.
|
8
|
+
VERSION = '1.2.1'
|
9
9
|
LINE_LENGTH = 78
|
10
10
|
|
11
11
|
##
|
@@ -28,7 +28,15 @@ class Ruby2Ruby < SexpProcessor
|
|
28
28
|
def self.translate(klass_or_str, method = nil)
|
29
29
|
require 'parse_tree'
|
30
30
|
sexp = ParseTree.translate(klass_or_str, method)
|
31
|
-
|
31
|
+
|
32
|
+
unifier = Unifier.new
|
33
|
+
|
34
|
+
unifier.processors.each do |p|
|
35
|
+
p.unsupported.delete :cfunc # HACK
|
36
|
+
end
|
37
|
+
|
38
|
+
sexp = unifier.process(sexp)
|
39
|
+
|
32
40
|
self.new.process(sexp)
|
33
41
|
end
|
34
42
|
|
@@ -912,8 +920,8 @@ class Ruby2Ruby < SexpProcessor
|
|
912
920
|
|
913
921
|
body = []
|
914
922
|
begin
|
915
|
-
code = process(exp.shift)
|
916
|
-
body << code unless code.nil? or code.empty?
|
923
|
+
code = process(exp.shift)
|
924
|
+
body << code.chomp unless code.nil? or code.chomp.empty?
|
917
925
|
end until exp.empty?
|
918
926
|
|
919
927
|
unless body.empty? then
|
data/test/test_ruby2ruby.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-04 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
requirements: []
|
76
76
|
|
77
77
|
rubyforge_project: seattlerb
|
78
|
-
rubygems_version: 1.3.
|
78
|
+
rubygems_version: 1.3.1
|
79
79
|
signing_key:
|
80
80
|
specification_version: 2
|
81
81
|
summary: ruby2ruby provides a means of generating pure ruby code easily from ParseTree's Sexps
|