apotomo 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,18 @@
1
+ h2. 1.0.4
2
+
3
+ h3. Bugfixes
4
+ * Caching states works, again. Thanks to Gudleik Rasch for spotting.
5
+ * We cleanly require cells-3.4.x now. Thanks to Ryan Bates who remarked that Apotomo 1.0.x tries to require cells-3.5, which was wrong.
6
+
7
+ h3. Notes
8
+ * Removed the usage of state-args. If you want the event instance in your triggered state, use @opts[:event] or upgrade to apotomo-1.1.
9
+
10
+ h2. 1.0.3
11
+
12
+ h3. Bugfixes
13
+ * fixed gemspec to not require useless gem dependencies.
14
+
15
+
1
16
  h2. 1.0.2
2
17
 
3
18
  h3. Changes
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  s.add_dependency "rails", "~> 3.0"
23
- s.add_dependency "cells", "~> 3.4"
23
+ s.add_dependency "cells", "~> 3.4.0"
24
24
  s.add_dependency "onfire", "~> 0.1.1"
25
25
  s.add_dependency "hooks", "~> 0.1.3"
26
26
 
@@ -47,7 +47,7 @@ module Apotomo
47
47
  # Piotr Sarnacki: Railtie :P
48
48
  class Railtie < Rails::Railtie
49
49
  rake_tasks do
50
- load "tasks.rake"
50
+ load "apotomo/apotomo.rake"
51
51
  end
52
52
 
53
53
  # As we are a Railtie only, the routes won't be loaded automatically. Beside that, we want our
@@ -1,5 +1,7 @@
1
+ require "rake/testtask"
2
+
1
3
  namespace "test" do
2
- TestTaskWithoutDescription.new(:widgets => "test:prepare") do |t|
4
+ Rake::TestTask.new(:widgets) do |t|
3
5
  t.libs << "test"
4
6
  t.pattern = 'test/widgets/**/*_test.rb'
5
7
  end
@@ -1,3 +1,3 @@
1
1
  module Apotomo
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
@@ -92,10 +92,10 @@ module Apotomo
92
92
 
93
93
  #render_state(state)
94
94
 
95
- return process(state, event) if method(state).arity == 1
95
+ return render_state(state, event) if method(state).arity == 1
96
96
 
97
97
  opts[:event] = event
98
- process(state)
98
+ render_state(state)
99
99
  end
100
100
 
101
101
 
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+
4
+
5
+ class CachingTest < ActiveSupport::TestCase
6
+ include Apotomo::TestCaseMethods::TestController
7
+
8
+ class CheeseWidget < Apotomo::Widget
9
+ cache :holes
10
+
11
+ @@holes = 0
12
+ cattr_accessor :holes
13
+
14
+
15
+ #def self.reset!
16
+ # @@counter = 0
17
+ #end
18
+
19
+ def increment!
20
+ self.class.holes += 1
21
+ end
22
+
23
+ def holes
24
+ render :text => increment!
25
+ end
26
+ end
27
+
28
+ context "A caching widget" do
29
+ setup do
30
+ @cheese = CheeseWidget.new(parent_controller, 'cheese', :holes)
31
+ end
32
+
33
+ should "invoke the cached state only once" do
34
+ assert_equal "1", @cheese.invoke
35
+ assert_equal "1", @cheese.invoke
36
+ end
37
+ end
38
+ end
@@ -43,19 +43,6 @@ class EventMethodsTest < Test::Unit::TestCase
43
43
  @mum.respond_to_event :answer_squeak
44
44
  @mum.fire :answer_squeak
45
45
  assert_equal ['answer squeak'], @mum.list
46
- end
47
-
48
- should "make pass the event into the triggered state" do
49
- @mum.instance_eval do
50
- respond_to_event :footsteps
51
-
52
- def footsteps(evt)
53
- list << evt.type
54
- end
55
- end
56
-
57
- @mum.trigger :footsteps
58
- assert_equal ["escape", :footsteps], @mum.list
59
46
  end
60
47
 
61
48
  should "accept payload data for the event" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 3
9
- version: 1.0.3
8
+ - 4
9
+ version: 1.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nick Sutterer
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-10 00:00:00 +01:00
17
+ date: 2011-02-09 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -42,7 +42,8 @@ dependencies:
42
42
  segments:
43
43
  - 3
44
44
  - 4
45
- version: "3.4"
45
+ - 0
46
+ version: 3.4.0
46
47
  type: :runtime
47
48
  version_requirements: *id002
48
49
  - !ruby/object:Gem::Dependency
@@ -106,6 +107,7 @@ files:
106
107
  - apotomo.gemspec
107
108
  - config/routes.rb
108
109
  - lib/apotomo.rb
110
+ - lib/apotomo/apotomo.rake
109
111
  - lib/apotomo/container_widget.rb
110
112
  - lib/apotomo/event.rb
111
113
  - lib/apotomo/event_handler.rb
@@ -131,7 +133,6 @@ files:
131
133
  - lib/generators/apotomo/templates/widget.rb
132
134
  - lib/generators/apotomo/templates/widget_test.rb
133
135
  - lib/generators/apotomo/widget_generator.rb
134
- - lib/tasks.rake
135
136
  - test/dummy/Rakefile
136
137
  - test/dummy/app/controllers/application_controller.rb
137
138
  - test/dummy/app/helpers/application_helper.rb
@@ -177,6 +178,7 @@ files:
177
178
  - test/fixtures/mouse/make_me_squeak.html.erb
178
179
  - test/fixtures/mouse/posing.html.erb
179
180
  - test/fixtures/mouse/snuggle.html.erb
181
+ - test/rails/caching_test.rb
180
182
  - test/rails/controller_methods_test.rb
181
183
  - test/rails/rails_integration_test.rb
182
184
  - test/rails/view_helper_test.rb