to_source 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module ToSource
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -222,6 +222,11 @@ module ToSource
222
222
  node.right.lazy_visit self, node
223
223
  end
224
224
 
225
+ def toplevel_constant(node, parent)
226
+ emit "::"
227
+ emit node.name
228
+ end
229
+
225
230
  def constant_access(node, parent)
226
231
  emit node.name
227
232
  end
@@ -31,6 +31,10 @@ module ToSource
31
31
  assert_source "@foo"
32
32
  end
33
33
 
34
+ def test_toplevel_constant_access
35
+ assert_source "::Rubinius"
36
+ end
37
+
34
38
  def test_constant_access
35
39
  assert_source "Rubinius"
36
40
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: to_source
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Josep M. Bach
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-27 00:00:00.000000000 Z
12
+ date: 2012-03-11 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Transform your Rubinius AST nodes back to source code. Reverse parsing!
15
15
  email: