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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a97753d6f810aeaae7c6f6394ee54e9fc56ee80
4
- data.tar.gz: 57ea902f8af6bb1b5f8ed68aa95fa24f5111a83c
3
+ metadata.gz: b32a9e1afeb32398c325a8b337398ae035e296ee
4
+ data.tar.gz: e296c51a26cbf27030e4a10a71f5fb14b57ba89d
5
5
  SHA512:
6
- metadata.gz: c22e78e71b07946ed83661bbc220b29bde79a4a3b64886307fbc7d27f3c5ee5d36d5a7d612b792cd503fe9cb6272cef328d34561fc606c8c98b2602859baddab
7
- data.tar.gz: 2df9314d79860a8e90c689fb7830bd1a7ba4ec47534413ffb4d3e399c857bb988b29bd5b5d3892cbc091d153f3629ffdb09006c62c6209ab9a5d8b5b7c3311e2
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("**/*.rb")
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
- jj output
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
- $stderr.puts "Syntax Error found while parsing #{file}"
77
+ warn "Syntax Error found while parsing #{file}"
77
78
  end
78
79
 
79
80
  end
@@ -1,3 +1,3 @@
1
1
  module ClassIndexer
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  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.2.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-06-27 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser