ast2dot 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/ast2dot.gemspec +1 -1
- data/lib/ast2dot.rb +1 -0
- data/lib/ast2dot/node_label.rb +16 -0
- data/lib/ast2dot/version.rb +1 -1
- data/lib/templates/default.dot.erb +7 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf8d695148fcbe02fdec4e0d52ade43c1c85107b5ff792972772b6ba19ea4f3e
|
4
|
+
data.tar.gz: 9d05e0a1ceb775cabaa61ffd95bb26fdc51972f9543777b04993df2fdd2cc001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c7768f77e58bf2bf64648fdda43ca6bd371d8d6121fa76c5f651e5b396abef4ed881fc06780b04f513e530c821cdde07a79ed228fee8fc8d9d3e9e7d7951999
|
7
|
+
data.tar.gz: 4e752fc18fbdeef3ba1d9b9a9ada0ac546d9cc6caaaff94096046a69ce1478da9049189fdc0b371d916a30aae968cd3048c8f21d4d105f0ac7fe425ff0ec7983
|
data/Gemfile.lock
CHANGED
data/ast2dot.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = %q{AbstractSyntaxTree to Dot file.}
|
13
13
|
spec.homepage = 'https://github.com/siman-man/ast2dot'
|
14
14
|
spec.license = 'MIT'
|
15
|
-
spec.required_ruby_version = '>= 2.6.
|
15
|
+
spec.required_ruby_version = '>= 2.6.1'
|
16
16
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
18
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/ast2dot.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
class AST2Dot
|
2
|
+
class NodeLabel
|
3
|
+
def self.label(node)
|
4
|
+
case node.type
|
5
|
+
when :FCALL
|
6
|
+
"%s\\nmethod_id: %p" % [node.type, node.children[0]]
|
7
|
+
when :OPCALL
|
8
|
+
"%s\\nmethod_id: %p" % [node.type, node.children[1]]
|
9
|
+
when :LIT
|
10
|
+
"%s\\nvalue: %p" % [node.type, node.children[0]]
|
11
|
+
else
|
12
|
+
node.type
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/ast2dot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ast2dot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shuichi Tamayose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- exe/ast2dot
|
76
76
|
- images/example.png
|
77
77
|
- lib/ast2dot.rb
|
78
|
+
- lib/ast2dot/node_label.rb
|
78
79
|
- lib/ast2dot/version.rb
|
79
80
|
- lib/templates/default.dot.erb
|
80
81
|
homepage: https://github.com/siman-man/ast2dot
|
@@ -89,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
90
|
requirements:
|
90
91
|
- - ">="
|
91
92
|
- !ruby/object:Gem::Version
|
92
|
-
version: 2.6.
|
93
|
+
version: 2.6.1
|
93
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
95
|
requirements:
|
95
96
|
- - ">="
|