ruby2ruby 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -2
- data/.autotest +3 -0
- data/History.txt +6 -0
- data/Rakefile +0 -2
- data/lib/ruby2ruby.rb +5 -1
- data/test/test_ruby2ruby.rb +13 -1
- metadata +9 -9
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c27b4b75cbb39ce6970c2b8dfdeea6ed2adbe560
|
4
|
+
data.tar.gz: 738c1c7d64391ef4eef6a6845045f25bb6509d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 151e03beb0722a93e4df11ccc0bb19b936350e4246cc1a53f382302b6a07642cc24a9e5a8c8f3fb658c859eea1735d9d702be9cd247908c5966c537aa6cebf0b
|
7
|
+
data.tar.gz: 7a804ef6a6386e82ceb3b137a7b4a85fc959e7cc570b4e70adfefc37d72abc16ee5c4b829dc947416e107dcb48282f0fce17a22f10c398a47e36564b35092c00
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
�
|
1
|
+
��u�Yz���a�WnO����Wš�"o�!��|!�Wb����:�5����ٛ<#UO�ϻړ��rq{;�cʚ��j�?�ya?^�7��mRu��X�1B����r�
|
2
|
+
߄3zm��m� Z��������=���0[��h|�]�:�rpW��2���Фm�rFSib�E����4}!�O��J�+��������c+<�Y�����J�5�ړG�V��r°Y-/�ߺkT>��&5�)q���`�
|
data/.autotest
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
3
|
require 'autotest/restart'
|
4
|
+
require 'autotest/isolate'
|
4
5
|
|
5
6
|
Autotest.add_hook :initialize do |at|
|
6
7
|
at.order = :random
|
8
|
+
|
9
|
+
at.libs << ':../../minitest/dev/lib'
|
7
10
|
at.testlib = "minitest/autorun"
|
8
11
|
|
9
12
|
at.extra_files << "../../sexp_processor/dev/lib/pt_testcase.rb"
|
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/ruby2ruby.rb
CHANGED
@@ -29,7 +29,7 @@ end
|
|
29
29
|
# Generate ruby code from a sexp.
|
30
30
|
|
31
31
|
class Ruby2Ruby < SexpProcessor
|
32
|
-
VERSION = "2.0.
|
32
|
+
VERSION = "2.0.8" # :nodoc:
|
33
33
|
|
34
34
|
# cutoff for one-liners
|
35
35
|
LINE_LENGTH = 78
|
@@ -582,6 +582,10 @@ class Ruby2Ruby < SexpProcessor
|
|
582
582
|
exp.shift.to_s
|
583
583
|
end
|
584
584
|
|
585
|
+
def process_kwsplat(exp)
|
586
|
+
"**#{process exp.shift}"
|
587
|
+
end
|
588
|
+
|
585
589
|
def process_lasgn(exp) # :nodoc:
|
586
590
|
s = "#{exp.shift}"
|
587
591
|
s += " = #{process exp.shift}" unless exp.empty?
|
data/test/test_ruby2ruby.rb
CHANGED
@@ -19,7 +19,7 @@ class R2RTestCase < ParseTreeTestCase
|
|
19
19
|
def self.generate_test klass, node, data, input_name, output_name
|
20
20
|
output_name = data.has_key?('Ruby2Ruby') ? 'Ruby2Ruby' : 'Ruby'
|
21
21
|
|
22
|
-
return if node.to_s =~ /19$/
|
22
|
+
return if node.to_s =~ /(str_question|not|bang).*(19|20|21)$/
|
23
23
|
|
24
24
|
klass.class_eval <<-EOM
|
25
25
|
def test_#{node}
|
@@ -167,6 +167,12 @@ class TestRuby2Ruby < R2RTestCase
|
|
167
167
|
util_compare s(:lit, /blah\/blah/), '/blah\/blah/', /blah\/blah/
|
168
168
|
end
|
169
169
|
|
170
|
+
def test_call_kwsplat
|
171
|
+
inn = s(:call, nil, :test_splat, s(:kwsplat, s(:call, nil, :testing)))
|
172
|
+
out = "test_splat(**testing)"
|
173
|
+
util_compare inn, out
|
174
|
+
end
|
175
|
+
|
170
176
|
def test_call_self_index
|
171
177
|
util_compare s(:call, nil, :[], s(:lit, 42)), "self[42]"
|
172
178
|
end
|
@@ -222,6 +228,12 @@ class TestRuby2Ruby < R2RTestCase
|
|
222
228
|
util_compare inn, out
|
223
229
|
end
|
224
230
|
|
231
|
+
def test_defn_kwsplat
|
232
|
+
inn = s(:defn, :test, s(:args, :"**testing"))
|
233
|
+
out = "def test(**testing)\n # do nothing\nend"
|
234
|
+
util_compare inn, out
|
235
|
+
end
|
236
|
+
|
225
237
|
def test_masgn_block_arg
|
226
238
|
inn = s(:iter,
|
227
239
|
s(:call,
|
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: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
Y4evBVezr3SjXz08vPqRO5YRdO3zfeMT8gBjRqZjWJGMZ2lD4XNfrs7eky74CyZw
|
30
30
|
xx3n58i0lQkBE1EpKE0lFu/y
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: sexp_processor
|
@@ -65,14 +65,14 @@ dependencies:
|
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '5.
|
68
|
+
version: '5.3'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '5.
|
75
|
+
version: '5.3'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: rdoc
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,14 +93,14 @@ dependencies:
|
|
93
93
|
requirements:
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
96
|
+
version: '3.9'
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '3.
|
103
|
+
version: '3.9'
|
104
104
|
description: |-
|
105
105
|
ruby2ruby provides a means of generating pure ruby code easily from
|
106
106
|
RubyParser compatible Sexps. This makes making dynamic language
|
@@ -116,6 +116,7 @@ extra_rdoc_files:
|
|
116
116
|
- README.txt
|
117
117
|
files:
|
118
118
|
- .autotest
|
119
|
+
- .gemtest
|
119
120
|
- History.txt
|
120
121
|
- Manifest.txt
|
121
122
|
- README.txt
|
@@ -123,7 +124,6 @@ files:
|
|
123
124
|
- bin/r2r_show
|
124
125
|
- lib/ruby2ruby.rb
|
125
126
|
- test/test_ruby2ruby.rb
|
126
|
-
- .gemtest
|
127
127
|
homepage: https://github.com/seattlerb/ruby2ruby
|
128
128
|
licenses:
|
129
129
|
- MIT
|
@@ -145,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubyforge_project:
|
149
|
-
rubygems_version: 2.1
|
148
|
+
rubyforge_project: ruby2ruby
|
149
|
+
rubygems_version: 2.2.1
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: ruby2ruby provides a means of generating pure ruby code easily from RubyParser
|
metadata.gz.sig
CHANGED
Binary file
|