cuba 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +3 -1
- data/cuba.gemspec +6 -9
- data/lib/cuba/ron.rb +2 -3
- data/lib/cuba/test.rb +6 -22
- data/lib/cuba/version.rb +1 -1
- data/test/integration.rb +4 -0
- data/test/webrat.log +5 -9
- metadata +22 -80
- data/test/cuba_test.rb +0 -54
data/Rakefile
CHANGED
data/cuba.gemspec
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cuba"
|
3
|
-
s.version = "0.0
|
3
|
+
s.version = "0.1.0"
|
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"]
|
7
7
|
s.email = ["michel@soveran.com"]
|
8
8
|
s.homepage = "http://github.com/soveran/cuba"
|
9
|
-
s.files = ["LICENSE", "README.markdown", "Rakefile", "lib/cuba/ron.rb", "lib/cuba/rum.rb", "lib/cuba/test.rb", "lib/cuba/version.rb", "lib/cuba.rb", "cuba.gemspec", "test/
|
10
|
-
s.add_dependency "rack", "
|
11
|
-
s.add_dependency "
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.add_dependency "contest", ">= 0.1.2"
|
15
|
-
s.add_dependency "stories", ">= 0.1.3"
|
16
|
-
s.add_dependency "rack-test", ">= 0.5.3"
|
9
|
+
s.files = ["LICENSE", "README.markdown", "Rakefile", "lib/cuba/ron.rb", "lib/cuba/rum.rb", "lib/cuba/test.rb", "lib/cuba/version.rb", "lib/cuba.rb", "cuba.gemspec", "test/integration.rb", "test/webrat.log"]
|
10
|
+
s.add_dependency "rack", "~> 1.2"
|
11
|
+
s.add_dependency "tilt", "~> 1.1"
|
12
|
+
s.add_development_dependency "cutest", "~> 0.1"
|
13
|
+
s.add_development_dependency "capybara", "~> 0.1"
|
17
14
|
end
|
data/lib/cuba/ron.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "cuba/rum"
|
2
|
-
require "haml"
|
3
2
|
require "tilt"
|
4
3
|
|
5
4
|
module Cuba
|
@@ -8,9 +7,9 @@ module Cuba
|
|
8
7
|
Thread.current[:_cache] ||= Tilt::Cache.new
|
9
8
|
end
|
10
9
|
|
11
|
-
def
|
10
|
+
def render(template, locals = {})
|
12
11
|
_cache.fetch(template, locals) {
|
13
|
-
Tilt
|
12
|
+
Tilt.new(template)
|
14
13
|
}.render(self, locals)
|
15
14
|
end
|
16
15
|
|
data/lib/cuba/test.rb
CHANGED
@@ -1,25 +1,9 @@
|
|
1
|
-
require "
|
2
|
-
require "
|
3
|
-
require "
|
4
|
-
require "stories/runner"
|
1
|
+
require "cuba"
|
2
|
+
require "cutest"
|
3
|
+
require "capybara/dsl"
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
class Cutest::Scope
|
6
|
+
include Capybara
|
8
7
|
end
|
9
8
|
|
10
|
-
|
11
|
-
include Rack::Test::Methods
|
12
|
-
include Webrat::Methods
|
13
|
-
include Webrat::Matchers
|
14
|
-
include Stories::Webrat
|
15
|
-
|
16
|
-
def app
|
17
|
-
Cuba
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module Cuba
|
22
|
-
def self.test(name, &block)
|
23
|
-
Test::Unit::TestCase.context(name, &block)
|
24
|
-
end
|
25
|
-
end
|
9
|
+
Capybara.app = Cuba
|
data/lib/cuba/version.rb
CHANGED
data/test/integration.rb
ADDED
data/test/webrat.log
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
# Logfile created on 2010-
|
2
|
-
D, [2010-
|
3
|
-
D, [2010-
|
4
|
-
D, [2010-
|
5
|
-
D, [2010-
|
6
|
-
D, [2010-05-14T12:19:24.081242 #70310] DEBUG -- : REQUESTING PAGE: GET / with {} and HTTP headers {}
|
7
|
-
D, [2010-05-14T12:19:24.127110 #70310] DEBUG -- : REQUESTING PAGE: GET /login with {} and HTTP headers {"HTTP_REFERER"=>"/"}
|
8
|
-
D, [2010-05-14T12:19:24.129474 #70310] DEBUG -- : REQUESTING PAGE: POST /login with {"user"=>"Michel"} and HTTP headers {"HTTP_REFERER"=>"/login"}
|
9
|
-
D, [2010-05-14T12:19:24.132340 #70310] DEBUG -- : REQUESTING PAGE: GET / with {} and HTTP headers {"HTTP_REFERER"=>"/login"}
|
1
|
+
# Logfile created on 2010-06-11 01:04:00 -0300 by logger.rb/20321
|
2
|
+
D, [2010-06-11T01:04:00.071479 #37917] DEBUG -- : REQUESTING PAGE: GET / with {} and HTTP headers {}
|
3
|
+
D, [2010-06-11T01:04:00.082487 #37917] DEBUG -- : REQUESTING PAGE: GET /login with {} and HTTP headers {"HTTP_REFERER"=>"/"}
|
4
|
+
D, [2010-06-11T01:04:00.084940 #37917] DEBUG -- : REQUESTING PAGE: POST /login with {"user"=>"Michel"} and HTTP headers {"HTTP_REFERER"=>"/login"}
|
5
|
+
D, [2010-06-11T01:04:00.087758 #37917] DEBUG -- : REQUESTING PAGE: GET / with {} and HTTP headers {"HTTP_REFERER"=>"/login"}
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 21
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
7
|
+
- 1
|
8
8
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.5
|
9
|
+
version: 0.1.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Michel Martens
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-09-22 00:00:00 -03:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -24,111 +23,56 @@ dependencies:
|
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
25
|
requirements:
|
27
|
-
- -
|
26
|
+
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 19
|
30
28
|
segments:
|
31
29
|
- 1
|
32
|
-
-
|
33
|
-
|
34
|
-
version: 1.1.0
|
30
|
+
- 2
|
31
|
+
version: "1.2"
|
35
32
|
type: :runtime
|
36
33
|
version_requirements: *id001
|
37
34
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
35
|
+
name: tilt
|
39
36
|
prerelease: false
|
40
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
38
|
none: false
|
42
39
|
requirements:
|
43
|
-
- -
|
40
|
+
- - ~>
|
44
41
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 43
|
46
42
|
segments:
|
47
|
-
-
|
48
|
-
-
|
49
|
-
|
50
|
-
version: 2.2.22
|
43
|
+
- 1
|
44
|
+
- 1
|
45
|
+
version: "1.1"
|
51
46
|
type: :runtime
|
52
47
|
version_requirements: *id002
|
53
48
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
49
|
+
name: cutest
|
55
50
|
prerelease: false
|
56
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
52
|
none: false
|
58
53
|
requirements:
|
59
|
-
- -
|
54
|
+
- - ~>
|
60
55
|
- !ruby/object:Gem::Version
|
61
|
-
hash: 25
|
62
56
|
segments:
|
63
57
|
- 0
|
64
|
-
-
|
65
|
-
version: "0.
|
66
|
-
type: :
|
58
|
+
- 1
|
59
|
+
version: "0.1"
|
60
|
+
type: :development
|
67
61
|
version_requirements: *id003
|
68
62
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
63
|
+
name: capybara
|
70
64
|
prerelease: false
|
71
65
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
66
|
none: false
|
73
67
|
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
hash: 3
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
- 7
|
80
|
-
- 0
|
81
|
-
version: 0.7.0
|
82
|
-
type: :runtime
|
83
|
-
version_requirements: *id004
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: contest
|
86
|
-
prerelease: false
|
87
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
|
-
requirements:
|
90
|
-
- - ">="
|
68
|
+
- - ~>
|
91
69
|
- !ruby/object:Gem::Version
|
92
|
-
hash: 31
|
93
70
|
segments:
|
94
71
|
- 0
|
95
72
|
- 1
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
version_requirements: *id005
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
name: stories
|
102
|
-
prerelease: false
|
103
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
-
none: false
|
105
|
-
requirements:
|
106
|
-
- - ">="
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
hash: 29
|
109
|
-
segments:
|
110
|
-
- 0
|
111
|
-
- 1
|
112
|
-
- 3
|
113
|
-
version: 0.1.3
|
114
|
-
type: :runtime
|
115
|
-
version_requirements: *id006
|
116
|
-
- !ruby/object:Gem::Dependency
|
117
|
-
name: rack-test
|
118
|
-
prerelease: false
|
119
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
120
|
-
none: false
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
hash: 13
|
125
|
-
segments:
|
126
|
-
- 0
|
127
|
-
- 5
|
128
|
-
- 3
|
129
|
-
version: 0.5.3
|
130
|
-
type: :runtime
|
131
|
-
version_requirements: *id007
|
73
|
+
version: "0.1"
|
74
|
+
type: :development
|
75
|
+
version_requirements: *id004
|
132
76
|
description: Cuba is a light wrapper for Rum, a microframework for Rack applications.
|
133
77
|
email:
|
134
78
|
- michel@soveran.com
|
@@ -148,7 +92,7 @@ files:
|
|
148
92
|
- lib/cuba/version.rb
|
149
93
|
- lib/cuba.rb
|
150
94
|
- cuba.gemspec
|
151
|
-
- test/
|
95
|
+
- test/integration.rb
|
152
96
|
- test/webrat.log
|
153
97
|
has_rdoc: true
|
154
98
|
homepage: http://github.com/soveran/cuba
|
@@ -164,7 +108,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
108
|
requirements:
|
165
109
|
- - ">="
|
166
110
|
- !ruby/object:Gem::Version
|
167
|
-
hash: 3
|
168
111
|
segments:
|
169
112
|
- 0
|
170
113
|
version: "0"
|
@@ -173,7 +116,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
116
|
requirements:
|
174
117
|
- - ">="
|
175
118
|
- !ruby/object:Gem::Version
|
176
|
-
hash: 3
|
177
119
|
segments:
|
178
120
|
- 0
|
179
121
|
version: "0"
|
data/test/cuba_test.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__) + "/../lib/")
|
2
|
-
|
3
|
-
require "cuba"
|
4
|
-
require "cuba/test"
|
5
|
-
|
6
|
-
form = <<EOS
|
7
|
-
<form action="/login" method="post">
|
8
|
-
<input name="user">
|
9
|
-
<input type="submit" value="Login">
|
10
|
-
</form>
|
11
|
-
EOS
|
12
|
-
|
13
|
-
Cuba.define do
|
14
|
-
on get do
|
15
|
-
on path("login") do
|
16
|
-
res.write "Enter your username"
|
17
|
-
res.write form
|
18
|
-
end
|
19
|
-
|
20
|
-
on default do
|
21
|
-
if session[:user]
|
22
|
-
res.write "Hey #{session[:user]}!"
|
23
|
-
else
|
24
|
-
res.redirect "/login"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
on post, path("login") do
|
30
|
-
on param("user") do |user|
|
31
|
-
session[:user] = user
|
32
|
-
res.write "Got #{user}"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
Cuba.test "Sample Site" do
|
38
|
-
story "As a user I want to be able to login" do
|
39
|
-
scenario "A user submits good info" do
|
40
|
-
visit "/"
|
41
|
-
|
42
|
-
assert_contain "Enter your username"
|
43
|
-
|
44
|
-
fill_in "user", :with => "Michel"
|
45
|
-
click_button "Login"
|
46
|
-
|
47
|
-
assert_contain "Got Michel"
|
48
|
-
|
49
|
-
visit "/"
|
50
|
-
|
51
|
-
assert_contain "Hey Michel!"
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|