analyst 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/analyst.rb +2 -0
- data/lib/analyst/entities/lvar.rb +28 -0
- data/lib/analyst/entities/method_call.rb +4 -0
- data/lib/analyst/entities/variable_assignment.rb +5 -1
- data/lib/analyst/parser.rb +1 -1
- data/lib/analyst/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ea5bd57c9b1d90428240940a4f84ced00e3f743
|
4
|
+
data.tar.gz: 7c681665591d6fe4fcbf600fc536f669da9899fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46712d33f6615c99cefc252eec3c33b52956ad15ca78ee18ac30028c1f79d2033b1828f042fe6cdb44f5b5fdf691bb23a0c219a990603156b86b9f884e66cd59
|
7
|
+
data.tar.gz: adf555e1ec1e3c7124a08e02a0c2fb5e373c87ee652a98e7ee10d1bd5b7169c54e8fb999fb542801068596757a106f9e6785fe312ced1efd18373ce2261e520e
|
data/lib/analyst.rb
CHANGED
@@ -23,6 +23,8 @@ require_relative "analyst/entities/hash"
|
|
23
23
|
require_relative "analyst/entities/pair"
|
24
24
|
require_relative "analyst/entities/symbol"
|
25
25
|
require_relative "analyst/entities/string"
|
26
|
+
require_relative "analyst/entities/variable_assignment"
|
27
|
+
require_relative "analyst/entities/lvar"
|
26
28
|
|
27
29
|
module Analyst
|
28
30
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Analyst
|
2
|
+
|
3
|
+
module Entities
|
4
|
+
class Lvar < Entity
|
5
|
+
|
6
|
+
handles_node :lvar
|
7
|
+
|
8
|
+
def name
|
9
|
+
name_node.to_s
|
10
|
+
end
|
11
|
+
|
12
|
+
def full_name
|
13
|
+
(scope.nil? ? parent.full_name : scope.full_name) + '::' + name
|
14
|
+
end
|
15
|
+
|
16
|
+
def scope
|
17
|
+
@scope ||= process_node(ast.children.first)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def name_node
|
23
|
+
ast.children.first
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
@@ -17,10 +17,14 @@ module Analyst
|
|
17
17
|
@scope ||= process_node(ast.children.first)
|
18
18
|
end
|
19
19
|
|
20
|
+
def value
|
21
|
+
@value ||= process_nodes(ast.children)
|
22
|
+
end
|
23
|
+
|
20
24
|
private
|
21
25
|
|
22
26
|
def name_node
|
23
|
-
ast.children[1]
|
27
|
+
ast.children[1].children.first
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
data/lib/analyst/parser.rb
CHANGED
@@ -8,7 +8,7 @@ module Analyst
|
|
8
8
|
:methods, :method_calls, :hashes, :variables
|
9
9
|
|
10
10
|
def self.for_files(*path_to_files)
|
11
|
-
file_paths = path_to_files.map do |path|
|
11
|
+
file_paths = path_to_files.flatten.map do |path|
|
12
12
|
if File.directory?(path)
|
13
13
|
Dir.glob(File.join(path, "**", "*.rb"))
|
14
14
|
else
|
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: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coraline Ada Ehmke
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- lib/analyst/entities/entity.rb
|
179
179
|
- lib/analyst/entities/hash.rb
|
180
180
|
- lib/analyst/entities/interpolated_string.rb
|
181
|
+
- lib/analyst/entities/lvar.rb
|
181
182
|
- lib/analyst/entities/method.rb
|
182
183
|
- lib/analyst/entities/method_call.rb
|
183
184
|
- lib/analyst/entities/mixins/has_methods.rb
|