dsl_compose 2.0.0 → 2.0.1

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: c500aadb33dba86d32443e6e438949e9e6d72d86133b2b1f97efbe2198ab1a10
4
- data.tar.gz: 352cd66ca3c3274ff3f442b32e2740d61e976ca3d4e6cf57309dc4adc9558e3d
3
+ metadata.gz: ca7d4076508adb7aa4c534ffe69f276d4da8c50abcb65dbc898a2a40a241b2be
4
+ data.tar.gz: f0efae218b8a5ed32212077de0b42d3a345e5578c29ebf0dc4e00356ae0d00cf
5
5
  SHA512:
6
- metadata.gz: 186e700824f1c985420036b24290e9ec682a54a6f81cbd7d5822006c6d3fe2fa4cfc780fc27b5a202475cd335308e09576971db85bff76dced1c419cb406b1a1
7
- data.tar.gz: 2b5eec77d4a0619aef13218b35e4e64cecd96aa0476eb671f2d9aebb84b6f9d3e199a570beb89437844a4e6c68db8bdd6ef39a7039f30341cf8115ce163129b7
6
+ metadata.gz: 1f1302ffba75b9614fbecf1c3d84159360dcbc67f760e7474fed1e9ba321abeb7200c424ba0b9c6d7a6eb26891649012474037a896387eeec058fc3e58cba651
7
+ data.tar.gz: b20711b1f065090f9507e32029640d3766f8fd4ceb0a5d1d9372c3ddbdb03eef311982531284d0b213b4a559d614929f3531747b659db88d5eda8ebffd22cc6c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.1](https://github.com/craigulliott/dsl_compose/compare/v2.0.0...v2.0.1) (2023-07-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * ensuring the class is still defined and at the global Object scope, this prevents recently deleted classes from showing up before they have been garbage collected ([#51](https://github.com/craigulliott/dsl_compose/issues/51)) ([52111e3](https://github.com/craigulliott/dsl_compose/commit/52111e3647e8f9d26dcbea706dbe6977bf67c426))
9
+
3
10
  ## [2.0.0](https://github.com/craigulliott/dsl_compose/compare/v1.14.4...v2.0.0) (2023-07-19)
4
11
 
5
12
 
@@ -34,13 +34,17 @@ module DSLCompose
34
34
 
35
35
  # recursively get all sub classes of the provided base class
36
36
  def subclasses base_class
37
- base_class.subclasses.map { |subclass|
37
+ base_class.subclasses.filter { |subclass| class_is_still_defined? subclass }.map { |subclass|
38
38
  [subclass] + subclasses(subclass)
39
39
  }.flatten
40
40
  end
41
41
 
42
42
  def has_descendents base_class
43
- base_class.subclasses.count > 0
43
+ base_class.subclasses.count { |subclass| class_is_still_defined? subclass } > 0
44
+ end
45
+
46
+ def class_is_still_defined? klass
47
+ Object.const_defined?(klass.name) && Object.const_get(klass.name).equal?(klass)
44
48
  end
45
49
  end
46
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsl_compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott