pluggaloid 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2549e40abed501bd7546a76f8368daed95e8436a
4
- data.tar.gz: e28a4c206fe73a1d6baac70902ac64c29be1f9ff
3
+ metadata.gz: 7358343d060d4f87c19baa5b60711f46054a7628
4
+ data.tar.gz: 06430001dbaef9ff4a35b36bef2097b08db3dd68
5
5
  SHA512:
6
- metadata.gz: 831b352d0c7aad2f39b44de0da81ccf984e9568834f731fbf160cf929181f998c001102bfabc1eabe86158e4aaacf3775251584a5826fdf1113590d04f99ee7a
7
- data.tar.gz: 09ffac441afd19d38dd4e318cd95cedd3d202f8eb35eb3e57e8a3314658c593219021ed61f11adeb36541a47d732e0938e3a4b418e6f6f5c504f99782557cfe1
6
+ metadata.gz: 887c77c768a9fa525c39a91d08d8c67894c0a32f5217a44e6600382c6f04757841e56d752b816857ddfab5ba68ae6430c1b12b2fd52b5bc21e143f96880e2859
7
+ data.tar.gz: 30c03917dcb49ec48f0787570f697ea321f0f82179e8dfbc1677222263c02405f0b04559a3099c6565948c232e0f4dcac6964007a410ce2f9c27342600ffbc39
@@ -35,7 +35,7 @@ class Pluggaloid::Event
35
35
  def call(*args)
36
36
  if self.class.filter_another_thread
37
37
  if @filters.empty?
38
- vm.delayer.new(*Array(priority)) do
38
+ vm.Delayer.new(*Array(priority)) do
39
39
  call_all_listeners(args) end
40
40
  else
41
41
  Thread.new do
@@ -1,3 +1,3 @@
1
1
  module Pluggaloid
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/test/plugin_test.rb CHANGED
@@ -31,11 +31,14 @@ describe(Pluggaloid::Plugin) do
31
31
  end
32
32
 
33
33
  it "filter in another thread" do
34
- filter_thread = nil
34
+ success = filter_thread = nil
35
35
  Pluggaloid::Plugin.create(:event) do
36
36
  on_thread do
37
37
  end
38
38
 
39
+ on_unhandled do
40
+ success = true end
41
+
39
42
  filter_thread do
40
43
  filter_thread = Thread.current
41
44
  [] end end
@@ -47,8 +50,10 @@ describe(Pluggaloid::Plugin) do
47
50
  Pluggaloid::Event.filter_another_thread = true
48
51
  filter_thread = nil
49
52
  eval_all_events do
50
- Pluggaloid::Event[:thread].call end
53
+ Pluggaloid::Event[:thread].call
54
+ Pluggaloid::Event[:unhandled].call end
51
55
  assert filter_thread, "The filter doesn't run."
56
+ assert success, "Event :unhandled doesn't run."
52
57
  refute_equal Thread.current, filter_thread, 'The filter should execute in not a main thread'
53
58
  end
54
59
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluggaloid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiaki Asai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-03 00:00:00.000000000 Z
11
+ date: 2015-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: delayer