diver_down 0.0.1.alpha3 → 0.0.1.alpha4

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
  SHA256:
3
- metadata.gz: 4a41c67665f8ed7f67dc439661e5ec64ef575663daefad90bfdedaddc62a0f5f
4
- data.tar.gz: 0c4e4bbc20cc18aa0b2ce247eeede23a08e20ca0ff5105815cc1e45148e59116
3
+ metadata.gz: 8fda9d1924b7ace3a55962178519fc291dc96c1fc99cf44fa58f4aa0b4a41232
4
+ data.tar.gz: e2e693488036833f19b8cd92d7c122bd16a2363cbb9b6dbcb4463b9fb0e595d1
5
5
  SHA512:
6
- metadata.gz: 82c2e82cd6a89e009630a43052e12df11e77dcdb01adeedccf06f48a7954cf7f29f7543a0c99c79c65b51b8a82933e8d213a70a14394d4b5015f3778b1a34b80
7
- data.tar.gz: 25e11165390606b135111e238027294472ac3773d7f82e4495c0a100092fd28f700c25b0be10fc49e43f68f8e818bb4a15606f1f7bad7a87ecb2f3f340caf08a
6
+ metadata.gz: 1f868ba19a8a7d175ab8016219dfac382fbaa47dd7c1e5629928d2c8bb3fbd8ee29d99ea307a296d24b5f5b9caf91aaa4c9f11ca404771d331ef776b42afad54
7
+ data.tar.gz: 9082d6d8e245e5d806f1a5fedeee01131d7b499ec4a2b61a904ecf083d2582999b153c9112503e4b46e091a4cbdf07ca51dade5b47845870607d417d0cb107d1
@@ -28,7 +28,11 @@ module DiverDown
28
28
  # @return [Module, Class]
29
29
  def self.resolve_module(obj)
30
30
  if module?(obj) # Do not call method of this
31
- resolve_singleton_class(obj)
31
+ if module_subclass?(obj)
32
+ obj.class
33
+ else
34
+ resolve_singleton_class(obj)
35
+ end
32
36
  else
33
37
  k = INSTANCE_CLASS_QUERY.bind_call(obj)
34
38
  resolve_singleton_class(k)
@@ -62,5 +66,12 @@ module DiverDown
62
66
  def self.constantize(str)
63
67
  ::ActiveSupport::Inflector.constantize(str)
64
68
  end
69
+
70
+ # FIXME: I don't know the best way to determine which class inherits from Module.
71
+ # @return [Boolean]
72
+ def self.module_subclass?(mod)
73
+ mod.ancestors.size == 1 &&
74
+ mod.class < Module
75
+ end
65
76
  end
66
77
  end
@@ -55,7 +55,7 @@ module DiverDown
55
55
 
56
56
  mod = DiverDown::Helper.resolve_module(tp.self)
57
57
 
58
- if mod.nil?
58
+ unless mod
59
59
  call_stack.push
60
60
  next
61
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiverDown
4
- VERSION = '0.0.1.alpha3'
4
+ VERSION = '0.0.1.alpha4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diver_down
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha3
4
+ version: 0.0.1.alpha4
5
5
  platform: ruby
6
6
  authors:
7
7
  - alpaca-tc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-24 00:00:00.000000000 Z
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.5.5
107
+ rubygems_version: 3.5.9
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: dynamically analyze application dependencies and generate a comprehensive