callback 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -1
- data/Rakefile +1 -1
- data/lib/callback/callback.rb +0 -1
- data/lib/callback/callback_container.rb +4 -0
- data/spec/callback_container_spec.rb +28 -0
- metadata +4 -2
data/CHANGES
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
2006-11-25 (0.3.2)
|
2
|
+
* Added CallbackContainer#clear method
|
3
|
+
|
1
4
|
2006-11-24 (0.3.1)
|
2
|
-
*
|
5
|
+
* Callback :name results in the callback name rather than on_name
|
3
6
|
|
4
7
|
2006-11-24 (0.3.0)
|
5
8
|
* Added Module#callback method. Also added all of the callback methods into Object.
|
data/Rakefile
CHANGED
data/lib/callback/callback.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
dir = File.dirname(__FILE__)
|
2
|
+
require "#{dir}/spec_helper"
|
3
|
+
|
4
|
+
context "A CallbackContainer instance" do
|
5
|
+
setup do
|
6
|
+
@container = Callback::CallbackContainer.new
|
7
|
+
end
|
8
|
+
|
9
|
+
specify "should define and call callbacks" do
|
10
|
+
@container.define(:foo) {:bar}
|
11
|
+
@container.define(:foo) {:baz}
|
12
|
+
@container.notify(:foo).should == [:bar, :baz]
|
13
|
+
end
|
14
|
+
|
15
|
+
specify "should undefine callbacks" do
|
16
|
+
callback_to_undefine = @container.define(:foo) {:bar}
|
17
|
+
@container.define(:foo) {:baz}
|
18
|
+
@container.undefine(:foo, callback_to_undefine)
|
19
|
+
@container.notify(:foo).should == [:baz]
|
20
|
+
end
|
21
|
+
|
22
|
+
specify "should clear all callbacks" do
|
23
|
+
@container.define(:foo) {:bar}
|
24
|
+
@container.define(:baz) {1}
|
25
|
+
@container.clear
|
26
|
+
@container.notify(:foo).should == []
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: callback
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date: 2006-11-
|
6
|
+
version: 0.3.2
|
7
|
+
date: 2006-11-25 00:00:00 -08:00
|
8
8
|
summary: A simple callback library for ruby objects.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -41,9 +41,11 @@ files:
|
|
41
41
|
- spec/module_spec.rb
|
42
42
|
- spec/spec_helper.rb
|
43
43
|
- spec/spec_suite.rb
|
44
|
+
- spec/callback_container_spec.rb
|
44
45
|
- spec/object_spec.rb
|
45
46
|
test_files:
|
46
47
|
- spec/module_spec.rb
|
48
|
+
- spec/callback_container_spec.rb
|
47
49
|
- spec/object_spec.rb
|
48
50
|
rdoc_options: []
|
49
51
|
|