wires 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wires/channel.rb +26 -14
- data/lib/wires/hub.rb +1 -1
- 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: 8ba5a18e82d8030466a788523b4cf1a35444a7ee
|
4
|
+
data.tar.gz: 358f486714e9b7b2d91103966a08c6591d6b4b88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d04c8d15e06683af78f41167c30443209063ff38561229006ad2d35e94cfb924c570daee44344092e95b81dc9515399f10509fdfdaea5d00dc3ea1375ed4a564
|
7
|
+
data.tar.gz: ee87a782456ba1f9cd1572edda652cde60e7e4d66e1721e59e21fe8eb660b043f5f2bdd0f90c8bf1b3f68665196c3271906528d55715bc07c563b73892f0f87e
|
data/lib/wires/channel.rb
CHANGED
@@ -95,23 +95,35 @@ module Wires
|
|
95
95
|
|
96
96
|
def relevant_channels
|
97
97
|
return @@channel_hash[hub].values if self==channel_star
|
98
|
-
|
99
|
-
if self.name.is_a?(Regexp) then raise TypeError,
|
100
|
-
"Cannot fire on Regexp channel: #{self.name}."\
|
101
|
-
" Regexp channels can only used in event handlers." end
|
102
98
|
|
103
99
|
relevant = [channel_star]
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
100
|
+
my_names = (self.name.is_a? Array) ? self.name : [self.name]
|
101
|
+
my_names.map {|o| (o.respond_to? :channel_name) ? o.channel_name : o.to_s}
|
102
|
+
.flatten(1)
|
103
|
+
|
104
|
+
for my_name in my_names
|
105
|
+
|
106
|
+
if my_name.is_a?(Regexp) then raise TypeError,
|
107
|
+
"Cannot fire on Regexp channel: #{self.name}."\
|
108
|
+
" Regexp channels can only used in event handlers." end
|
109
|
+
|
110
|
+
for other_chan in @@channel_hash[hub].values
|
111
|
+
|
112
|
+
other_name = other_chan.name
|
113
|
+
other_name = (other_name.respond_to? :channel_name) ? \
|
114
|
+
other_name.channel_name : other_name
|
115
|
+
|
116
|
+
relevant << other_chan if \
|
117
|
+
if other_name.is_a?(Regexp)
|
118
|
+
my_name =~ other_name
|
119
|
+
else
|
120
|
+
my_name.to_s == other_name.to_s
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
|
114
125
|
end
|
126
|
+
|
115
127
|
return relevant.uniq
|
116
128
|
end
|
117
129
|
|
data/lib/wires/hub.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wires
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe McIlvain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|