catalyst 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/catalyst.gemspec +2 -2
- data/lib/catalyst/runner.rb +1 -1
- data/test/test_catalyst.rb +20 -6
- data/test/test_runner.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/catalyst.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{catalyst}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ari Lerner"]
|
12
|
-
s.date = %q{2011-07-
|
12
|
+
s.date = %q{2011-07-27}
|
13
13
|
s.description = %q{Quickly build a framework for providing a middleware-like structure}
|
14
14
|
s.email = %q{arilerner@mac.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/catalyst/runner.rb
CHANGED
data/test/test_catalyst.rb
CHANGED
@@ -28,11 +28,24 @@ class TestCatalyst < Test::Unit::TestCase
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
should "not call the next app if @app.call is not invoked" do
|
32
|
+
@@count = 0
|
33
|
+
rs = Catalyst::RunStack.new do
|
34
|
+
use lambda {|env, app| @@count += 1; app.call(env) }
|
35
|
+
use lambda {|env, app| @@count += 1 }
|
36
|
+
use lambda {|env, app| @@count += 1 }
|
37
|
+
use lambda {|env, app| @@count += 1 }
|
38
|
+
end
|
39
|
+
|
40
|
+
rs.call({'i' => 0})
|
41
|
+
assert_equal 2, @@count
|
42
|
+
end
|
43
|
+
|
31
44
|
should "be able to call a stack" do
|
32
45
|
@@filtered_through_stack = false
|
33
46
|
@rs = Catalyst::RunStack.new do
|
34
47
|
use TestCatalystMiddleware
|
35
|
-
use lambda {|env| @@filtered_through_stack = true }
|
48
|
+
use lambda {|env, app| @@filtered_through_stack = true }
|
36
49
|
end
|
37
50
|
|
38
51
|
@rs.call({})
|
@@ -42,9 +55,9 @@ class TestCatalyst < Test::Unit::TestCase
|
|
42
55
|
should "be able to define a Catalyst run_Stack from the module" do
|
43
56
|
@@count = 0
|
44
57
|
rs = Catalyst.run_stack do
|
45
|
-
use lambda {|env| @@count += 1}
|
46
|
-
use lambda {|env| @@count += 1}
|
47
|
-
use lambda {|env| @@count += 1}
|
58
|
+
use lambda {|env, app| @@count += 1; app.call}
|
59
|
+
use lambda {|env, app| @@count += 1; app.call}
|
60
|
+
use lambda {|env, app| @@count += 1; app.call}
|
48
61
|
end
|
49
62
|
rs.call()
|
50
63
|
assert_equal @@count, 3
|
@@ -54,8 +67,9 @@ class TestCatalyst < Test::Unit::TestCase
|
|
54
67
|
should "be able to call run in place of use" do
|
55
68
|
@@count = 0
|
56
69
|
rs = Catalyst.run_stack do
|
57
|
-
|
58
|
-
|
70
|
+
|
71
|
+
use lambda {|env, app| @@count += 1; app.call()}
|
72
|
+
run lambda {|env, app| @@count += 1; app.call()}
|
59
73
|
end
|
60
74
|
|
61
75
|
rs.call
|
data/test/test_runner.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: catalyst
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ari Lerner
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-27 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
128
128
|
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
hash:
|
130
|
+
hash: 1632582077347683059
|
131
131
|
segments:
|
132
132
|
- 0
|
133
133
|
version: "0"
|