core-extension 0.4.1 → 0.4.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
  SHA256:
3
- metadata.gz: 4ed9558c9300ae7945b4d23f9082dfdde7a531e4fa70a95c0b43086d945d51ad
4
- data.tar.gz: 48ce184ff00a9b7c9432c348a63b273be732271aeee476376a7592500cef53a0
3
+ metadata.gz: 0b882e25ffe74f245ebcd38369851bda318f3fad902df7dd7a524be88811ed07
4
+ data.tar.gz: ecfecfd22eb616117f4e66e08e0c16b9f2187c13cfd3869b4cd1ca2d6df444da
5
5
  SHA512:
6
- metadata.gz: 83d18619a6e0e458aa03955b852d6930de8612812f9ea07eeeab96005a31d2befe8220c5ed0ca4a50e38e8f7ebcb620f285d74bd42842d1eb40bc9a29771e2c6
7
- data.tar.gz: c39ca3469c55b68fafe12fc4461ffb7493a4955a3b75482bc972f184ad0c0ebae0f95d02539d4c3d84e1fdc3138c7816eaaed96dd1a4fcfcbf26a688346b8d87
6
+ metadata.gz: 70850ea99d13d19474fb6cdc2fd71a38c85b31057be497dc2953f1e3c721acce1a74dc98f9f62d5931567146d6861f081ecc1d679da12192728083941175ef4b
7
+ data.tar.gz: 512063dbcdc3fbd9c8a7dcde8dfe10fc39bddc97cdc816ba6423dd36d81d4e1153eb4d0ae838a43df295888a6190976570b785790d168241d9288c1bc8aa21d7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [v0.4.2](https://github.com/metabahn/corerb/releases/tag/2021-11-23)
2
+
3
+ *released on 2021-11-23*
4
+
5
+ * `fix` [#108](https://github.com/metabahn/corerb/pull/108) Prevent extension dependencies from extending an object twice ([bryanp](https://github.com/bryanp))
6
+
1
7
  ## [v0.4.1](https://github.com/metabahn/corerb/releases/tag/2021-11-02)
2
8
 
3
9
  *released on 2021-11-02*
@@ -36,6 +36,8 @@ module Core
36
36
  # [public] Apply the defined dependencies to an object via extend.
37
37
  #
38
38
  def apply_extend(object)
39
+ return if object.singleton_class.ancestors.include?(@dependency)
40
+
39
41
  if prepend?
40
42
  object.singleton_class.prepend(@dependency) if implementation? || definition?
41
43
  elsif definition? || implementation?
@@ -46,6 +48,8 @@ module Core
46
48
  # [public] Apply the defined dependencies to an object via include.
47
49
  #
48
50
  def apply_include(object)
51
+ return if object.ancestors.include?(@dependency)
52
+
49
53
  if prepend?
50
54
  object.prepend(@dependency) if implementation?
51
55
  object.singleton_class.prepend(@dependency) if definition?
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Core
4
4
  module Extension
5
- VERSION = "0.4.1"
5
+ VERSION = "0.4.2"
6
6
 
7
7
  def self.version
8
8
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create mixins with superpowers.
14
14
  email: bryan@metabahn.com