compound 1.2.1 → 1.2.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/lib/compound/host.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 428730288fa71ecd3fe4405fd21f0f2987d3f081
|
4
|
+
data.tar.gz: c23ee3cd3339b306019e0bc19a463dc928c92652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38e146fb172791ed2c841f41af7e0268145aa473186e32de11608d23c17b8178db225ace3e980b02dc9f2944d4bb965a4bdf779f5e9425c00d21e4db71279d90
|
7
|
+
data.tar.gz: e17eaf18b92a2ab551c76ad7868dbfd02233282bf2e140926fd241db5ff1689c5feb3cad1a9b1b5fe6d6e2592c04f8f89ef87b50acc8e619c5186e946f95d999
|
data/lib/compound/host.rb
CHANGED
@@ -75,14 +75,14 @@ module Compound
|
|
75
75
|
# A private method to enumerate over all of the compound parts,
|
76
76
|
# in order of compounding, starting with the most recently compounded
|
77
77
|
def each_part &block
|
78
|
-
@_compound_parts.each &block
|
78
|
+
(@_compound_parts || []).each &block
|
79
79
|
end
|
80
80
|
|
81
81
|
# A private method to enumerate over all of the compound parts,
|
82
82
|
# in order of compounding, starting with the most recently compounded,
|
83
83
|
# returning both the associated module and the part for each
|
84
84
|
def each_pair &block
|
85
|
-
@_compound_parts.map { |part|
|
85
|
+
(@_compound_parts || []).map { |part|
|
86
86
|
[part.instance_variable_get(:@_compound_component_module), part]
|
87
87
|
}.each &block
|
88
88
|
end
|
@@ -91,7 +91,7 @@ module Compound
|
|
91
91
|
# given method, whether publically or privately. The return values are
|
92
92
|
# collected into a hash with the compounded modules as the keys.
|
93
93
|
def send_to_parts sym, *args, &block
|
94
|
-
@_compound_parts.each_with_object({}) do |part, hash|
|
94
|
+
(@_compound_parts || []).each_with_object({}) do |part, hash|
|
95
95
|
hash[part.instance_variable_get(:@_compound_component_module)] = \
|
96
96
|
part.send sym, *args, &block \
|
97
97
|
if part.respond_to? sym, true
|
@@ -101,7 +101,7 @@ module Compound
|
|
101
101
|
# A private method to call send on the Compound::Part
|
102
102
|
# associated with the given module.
|
103
103
|
def send_to_part mod, sym, *args, &block
|
104
|
-
@_compound_parts.each do |part|
|
104
|
+
(@_compound_parts || []).each do |part|
|
105
105
|
if part.instance_variable_get(:@_compound_component_module) == mod
|
106
106
|
return part.send sym, *args, &block
|
107
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compound
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe McIlvain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|