easy_callbacks 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78cd29e96e4f33597087840a931d11e87814ed37
4
- data.tar.gz: 150a4c2f8d45946662ec580ec9bb0b030de92182
3
+ metadata.gz: ceb97699a11533452e1ee8540212272daa3a97de
4
+ data.tar.gz: d01f890f60e312bc0c2d4ea9e48e5144778eef5b
5
5
  SHA512:
6
- metadata.gz: 2825eb20a91976a4aef8f578de2af31381edefb55a232e820761b5974682c56088dd7174dc20f3ce9cee49567f6849764fc623badc02e47bb4292a1840585ffc
7
- data.tar.gz: 8a8f9402da6216a8eb3204b9df913cd840d6706f56103632982a81901891f92029e4a1f7fbdee00932c358b56bdfe14a00aabb3cf19b3ea753c16087317bc6e8
6
+ metadata.gz: 6ba04e50f3856dd88118ffeb567142663a55338ccfd027d1713fcdcdeee17d615dfff58afb6a6e5ede4a6258eeb5d0d9496afe9fb4d008132a6775cbdf4fd56b
7
+ data.tar.gz: 96a3664f627de73be0516c6058346a8b5fad63a49f200b7235473ffe78c5ce5299bab43faa568a0f815725139116ddb7c253f336af9c8a67743b2218d0591642
data/changelog.txt CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.1.1
2
+
3
+ - fixing callbacks initialization bug: when trying to 'execute_callbacks_for' for a type (e.g. 'before') that doesn't
4
+ received pushes, it crashes by trying call 'select' to a nil object
5
+
1
6
  # 0.1.0
2
7
 
3
8
  - adding 'object' key to 'callback_details' providing context to anonymous callbacks
@@ -31,15 +31,17 @@ module EasyCallbacks
31
31
  end
32
32
 
33
33
  def push_callback(type, target, callback_name)
34
- initialize_callbacks type
34
+ initialize_callbacks
35
35
  self.callbacks[type].push target: target,
36
36
  callback_name: callback_name,
37
37
  proc: (block_given? ? Proc.new : nil)
38
38
  end
39
39
 
40
- def initialize_callbacks(type)
40
+ def initialize_callbacks
41
41
  self.callbacks ||= {}
42
- self.callbacks[type] ||= []
42
+ self.callbacks[:before] ||= []
43
+ self.callbacks[:around] ||= []
44
+ self.callbacks[:after] ||= []
43
45
  end
44
46
 
45
47
  def decorate_target(target)
@@ -1,3 +1,3 @@
1
1
  module EasyCallbacks
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_callbacks
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
  - r4z3c
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2016-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler