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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/core/extension/dependency.rb +4 -0
- data/lib/core/extension/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b882e25ffe74f245ebcd38369851bda318f3fad902df7dd7a524be88811ed07
|
4
|
+
data.tar.gz: ecfecfd22eb616117f4e66e08e0c16b9f2187c13cfd3869b4cd1ca2d6df444da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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?
|
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.
|
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-
|
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
|