tangle 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/tangle/mixin.rb +9 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7619bcb426ea03ee0855fbc4d0f61d03fcd24b325a1c2a370adee95b74d483d0
|
4
|
+
data.tar.gz: cfa7d21bcce74e0b9931e4b581ad0fdff593b531b7f075db3ee25a92e1044ade
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '028079643873be046dce5457dfc90cc7c7215bfbf78a8cfe894d47bcdf818218fcae2b7ad8bf0837c135be26377b8b5d5d2849dfba6e640b3443a47000f5a625'
|
7
|
+
data.tar.gz: 3c254ca0cb877f0b6871778782bb91d3499967e8d5256963d8b487b3d7c042f7aa61fd078484607bbdfbd85eba9601b4e3e68854fce24c47411e1cb6f8791c5f
|
data/README.md
CHANGED
@@ -7,12 +7,13 @@ Tangle aims to untangle your graphs, by providing a set of classes for managing
|
|
7
7
|
**Graph types**:
|
8
8
|
* SimpleGraph
|
9
9
|
* MultiGraph
|
10
|
-
*
|
10
|
+
* DiGraph
|
11
11
|
* ~~DAG~~
|
12
12
|
* ~~Tree~~
|
13
13
|
|
14
14
|
**Feature mixins**:
|
15
15
|
* Connectedness
|
16
|
+
* Ancestry
|
16
17
|
* ~~Coloring~~
|
17
18
|
|
18
19
|
## Installation
|
data/lib/tangle/mixin.rb
CHANGED
@@ -10,12 +10,17 @@ module Tangle
|
|
10
10
|
private
|
11
11
|
|
12
12
|
def initialize_mixins(mixins = nil)
|
13
|
-
klass = self.class.name[/[^:]+$/].to_sym
|
14
|
-
|
15
|
-
|
13
|
+
case klass = self.class.name[/[^:]+$/].to_sym
|
14
|
+
when :Graph
|
15
|
+
@mixins = mixins
|
16
|
+
else
|
17
|
+
mixins = @graph.mixins unless @graph.nil?
|
18
|
+
end
|
16
19
|
|
17
|
-
|
20
|
+
extend_with_mixins(klass, mixins) unless mixins.nil?
|
21
|
+
end
|
18
22
|
|
23
|
+
def extend_with_mixins(klass, mixins)
|
19
24
|
mixins.each do |mixin|
|
20
25
|
extend(mixin.const_get(klass)) if mixin.const_defined?(klass)
|
21
26
|
end
|