wonkavision 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,30 +6,38 @@ unless defined?(::TestEventHandler)
6
6
  @@knids ||= []
7
7
  end
8
8
 
9
+ def self.callbacks
10
+ @@callbacks ||= []
11
+ end
12
+
9
13
  def self.reset
10
14
  @@knids = []
15
+ @@callbacks = []
16
+ end
17
+
18
+ before_event :before
19
+ def before
20
+ TestEventHandler.callbacks << {:kind=>"before_event",:path=>event_context.path}
21
+ end
22
+
23
+ after_event do |handler|
24
+ TestEventHandler.callbacks << {:kind=>"after_event", :path=>handler.event_context.path}
11
25
  end
12
26
 
13
27
  event_namespace :vermicious
14
28
 
15
29
  handle :knid do |data,path|
16
- puts "Handling #{path}. Before: #{TestEventHandler.knids.inspect}"
17
30
  TestEventHandler.knids << [data,path]
18
- puts "After: #{TestEventHandler.knids.inspect}"
19
31
  end
20
32
 
21
33
  #handle events in the vermicious namespace
22
34
  handle "*" do |data,path|
23
- puts "Handling #{path}. Before: #{TestEventHandler.knids.inspect}"
24
35
  TestEventHandler.knids << [data,path] if path !~ /.*knid/
25
- puts "After: #{TestEventHandler.knids.inspect}"
26
36
  end
27
37
 
28
38
  #handle ALL events in any namespace
29
39
  handle "/*" do |data,path|
30
- puts "Handling #{path}. Before: #{TestEventHandler.knids.inspect}"
31
40
  TestEventHandler.knids << [data,path] if path !~ /^vermicious.*/
32
- puts "After: #{TestEventHandler.knids.inspect}"
33
41
  end
34
42
 
35
43
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wonkavision}
8
- s.version = "0.5.1"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Stults"]
12
- s.date = %q{2010-07-20}
12
+ s.date = %q{2010-07-22}
13
13
  s.description = %q{Wonkavision is a small gem that allows you to publish}
14
14
  s.email = %q{hereiam@sonic.net}
15
15
  s.extra_rdoc_files = [
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "lib/wonkavision/acts_as_oompa_loompa.rb",
26
26
  "lib/wonkavision/event.rb",
27
27
  "lib/wonkavision/event_binding.rb",
28
+ "lib/wonkavision/event_context.rb",
28
29
  "lib/wonkavision/event_coordinator.rb",
29
30
  "lib/wonkavision/event_handler.rb",
30
31
  "lib/wonkavision/event_namespace.rb",
@@ -35,6 +36,7 @@ Gem::Specification.new do |s|
35
36
  "lib/wonkavision/persistence/mongo_mapper_adapter.rb",
36
37
  "lib/wonkavision/plugins.rb",
37
38
  "lib/wonkavision/plugins/business_activity.rb",
39
+ "lib/wonkavision/plugins/callbacks.rb",
38
40
  "lib/wonkavision/plugins/event_handling.rb",
39
41
  "lib/wonkavision/plugins/timeline.rb",
40
42
  "lib/wonkavision/support.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wonkavision
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Stults
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-20 00:00:00 -07:00
18
+ date: 2010-07-22 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -67,6 +67,7 @@ files:
67
67
  - lib/wonkavision/acts_as_oompa_loompa.rb
68
68
  - lib/wonkavision/event.rb
69
69
  - lib/wonkavision/event_binding.rb
70
+ - lib/wonkavision/event_context.rb
70
71
  - lib/wonkavision/event_coordinator.rb
71
72
  - lib/wonkavision/event_handler.rb
72
73
  - lib/wonkavision/event_namespace.rb
@@ -77,6 +78,7 @@ files:
77
78
  - lib/wonkavision/persistence/mongo_mapper_adapter.rb
78
79
  - lib/wonkavision/plugins.rb
79
80
  - lib/wonkavision/plugins/business_activity.rb
81
+ - lib/wonkavision/plugins/callbacks.rb
80
82
  - lib/wonkavision/plugins/event_handling.rb
81
83
  - lib/wonkavision/plugins/timeline.rb
82
84
  - lib/wonkavision/support.rb