callbacks_attachable 0.3.1 → 0.3.2

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: cde14954ee42182a68a68fb4f9d05bbd452c32d2
4
- data.tar.gz: ca632ce300aa550cc02c2d3b454b4e90a09e6a49
3
+ metadata.gz: e78e27472315f5970a2d932563206b0b9705487f
4
+ data.tar.gz: e97e711ecbfdd3c9162f01d258e60569dec76c73
5
5
  SHA512:
6
- metadata.gz: 241435a5ee14e9df0eb0d708718578a8b0cf56afe0c514d9fd6832e4ec22ee010650c9486933cf8a96485ef96b32d150a08b254219000551937ef00bad5b3643
7
- data.tar.gz: eaef9fce8abeb9134d20a9265e425bc7121cd33172a879b7b2b7e01d8e7005b81b7ca584b4b7ba4fb03a4efaa33a89d7b3db983644304d0648f324fbf0ceacfc
6
+ metadata.gz: ffff535941e3de5c9cf0dc6244930ba2ccadbde442d521559b3aa4afb3c7c13cfdca9796984d0b6f1b6f419b60b3f79d82e32c9887d83e6538eeb58eaf744052
7
+ data.tar.gz: afd9d3b9752ca359f9175279ef6c7e8afba2567efe4938a058483b2ae4956f00a6fdc2b2ba70cce1aae8d58b20864ba97400192cd2ffa6b9f76a40ac035edd79
@@ -19,4 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_development_dependency "bundler", "~> 1.8"
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "rspec", "~> 3.4"
23
+ spec.add_development_dependency "rspec-its"
24
+ spec.add_development_dependency "rspec-mocks-matchers-send_message", "~> 0.3"
22
25
  end
@@ -27,7 +27,9 @@ module CallbacksAttachable
27
27
  def until_true_on(event, *opts, &callback)
28
28
  klass = self
29
29
  registered_callback = on(event, *opts) do |*args|
30
- klass.off(event, registered_callback) if instance_exec(*args, &callback)
30
+ instance_exec(*args, &callback).tap do |result|
31
+ klass.off(event, registered_callback) if result
32
+ end
31
33
  end
32
34
  end
33
35
 
@@ -36,9 +38,9 @@ module CallbacksAttachable
36
38
 
37
39
  # dup the callback list so that removing callbacks while iterating does
38
40
  # still call all callbacks during map.
39
- callbacks[event].dup.map do |callback|
41
+ callbacks[event].dup.all? do |callback|
40
42
  context.instance_exec(*args, &callback) != false
41
- end.all?
43
+ end
42
44
  end
43
45
 
44
46
  def off(event, callback)
@@ -1,3 +1,3 @@
1
1
  module CallbacksAttachable
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: callbacks_attachable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-28 00:00:00.000000000 Z
11
+ date: 2015-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,48 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-its
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-mocks-matchers-send_message
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.3'
41
83
  description:
42
84
  email:
43
85
  - mail@christopheraue.net