analyst 0.14.1 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/analyst.rb +5 -0
- data/lib/analyst/entities/entity.rb +7 -0
- data/lib/analyst/entities/hash.rb +17 -0
- data/lib/analyst/entities/interpolated_string.rb +14 -0
- data/lib/analyst/entities/method_call.rb +7 -0
- data/lib/analyst/entities/pair.rb +14 -0
- data/lib/analyst/entities/string.rb +13 -0
- data/lib/analyst/entities/symbol.rb +13 -0
- data/lib/analyst/parser.rb +2 -1
- data/lib/analyst/version.rb +1 -1
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2741a5ba1447921d472b3a13e573b8d35bf1d39c
|
4
|
+
data.tar.gz: 6db0b7297d497d41d406c2b67cf1d760cb751d76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d4f07efff500a960139db14696b1d35bd85321ee83f0f178a708d20fa80ca4ec1c5c49b9e83d41d30611d9610aacc3743924737d410ec875e5103ec5c31b667
|
7
|
+
data.tar.gz: b18f69c1fa2cfc2357ef97c3ad6ee0685e6a1395d333dfceefc1fdbb76751b29ec624e20c4411e277e176945dabc95f7183de3de6c60df89945a02fce0aa3129
|
data/lib/analyst.rb
CHANGED
@@ -10,9 +10,14 @@ require_relative "analyst/entities/root"
|
|
10
10
|
require_relative "analyst/entities/begin"
|
11
11
|
require_relative "analyst/entities/module"
|
12
12
|
require_relative "analyst/entities/class"
|
13
|
+
require_relative "analyst/entities/interpolated_string"
|
13
14
|
require_relative "analyst/entities/method"
|
14
15
|
require_relative "analyst/entities/method_call"
|
15
16
|
require_relative "analyst/entities/singleton_class"
|
17
|
+
require_relative "analyst/entities/hash"
|
18
|
+
require_relative "analyst/entities/pair"
|
19
|
+
require_relative "analyst/entities/symbol"
|
20
|
+
require_relative "analyst/entities/string"
|
16
21
|
require_relative "analyst/parser"
|
17
22
|
require_relative "analyst/version"
|
18
23
|
|
@@ -62,6 +62,13 @@ module Analyst
|
|
62
62
|
ast.children.last
|
63
63
|
end
|
64
64
|
|
65
|
+
def process_node(node, parent=self)
|
66
|
+
Analyst::Parser.process_node(node, parent) }
|
67
|
+
end
|
68
|
+
|
69
|
+
def process_nodes(nodes, parent=self)
|
70
|
+
nodes.map { |node| process_node(node, parent) }
|
71
|
+
end
|
65
72
|
end
|
66
73
|
end
|
67
74
|
end
|
@@ -10,6 +10,13 @@ module Analyst
|
|
10
10
|
name
|
11
11
|
end
|
12
12
|
|
13
|
+
def arguments
|
14
|
+
@arguments ||= begin
|
15
|
+
args = ast.children[2..-1]
|
16
|
+
args.map { |arg| Analyst::Parser.process_node(arg, self) }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
13
20
|
# TODO: figure out how to resolve this to an Entity. we never want
|
14
21
|
# to expose the AST to the outside.
|
15
22
|
def target_node
|
data/lib/analyst/parser.rb
CHANGED
@@ -20,7 +20,8 @@ module Analyst
|
|
20
20
|
:begin => Entities::Begin,
|
21
21
|
:module => Entities::Module,
|
22
22
|
:send => Entities::MethodCall,
|
23
|
-
:sclass => Entities::SingletonClass
|
23
|
+
:sclass => Entities::SingletonClass,
|
24
|
+
:dstr => Entities::InterpolatedString
|
24
25
|
# :def => :method_node_parser,
|
25
26
|
# :send => :send_node_parser
|
26
27
|
# TODO: make a method parser, which pushes the the context_stack so that things inside method bodies
|
data/lib/analyst/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: analyst
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coraline Ada Ehmke
|
@@ -216,11 +216,16 @@ files:
|
|
216
216
|
- lib/analyst/entities/class.rb
|
217
217
|
- lib/analyst/entities/empty.rb
|
218
218
|
- lib/analyst/entities/entity.rb
|
219
|
+
- lib/analyst/entities/hash.rb
|
220
|
+
- lib/analyst/entities/interpolated_string.rb
|
219
221
|
- lib/analyst/entities/method.rb
|
220
222
|
- lib/analyst/entities/method_call.rb
|
221
223
|
- lib/analyst/entities/module.rb
|
224
|
+
- lib/analyst/entities/pair.rb
|
222
225
|
- lib/analyst/entities/root.rb
|
223
226
|
- lib/analyst/entities/singleton_class.rb
|
227
|
+
- lib/analyst/entities/string.rb
|
228
|
+
- lib/analyst/entities/symbol.rb
|
224
229
|
- lib/analyst/parser.rb
|
225
230
|
- lib/analyst/version.rb
|
226
231
|
- spec/class_spec.rb
|