wires 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wires/base/convenience.rb +10 -11
  3. metadata +14 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d9d25b472a5b695894bd0ac5f39d95f637c49f2
4
- data.tar.gz: 14409acc61b2b8dcfd68a5a69453c96eec78960b
3
+ metadata.gz: b5f8bc2b464f35382203c19f4d4e3af96b7ee0dd
4
+ data.tar.gz: efa6722f6cbcf65ef0622661e88e0a7bb47f4712
5
5
  SHA512:
6
- metadata.gz: 6b0f002d2346c8c0fe1e91fbedcb4ef4aa3faaef06a479154a893930614f5b7474629bc852b7bd0471ddf427b85889cf7de804a48c891a4254fa03f1304063bd
7
- data.tar.gz: 8163af3fc07e3d2da2136adbefff6b2523729aeb97ecfec8556a19b88db011fca4d39be4ae65d9ea78abe1ecc47aaabf03cee285c3e8878cd519bf9eb9df2129
6
+ metadata.gz: 7eb746466b4beafb5af34c99321ce9e88b9b4d6f93ddce8bc7ebd38f552c1082f3178df31be2b41cbac00c917a1fbb6a2bf798c69e8a69e8a1063ba8096d66b8
7
+ data.tar.gz: 681219b5057225b29076785165cb14e5454920ab06ae4d4a548e28fd74416a4f19266ef7c4b4f8988ec5431d90b5bbc7a3812f5bc9d8f1d368b168309403df83
@@ -4,7 +4,8 @@ module Wires.current_network::Namespace
4
4
  module Convenience
5
5
 
6
6
  def on(events, channels=self, &codeblock)
7
- [*channels].each do |channel|
7
+ channels = [channels] unless channels.is_a? Array
8
+ channels.each do |channel|
8
9
  channel=Channel.new(channel) unless channel.is_a? Channel
9
10
 
10
11
  channel.register(*events, &codeblock)
@@ -12,16 +13,14 @@ module Wires.current_network::Namespace
12
13
  codeblock
13
14
  end
14
15
 
15
- def fire(event, channels=self, **kwargs)
16
- [*channels].each do |channel|
17
- channel = Channel.new(channel) unless channel.is_a? Channel
18
-
19
- if kwargs[:time] or (kwargs[:count] and kwargs[:count]!=1)
20
- time = kwargs.delete(:time) or Time.now
21
- TimeScheduler.add(time, event, channel, **kwargs)
22
- else
23
- channel.fire(event, **kwargs)
24
- end
16
+ def fire(event, channel, **kwargs)
17
+ channel = Channel.new(channel) unless channel.is_a? Channel
18
+
19
+ if kwargs[:time] or (kwargs[:count] and kwargs[:count]!=1)
20
+ time = kwargs.delete(:time) or Time.now
21
+ TimeScheduler.add(time, event, channel, **kwargs)
22
+ else
23
+ channel.fire(event, **kwargs)
25
24
  end
26
25
  nil end
27
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wires
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe McIlvain
@@ -143,23 +143,23 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
+ - LICENSE
147
+ - README.md
146
148
  - lib/wires.rb
147
- - lib/wires/core_ext.rb
148
- - lib/wires/core_ext/time.rb
149
- - lib/wires/core_ext/symbol.rb
150
- - lib/wires/core_ext/numeric.rb
149
+ - lib/wires/base.rb
150
+ - lib/wires/base/channel.rb
151
+ - lib/wires/base/convenience.rb
152
+ - lib/wires/base/event.rb
151
153
  - lib/wires/base/hub.rb
152
154
  - lib/wires/base/router.rb
155
+ - lib/wires/base/time_scheduler.rb
156
+ - lib/wires/base/time_scheduler_item.rb
153
157
  - lib/wires/base/util/build_alt.rb
154
158
  - lib/wires/base/util/hooks.rb
155
- - lib/wires/base/convenience.rb
156
- - lib/wires/base/channel.rb
157
- - lib/wires/base/time_scheduler_item.rb
158
- - lib/wires/base/time_scheduler.rb
159
- - lib/wires/base/event.rb
160
- - lib/wires/base.rb
161
- - LICENSE
162
- - README.md
159
+ - lib/wires/core_ext.rb
160
+ - lib/wires/core_ext/numeric.rb
161
+ - lib/wires/core_ext/symbol.rb
162
+ - lib/wires/core_ext/time.rb
163
163
  homepage: https://github.com/jemc/wires/
164
164
  licenses:
165
165
  - Copyright 2013 Joe McIlvain. All rights reserved.
@@ -180,9 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  requirements: []
182
182
  rubyforge_project:
183
- rubygems_version: 2.1.5
183
+ rubygems_version: 2.2.0
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: wires
187
187
  test_files: []
188
- has_rdoc: