drg 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8088ff21bcf344deaf9426041abe5010e50323b1
4
- data.tar.gz: a1b79e42fcd4f995d4b50c7ae5cbe37e2082579f
3
+ metadata.gz: 8d468fed79634c64ab7a1c56229ddd1df6468e1f
4
+ data.tar.gz: c9f6cdd369cd401d801a0746fb296d2bfc950f1d
5
5
  SHA512:
6
- metadata.gz: b70bb0f245de6a2f573ab681277a3059406c41361d3913b54c09416546b88d1c2f0ff111d9533b30c7211c7922647adfc8ebaf432160aacf36db76e5c6102f7f
7
- data.tar.gz: 3fd5f8dd60e0557065bcec396d66633ca53ae3f1f57c652d57b3908f3165855603d2a21fb6be43f9fec278d88f33377e759e308041a0ce814c8514a08c5559f3
6
+ metadata.gz: 79a33b930a524ab07ff9f1b8661d7b01619b09b3c27fc0cb4d56e221407da0573d53524847d278458560c0299a20637a1886ad170a173d17ac3a394777ff21b6
7
+ data.tar.gz: 12c488067864048c692f293b4da7384928a9a01396e4443c8cffdde013c0d087b3b288ece80c036cd18558e009d6fce7d2c77671f25c8b1f9434ca4e03e0886c
@@ -41,7 +41,7 @@ class DRG::Ruby::Const
41
41
  end
42
42
 
43
43
  def funcs
44
- @funcs ||= load_funkyness
44
+ @funcs ||= load_funcs.flatten
45
45
  end
46
46
 
47
47
  def class?
@@ -62,9 +62,9 @@ class DRG::Ruby::Const
62
62
 
63
63
  private
64
64
 
65
- def load_funkyness
65
+ def load_funcs(sexp_list = sexp)
66
66
  marked_private = false
67
- sexp.map { |node|
67
+ sexp_list.map { |node|
68
68
  next unless node.is_a?(Sexp)
69
69
  case node.first
70
70
  when :defn
@@ -74,7 +74,15 @@ class DRG::Ruby::Const
74
74
  when :call
75
75
  marked_private ||= node[2] == :private
76
76
  nil
77
+ when ->(name) { CONSTANT_DEFS.key?(name) }
78
+ # @note handle stuff like:
79
+ # s(:class, :VerificationCode, nil, s(:defs, s(:self), :find, s(:args, :*)))
80
+ # and
81
+ # s(:module, :ConditionParsers, s(:class, :ReturnValue, ...))
82
+ load_funcs(node.compact[2])
77
83
  else
84
+ # @todo uncomment with logger at debug level
85
+ # puts "got #{__method__} with #{node.first} and don't know how to handle it"
78
86
  nil
79
87
  end
80
88
  }.compact
data/lib/drg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DRG
2
- VERSION = '0.14.1'.freeze
2
+ VERSION = '0.14.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-21 00:00:00.000000000 Z
11
+ date: 2015-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_parser