emittable 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +7 -2
  3. data/lib/emittable.rb +8 -0
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e5c899f8668b16b6b6e51ada5aeddfb6438cdc35
4
- data.tar.gz: 100c745cb652db8045df0357516218f52b696858
2
+ SHA256:
3
+ metadata.gz: 806e01078686ca927776047b462f1c4798518fd6096639bd08e52f4fae9689ad
4
+ data.tar.gz: dadbd08fe003248e0d04435c757638e856735c73f17f661703e2e4f17bb0b115
5
5
  SHA512:
6
- metadata.gz: 46569e1acbc0073b5b5b2e3a1becbe40b8c9219988f9ed14494afbef26c2c39579e63d0b2a6695d0a8565f7a1e6ba5fc4fb218d42bd54844d1d0a187c9e1da00
7
- data.tar.gz: 5af9ef46b21c056a9da4935f9d758e397349f2bb9837078131f2ddda9ad81ca3f34721669aaa731c77a1b7401d969243ee9debbbae5ee02be35b88cf8933e569
6
+ metadata.gz: 92b38776594d2960ffeb95f6034c70e6c080d5c8a6226eb839c59d30b0295bbfc8e45c439d84ae85d4b674a7bcb5a60fb105055b82ad87f8e5bb67a4a8897eca
7
+ data.tar.gz: 2f380ac3192220a05dd8c2eb38fc3030b7d0704ce762d3ece6843101bd157a53321fc128f3855224fd74e525cdd52cf46be4db0dedded2d08e711b2bbd0af6dd
data/README.md CHANGED
@@ -1,17 +1,22 @@
1
1
  # Emittable
2
- A Ruby Gem to register and trigger events. It is a clone of `Vienna::Emittable`.
2
+ A Ruby Gem to register and trigger events. It is a clone of `Vienna::Emittable`. It is thread safe.
3
3
 
4
4
  # Install
5
5
  `gem install emittable`
6
6
 
7
7
  # Example
8
- First `require 'emittable'` in your project. Then you can `include` `Emittable` in your classes.
8
+ First `require 'emittable'` in your project. Then you can `include` `Emittable` in your classes. If you override `initialize` remember to call `super`.
9
9
  ```ruby
10
10
  require 'emittable'
11
11
 
12
12
  class A
13
13
  include Emittable
14
14
 
15
+ def initialize(...)
16
+ ...
17
+ super
18
+ end
19
+
15
20
  ...
16
21
  ...
17
22
 
@@ -4,6 +4,7 @@ require 'emittable/error'
4
4
  module Emittable
5
5
 
6
6
  def initialize(*args)
7
+ @emittable_setup = true
7
8
  @emittable_events = {}
8
9
  @emittable_mutex = Mutex.new
9
10
  super
@@ -61,4 +62,11 @@ module Emittable
61
62
  nil
62
63
  end
63
64
 
65
+ private
66
+
67
+ def check_emittable_setup
68
+ raise Error, "has 'super' been called on including class?" unless @emittable_setup
69
+ nil
70
+ end
71
+
64
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emittable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Fors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-15 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple event registering/triggering module to mix into classes.
14
14
  email: mail@robfors.com
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  version: '0'
43
43
  requirements: []
44
44
  rubyforge_project:
45
- rubygems_version: 2.4.8
45
+ rubygems_version: 2.7.6
46
46
  signing_key:
47
47
  specification_version: 4
48
48
  summary: Event registering and triggering.