cuba 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/cuba.gemspec +1 -1
- data/lib/cuba.rb +4 -1
- data/lib/cuba/ron.rb +4 -0
- data/lib/cuba/version.rb +1 -1
- data/test/cuba_test.rb +11 -2
- metadata +3 -3
data/cuba.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cuba"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.4"
|
4
4
|
s.summary = "Rum based microframework for web applications."
|
5
5
|
s.description = "Cuba is a light wrapper for Rum, a microframework for Rack applications."
|
6
6
|
s.authors = ["Michel Martens"]
|
data/lib/cuba.rb
CHANGED
data/lib/cuba/ron.rb
CHANGED
data/lib/cuba/version.rb
CHANGED
data/test/cuba_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
$:.unshift(File.
|
1
|
+
$:.unshift(File.dirname(__FILE__) + "/../lib/")
|
2
2
|
|
3
3
|
require "cuba"
|
4
4
|
require "cuba/test"
|
@@ -18,12 +18,17 @@ Cuba.define do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
on default do
|
21
|
-
|
21
|
+
if session[:user]
|
22
|
+
res.write "Hey #{session[:user]}!"
|
23
|
+
else
|
24
|
+
res.redirect "/login"
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
25
29
|
on post, path("login") do
|
26
30
|
on param("user") do |user|
|
31
|
+
session[:user] = user
|
27
32
|
res.write "Got #{user}"
|
28
33
|
end
|
29
34
|
end
|
@@ -40,6 +45,10 @@ Cuba.test "Sample Site" do
|
|
40
45
|
click_button "Login"
|
41
46
|
|
42
47
|
assert_contain "Got Michel"
|
48
|
+
|
49
|
+
visit "/"
|
50
|
+
|
51
|
+
assert_contain "Hey Michel!"
|
43
52
|
end
|
44
53
|
end
|
45
54
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michel Martens
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-08 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|