ruby2ruby 2.1.2 → 2.1.3
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 +0 -0
- data/.autotest +0 -2
- data/History.txt +6 -0
- data/README.txt +1 -1
- data/Rakefile +6 -0
- data/lib/ruby2ruby.rb +4 -1
- data/test/test_ruby2ruby.rb +21 -0
- metadata +13 -13
- 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: 74c87f0ca74e11a422495c56f40bac470ab3379f
|
4
|
+
data.tar.gz: 29e705948c7770c3722eab456247992042752495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e9540e531c0456eb52033bba31c56f5d9a5a1e317839e566e1385620205494a8f18499d40e762b65976c5feca0f3f08949d7092cfb6d06d2cc929f8015638e6
|
7
|
+
data.tar.gz: ddb3bd03f2ed3495ec701530f791aca28099cbb07773355477cf1d8b5fa638e33b7c26dde8cf9d2fbde59ef1595e6c608d35c2d58f6b6861760908528fe805d0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.autotest
CHANGED
data/History.txt
CHANGED
data/README.txt
CHANGED
data/Rakefile
CHANGED
@@ -13,6 +13,8 @@ Hoe.plugin :isolate
|
|
13
13
|
Hoe.spec 'ruby2ruby' do
|
14
14
|
developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
|
15
15
|
|
16
|
+
license "MIT"
|
17
|
+
|
16
18
|
dependency "sexp_processor", "~> 4.0"
|
17
19
|
dependency "ruby_parser", "~> 3.1"
|
18
20
|
end
|
@@ -83,4 +85,8 @@ task :debug => :isolate do
|
|
83
85
|
puts process(ruby, file)
|
84
86
|
end
|
85
87
|
|
88
|
+
task :bugs do
|
89
|
+
sh "for f in bug*.rb ; do #{Gem.ruby} -S rake debug F=$f && rm $f ; done"
|
90
|
+
end
|
91
|
+
|
86
92
|
# vim: syntax=ruby
|
data/lib/ruby2ruby.rb
CHANGED
@@ -31,7 +31,7 @@ end
|
|
31
31
|
# Generate ruby code from a sexp.
|
32
32
|
|
33
33
|
class Ruby2Ruby < SexpProcessor
|
34
|
-
VERSION = "2.1.
|
34
|
+
VERSION = "2.1.3" # :nodoc:
|
35
35
|
|
36
36
|
# cutoff for one-liners
|
37
37
|
LINE_LENGTH = 78
|
@@ -108,6 +108,9 @@ class Ruby2Ruby < SexpProcessor
|
|
108
108
|
args << process(arg)
|
109
109
|
when :masgn then
|
110
110
|
args << process(arg)
|
111
|
+
when :kwarg then
|
112
|
+
_, k, v = arg
|
113
|
+
args << "#{k}: #{process v}"
|
111
114
|
else
|
112
115
|
raise "unknown arg type #{arg.first.inspect}"
|
113
116
|
end
|
data/test/test_ruby2ruby.rb
CHANGED
@@ -173,6 +173,27 @@ class TestRuby2Ruby < R2RTestCase
|
|
173
173
|
util_compare inn, out
|
174
174
|
end
|
175
175
|
|
176
|
+
def test_defn_kwargs
|
177
|
+
inn = s(:defn, :initialize,
|
178
|
+
s(:args, :arg, s(:kwarg, :keyword, s(:nil)), :"**args"),
|
179
|
+
s(:nil))
|
180
|
+
out = "def initialize(arg, keyword: nil, **args)\n # do nothing\nend"
|
181
|
+
|
182
|
+
util_compare inn, out
|
183
|
+
end
|
184
|
+
|
185
|
+
def test_defn_kwargs2
|
186
|
+
inn = s(:defn, :initialize,
|
187
|
+
s(:args, :arg,
|
188
|
+
s(:kwarg, :kw1, s(:nil)),
|
189
|
+
s(:kwarg, :kw2, s(:nil)),
|
190
|
+
:"**args"),
|
191
|
+
s(:nil))
|
192
|
+
out = "def initialize(arg, kw1: nil, kw2: nil, **args)\n # do nothing\nend"
|
193
|
+
|
194
|
+
util_compare inn, out
|
195
|
+
end
|
196
|
+
|
176
197
|
def test_call_self_index
|
177
198
|
util_compare s(:call, nil, :[], s(:lit, 42)), "self[42]"
|
178
199
|
end
|
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.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDPjCCAiagAwIBAgIBAjANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
14
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
15
|
-
|
15
|
+
GRYDY29tMB4XDTE0MDkxNzIzMDcwN1oXDTE1MDkxNzIzMDcwN1owRTETMBEGA1UE
|
16
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
17
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
18
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -22,14 +22,14 @@ cert_chain:
|
|
22
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
23
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
24
24
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
AQAFoDJRokCQdxFfOrmsKX41KOFlU/zjrbDVM9hgB/Ur999M6OXGSi8FitXNtMwY
|
26
|
+
FVjsiAPeU7HaWVVcZkj6IhINelTkXsxgGz/qCzjHy3iUMuZWw36cS0fiWJ5rvH+e
|
27
|
+
hD7uXxJSFuyf1riDGI1aeWbQ74WMwvNstOxLUMiV5a1fzBhlxPqb537ubDjq/M/h
|
28
|
+
zPUFPVYeL5KjDHLCqI2FwIk2sEMOQgjpXHzl+3NlD2LUgUhHDMevmgVua0e2GT1B
|
29
|
+
xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
|
30
|
+
VpzF30vNaJK6ZT7xlIsIlwmH
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2014-
|
32
|
+
date: 2014-09-27 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: sexp_processor
|
@@ -93,14 +93,14 @@ dependencies:
|
|
93
93
|
requirements:
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
96
|
+
version: '3.13'
|
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.13'
|
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
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.4.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
|