class_indexer 0.2.0 → 0.3.0
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/exe/indexer +7 -2
- data/lib/class_indexer.rb +4 -3
- data/lib/class_indexer/version.rb +1 -1
- 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: b32a9e1afeb32398c325a8b337398ae035e296ee
|
|
4
|
+
data.tar.gz: e296c51a26cbf27030e4a10a71f5fb14b57ba89d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad91061212ac18cfb8a64f4378fe2da158b7778d3dc7ca349a784fe3585d9b51f422b7c571f6cbf8ab5f8fb0310c8c6cc10279a9d75933187a16726282efc52e
|
|
7
|
+
data.tar.gz: 66c0e7a7394163c06e2d1bfa41605a9c659b4ed62bf53be9d376b0606783ac9fa7d6ec0a4b731d276a3e7b9ecbd5213ea73c82e885cf72d8679bc3fd3f19c8da
|
data/exe/indexer
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require 'class_indexer'
|
|
4
4
|
|
|
5
5
|
# Find ruby files
|
|
6
|
-
files = Dir.glob(
|
|
6
|
+
files = Dir.glob('**/*.rb')
|
|
7
7
|
output = {}
|
|
8
8
|
|
|
9
9
|
# Parse every file we found
|
|
@@ -12,4 +12,9 @@ files.each do |input_file|
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
# Output json (pretty format)
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
if ARGV[0] == '-p'
|
|
17
|
+
jj output
|
|
18
|
+
else
|
|
19
|
+
j output
|
|
20
|
+
end
|
data/lib/class_indexer.rb
CHANGED
|
@@ -23,7 +23,7 @@ module ClassIndexer
|
|
|
23
23
|
@class_list[@current_class] = []
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
@class_list[@current_class] << {name: method_name.to_s, line: line_num}
|
|
26
|
+
@class_list[@current_class] << { name: method_name.to_s, line: line_num }
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def on_class(node)
|
|
@@ -51,11 +51,12 @@ module ClassIndexer
|
|
|
51
51
|
add_method(method_name, line_num)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
# Constant definition
|
|
54
55
|
def on_const(node)
|
|
55
56
|
end
|
|
56
57
|
|
|
58
|
+
# Method call
|
|
57
59
|
def on_send(node)
|
|
58
|
-
# method call
|
|
59
60
|
end
|
|
60
61
|
|
|
61
62
|
def on_begin(node)
|
|
@@ -73,7 +74,7 @@ module ClassIndexer
|
|
|
73
74
|
ast.process(exp)
|
|
74
75
|
ast.get_list
|
|
75
76
|
rescue Parser::SyntaxError
|
|
76
|
-
|
|
77
|
+
warn "Syntax Error found while parsing #{file}"
|
|
77
78
|
end
|
|
78
79
|
|
|
79
80
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: class_indexer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- matugm
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-07-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parser
|