metamorpher 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/RELEASES.md +3 -0
- data/lib/metamorpher/drivers/ruby.rb +1 -1
- data/lib/metamorpher/version.rb +1 -1
- data/spec/unit/drivers/ruby_spec.rb +28 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c4f704cae28a8951e086540e0dfed90457dc1df
|
4
|
+
data.tar.gz: d45978633dc0e95f96ddaa2291bd4ccfb5044d2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fb0d338c247084f0fbf6111b22294ef7b7e32bb44a425daf28ff21dedd6206822c25ddd7095745c71a22c6dcdb59363733fb8efbef5a75efd70a30a120a43b0
|
7
|
+
data.tar.gz: 9ed773ae45e81245ef5e61cf57d8170b9d9206dbe7eaba2eea4795b657ff973c8a9b78bb9fc55473060a89b020234a9a9236e08b41838dc12d96a327fc4d77df
|
data/RELEASES.md
CHANGED
@@ -59,7 +59,7 @@ module Metamorpher
|
|
59
59
|
# omitting a necessary keyword. Note that these are the symbols produced
|
60
60
|
# by Parser which are not necessarily the same as Ruby keywords (e.g.,
|
61
61
|
# Parser sometimes produces a :zsuper node for a program of the form "super")
|
62
|
-
@keywords ||= %i(nil false true self)
|
62
|
+
@keywords ||= %i(nil false true self array hash)
|
63
63
|
end
|
64
64
|
|
65
65
|
def ast_for(literal)
|
data/lib/metamorpher/version.rb
CHANGED
@@ -86,6 +86,34 @@ module Metamorpher
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
89
|
+
|
90
|
+
{ "[]" => :array, "{}" => :hash }.each do |ruby_literal, type|
|
91
|
+
describe "for a program containing the '#{ruby_literal}' Ruby literal" do
|
92
|
+
let(:source) { "a = #{ruby_literal}" }
|
93
|
+
let(:metamorpher_literal) { builder.lvasgn(:a, type) }
|
94
|
+
|
95
|
+
it "should parse to the correct metamorpher literal" do
|
96
|
+
expect(subject.parse(source)).to eq(metamorpher_literal)
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should unparse to the correct source" do
|
100
|
+
expect(subject.unparse(metamorpher_literal)).to eq(source)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe "for a program that is the '#{ruby_literal}' Ruby literal" do
|
105
|
+
let(:source) { ruby_literal }
|
106
|
+
let(:metamorpher_literal) { builder.literal! type }
|
107
|
+
|
108
|
+
it "should parse to the correct metamorpher literal" do
|
109
|
+
expect(subject.parse(source)).to eq(metamorpher_literal)
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should unparse to the correct source" do
|
113
|
+
expect(subject.unparse(metamorpher_literal)).to eq(source)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
89
117
|
end
|
90
118
|
end
|
91
119
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metamorpher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis Rose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attributable
|