mango 0.5.0.beta1 → 0.5.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/.yardopts +1 -2
- data/{doc/HISTORY.mdown → CHANGES.mdown} +31 -7
- data/README.mdown +33 -21
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/mango/application.rb +4 -0
- data/lib/mango/dependencies.rb +6 -6
- data/lib/mango/runner.rb +1 -0
- data/lib/mango/templates/.gitignore +3 -0
- data/lib/mango/templates/Gemfile +1 -1
- data/lib/mango/templates/config.ru +0 -1
- data/lib/mango/version.rb +1 -1
- data/mango.gemspec +8 -8
- data/spec/mango/application/routing_content_pages_spec.rb +31 -31
- data/spec/mango/application/routing_public_files_spec.rb +18 -18
- data/spec/mango/application/routing_style_sheets_spec.rb +27 -27
- data/spec/mango/content_page/finding_spec.rb +29 -29
- data/spec/mango/content_page/initializing_spec.rb +45 -46
- data/spec/mango/content_page_spec.rb +4 -4
- data/spec/mango/dependencies_spec.rb +22 -22
- data/spec/mango/flavored_markdown_spec.rb +8 -8
- data/spec/mango/rack/debugger_spec.rb +15 -17
- data/spec/mango/version_spec.rb +3 -3
- data/spec/quality_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -3
- metadata +32 -33
- data/doc/ROAD-MAP.mdown +0 -10
- data/spec/spec.opts +0 -3
@@ -16,15 +16,15 @@ describe Mango::Application do
|
|
16
16
|
get "/robots.txt"
|
17
17
|
end
|
18
18
|
|
19
|
-
it "
|
19
|
+
it "returns 200 status code" do
|
20
20
|
last_response.should be_ok
|
21
21
|
end
|
22
22
|
|
23
|
-
it "
|
23
|
+
it "sends the correct Content-Type header" do
|
24
24
|
last_response["Content-Type"] == "text/plain"
|
25
25
|
end
|
26
26
|
|
27
|
-
it "
|
27
|
+
it "sends the correct body content" do
|
28
28
|
last_response.body.should == <<-EXPECTED
|
29
29
|
User-agent: *
|
30
30
|
Disallow: /cgi-bin/
|
@@ -39,15 +39,15 @@ Disallow: /cgi-bin/
|
|
39
39
|
get "/images/index.html"
|
40
40
|
end
|
41
41
|
|
42
|
-
it "
|
42
|
+
it "returns 200 status code" do
|
43
43
|
last_response.should be_ok
|
44
44
|
end
|
45
45
|
|
46
|
-
it "
|
46
|
+
it "sends the correct Content-Type header" do
|
47
47
|
last_response["Content-Type"] == "text/html"
|
48
48
|
end
|
49
49
|
|
50
|
-
it "
|
50
|
+
it "sends the correct body content" do
|
51
51
|
last_response.body.should == <<-EXPECTED
|
52
52
|
<!DOCTYPE html>
|
53
53
|
<html>
|
@@ -70,15 +70,15 @@ Disallow: /cgi-bin/
|
|
70
70
|
get "/images/ripe-mango.jpg"
|
71
71
|
end
|
72
72
|
|
73
|
-
it "
|
73
|
+
it "returns 200 status code" do
|
74
74
|
last_response.should be_ok
|
75
75
|
end
|
76
76
|
|
77
|
-
it "
|
77
|
+
it "sends the correct Content-Type header" do
|
78
78
|
last_response["Content-Type"] == "image/jpeg"
|
79
79
|
end
|
80
80
|
|
81
|
-
it "
|
81
|
+
it "sends the correct body content" do
|
82
82
|
content_path = File.join(Mango::Application.public, "images", "ripe-mango.jpg")
|
83
83
|
last_response.body.should == File.open(content_path, "rb").read
|
84
84
|
end
|
@@ -91,15 +91,15 @@ Disallow: /cgi-bin/
|
|
91
91
|
get "/override"
|
92
92
|
end
|
93
93
|
|
94
|
-
it "
|
94
|
+
it "returns 200 status code" do
|
95
95
|
last_response.should be_ok
|
96
96
|
end
|
97
97
|
|
98
|
-
it "
|
98
|
+
it "sends the correct Content-Type header" do
|
99
99
|
last_response["Content-Type"] == "text/html"
|
100
100
|
end
|
101
101
|
|
102
|
-
it "
|
102
|
+
it "sends the correct body content" do
|
103
103
|
last_response.body.should == <<-EXPECTED
|
104
104
|
<!DOCTYPE html>
|
105
105
|
<html>
|
@@ -123,15 +123,15 @@ Disallow: /cgi-bin/
|
|
123
123
|
get "/images/"
|
124
124
|
end
|
125
125
|
|
126
|
-
it "
|
126
|
+
it "returns 200 status code" do
|
127
127
|
last_response.should be_ok
|
128
128
|
end
|
129
129
|
|
130
|
-
it "
|
130
|
+
it "sends the correct Content-Type header" do
|
131
131
|
last_response["Content-Type"] == "text/html"
|
132
132
|
end
|
133
133
|
|
134
|
-
it "
|
134
|
+
it "sends the correct body content" do
|
135
135
|
last_response.body.should == <<-EXPECTED
|
136
136
|
<!DOCTYPE html>
|
137
137
|
<html>
|
@@ -154,15 +154,15 @@ Disallow: /cgi-bin/
|
|
154
154
|
get "/../security_hole.txt"
|
155
155
|
end
|
156
156
|
|
157
|
-
it "
|
157
|
+
it "returns 404 status code" do
|
158
158
|
last_response.should be_not_found
|
159
159
|
end
|
160
160
|
|
161
|
-
it "
|
161
|
+
it "sends the correct Content-Type header" do
|
162
162
|
last_response["Content-Type"] == "text/html"
|
163
163
|
end
|
164
164
|
|
165
|
-
it "
|
165
|
+
it "sends the correct body content" do
|
166
166
|
last_response.body.should == <<-EXPECTED
|
167
167
|
<!DOCTYPE html>
|
168
168
|
<html>
|
@@ -16,15 +16,15 @@ describe Mango::Application do
|
|
16
16
|
get "/styles/screen.css"
|
17
17
|
end
|
18
18
|
|
19
|
-
it "
|
19
|
+
it "returns 200 status code" do
|
20
20
|
last_response.should be_ok
|
21
21
|
end
|
22
22
|
|
23
|
-
it "
|
23
|
+
it "sends the correct Content-Type header" do
|
24
24
|
last_response["Content-Type"].should == "text/css"
|
25
25
|
end
|
26
26
|
|
27
|
-
it "
|
27
|
+
it "sends the correct body content" do
|
28
28
|
last_response.body.should == <<-EXPECTED
|
29
29
|
@charset "UTF-8";
|
30
30
|
.content-navigation {
|
@@ -46,15 +46,15 @@ describe Mango::Application do
|
|
46
46
|
get "/styles/subfolder/screen.css"
|
47
47
|
end
|
48
48
|
|
49
|
-
it "
|
49
|
+
it "returns 200 status code" do
|
50
50
|
last_response.should be_ok
|
51
51
|
end
|
52
52
|
|
53
|
-
it "
|
53
|
+
it "sends the correct Content-Type header" do
|
54
54
|
last_response["Content-Type"].should == "text/css"
|
55
55
|
end
|
56
56
|
|
57
|
-
it "
|
57
|
+
it "sends the correct body content" do
|
58
58
|
last_response.body.should == <<-EXPECTED
|
59
59
|
@charset "UTF-8";
|
60
60
|
table.hl {
|
@@ -77,15 +77,15 @@ li {
|
|
77
77
|
get "/styles/reset.css"
|
78
78
|
end
|
79
79
|
|
80
|
-
it "
|
80
|
+
it "returns 200 status code" do
|
81
81
|
last_response.should be_ok
|
82
82
|
end
|
83
83
|
|
84
|
-
it "
|
84
|
+
it "sends the correct Content-Type header" do
|
85
85
|
last_response["Content-Type"].should == "text/css"
|
86
86
|
end
|
87
87
|
|
88
|
-
it "
|
88
|
+
it "sends the correct body content" do
|
89
89
|
last_response.body.should == <<-EXPECTED
|
90
90
|
/*
|
91
91
|
html5doctor.com Reset Stylesheet
|
@@ -125,15 +125,15 @@ time, mark, audio, video {
|
|
125
125
|
get "/styles/override.css"
|
126
126
|
end
|
127
127
|
|
128
|
-
it "
|
128
|
+
it "returns 200 status code" do
|
129
129
|
last_response.should be_ok
|
130
130
|
end
|
131
131
|
|
132
|
-
it "
|
132
|
+
it "sends the correct Content-Type header" do
|
133
133
|
last_response["Content-Type"].should == "text/css"
|
134
134
|
end
|
135
135
|
|
136
|
-
it "
|
136
|
+
it "sends the correct body content" do
|
137
137
|
last_response.body.should == <<-EXPECTED
|
138
138
|
#override {
|
139
139
|
font-weight: bold;
|
@@ -149,15 +149,15 @@ time, mark, audio, video {
|
|
149
149
|
get "/default.css"
|
150
150
|
end
|
151
151
|
|
152
|
-
it "
|
152
|
+
it "returns 200 status code" do
|
153
153
|
last_response.should be_ok
|
154
154
|
end
|
155
155
|
|
156
|
-
it "
|
156
|
+
it "sends the correct Content-Type header" do
|
157
157
|
last_response["Content-Type"].should == "text/css"
|
158
158
|
end
|
159
159
|
|
160
|
-
it "
|
160
|
+
it "sends the correct body content" do
|
161
161
|
last_response.body.should == <<-EXPECTED
|
162
162
|
#default {
|
163
163
|
background-color: black;
|
@@ -173,15 +173,15 @@ time, mark, audio, video {
|
|
173
173
|
get "/styles/subfolder/another.css"
|
174
174
|
end
|
175
175
|
|
176
|
-
it "
|
176
|
+
it "returns 200 status code" do
|
177
177
|
last_response.should be_ok
|
178
178
|
end
|
179
179
|
|
180
|
-
it "
|
180
|
+
it "sends the correct Content-Type header" do
|
181
181
|
last_response["Content-Type"].should == "text/css"
|
182
182
|
end
|
183
183
|
|
184
|
-
it "
|
184
|
+
it "sends the correct body content" do
|
185
185
|
last_response.body.should == <<-EXPECTED
|
186
186
|
#another {
|
187
187
|
color: red;
|
@@ -197,15 +197,15 @@ time, mark, audio, video {
|
|
197
197
|
get "/styles/style_not_found.css"
|
198
198
|
end
|
199
199
|
|
200
|
-
it "
|
200
|
+
it "returns 404 status code" do
|
201
201
|
last_response.should be_not_found
|
202
202
|
end
|
203
203
|
|
204
|
-
it "
|
204
|
+
it "sends the correct Content-Type header" do
|
205
205
|
last_response["Content-Type"].should == "text/html"
|
206
206
|
end
|
207
207
|
|
208
|
-
it "
|
208
|
+
it "sends the correct body content" do
|
209
209
|
last_response.body.should == <<-EXPECTED
|
210
210
|
<!DOCTYPE html>
|
211
211
|
<html>
|
@@ -228,15 +228,15 @@ time, mark, audio, video {
|
|
228
228
|
get "/screen.css"
|
229
229
|
end
|
230
230
|
|
231
|
-
it "
|
231
|
+
it "returns 404 status code" do
|
232
232
|
last_response.should be_not_found
|
233
233
|
end
|
234
234
|
|
235
|
-
it "
|
235
|
+
it "sends the correct Content-Type header" do
|
236
236
|
last_response["Content-Type"].should == "text/html"
|
237
237
|
end
|
238
238
|
|
239
|
-
it "
|
239
|
+
it "sends the correct body content" do
|
240
240
|
last_response.body.should == <<-EXPECTED
|
241
241
|
<!DOCTYPE html>
|
242
242
|
<html>
|
@@ -259,15 +259,15 @@ time, mark, audio, video {
|
|
259
259
|
get "/styles/../security_hole.css"
|
260
260
|
end
|
261
261
|
|
262
|
-
it "
|
262
|
+
it "returns 404 status code" do
|
263
263
|
last_response.should be_not_found
|
264
264
|
end
|
265
265
|
|
266
|
-
it "
|
266
|
+
it "sends the correct Content-Type header" do
|
267
267
|
last_response["Content-Type"].should == "text/html"
|
268
268
|
end
|
269
269
|
|
270
|
-
it "
|
270
|
+
it "sends the correct body content" do
|
271
271
|
last_response.body.should == <<-EXPECTED
|
272
272
|
<!DOCTYPE html>
|
273
273
|
<html>
|
@@ -11,11 +11,11 @@ describe Mango::ContentPage do
|
|
11
11
|
@page = Mango::ContentPage.find_by_path(path)
|
12
12
|
end
|
13
13
|
|
14
|
-
it "
|
14
|
+
it "is an instance of Mango::ContentPage" do
|
15
15
|
@page.should be_instance_of(Mango::ContentPage)
|
16
16
|
end
|
17
17
|
|
18
|
-
it "
|
18
|
+
it "saves the data" do
|
19
19
|
@page.data.should == <<-EOS
|
20
20
|
---
|
21
21
|
title: Haml!
|
@@ -27,26 +27,26 @@ category:
|
|
27
27
|
EOS
|
28
28
|
end
|
29
29
|
|
30
|
-
it "
|
30
|
+
it "detects the content engine" do
|
31
31
|
@page.content_engine.should == :haml
|
32
32
|
end
|
33
33
|
|
34
|
-
it "
|
34
|
+
it "loads the attributes" do
|
35
35
|
@page.attributes.should have(3).items
|
36
36
|
@page.attributes.should include("title" => "Haml!",)
|
37
37
|
@page.attributes.should include("category" => ["content", "engine"])
|
38
38
|
@page.attributes.should include("view" => :page)
|
39
39
|
end
|
40
40
|
|
41
|
-
it "
|
41
|
+
it "loads the body" do
|
42
42
|
@page.body.should == "%p /engines/haml.haml\n"
|
43
43
|
end
|
44
44
|
|
45
|
-
it "
|
45
|
+
it "converts to HTML" do
|
46
46
|
@page.to_html.should == "<p>/engines/haml.haml</p>\n"
|
47
47
|
end
|
48
48
|
|
49
|
-
it "
|
49
|
+
it "determines the view template's base file name" do
|
50
50
|
@page.view.should == :page
|
51
51
|
end
|
52
52
|
end
|
@@ -59,11 +59,11 @@ category:
|
|
59
59
|
@page = Mango::ContentPage.find_by_path(path)
|
60
60
|
end
|
61
61
|
|
62
|
-
it "
|
62
|
+
it "is an instance of Mango::ContentPage" do
|
63
63
|
@page.should be_instance_of(Mango::ContentPage)
|
64
64
|
end
|
65
65
|
|
66
|
-
it "
|
66
|
+
it "saves the data" do
|
67
67
|
@page.data.should == <<-EOS
|
68
68
|
---
|
69
69
|
title: Markdown!
|
@@ -75,26 +75,26 @@ category:
|
|
75
75
|
EOS
|
76
76
|
end
|
77
77
|
|
78
|
-
it "
|
78
|
+
it "detects the content engine" do
|
79
79
|
@page.content_engine.should == :markdown
|
80
80
|
end
|
81
81
|
|
82
|
-
it "
|
82
|
+
it "loads the attributes" do
|
83
83
|
@page.attributes.should have(3).items
|
84
84
|
@page.attributes.should include("title" => "Markdown!",)
|
85
85
|
@page.attributes.should include("category" => ["content", "engine"])
|
86
86
|
@page.attributes.should include("view" => :page)
|
87
87
|
end
|
88
88
|
|
89
|
-
it "
|
89
|
+
it "loads the body" do
|
90
90
|
@page.body.should == "### /engines/md.md\n"
|
91
91
|
end
|
92
92
|
|
93
|
-
it "
|
93
|
+
it "converts to HTML" do
|
94
94
|
@page.to_html.should == "<h3>/engines/md.md</h3>"
|
95
95
|
end
|
96
96
|
|
97
|
-
it "
|
97
|
+
it "determines the view template's base file name" do
|
98
98
|
@page.view.should == :page
|
99
99
|
end
|
100
100
|
end
|
@@ -107,11 +107,11 @@ category:
|
|
107
107
|
@page = Mango::ContentPage.find_by_path(path)
|
108
108
|
end
|
109
109
|
|
110
|
-
it "
|
110
|
+
it "is an instance of Mango::ContentPage" do
|
111
111
|
@page.should be_instance_of(Mango::ContentPage)
|
112
112
|
end
|
113
113
|
|
114
|
-
it "
|
114
|
+
it "saves the data" do
|
115
115
|
@page.data.should == <<-EOS
|
116
116
|
---
|
117
117
|
title: Markdown!
|
@@ -123,26 +123,26 @@ category:
|
|
123
123
|
EOS
|
124
124
|
end
|
125
125
|
|
126
|
-
it "
|
126
|
+
it "detects the content engine" do
|
127
127
|
@page.content_engine.should == :markdown
|
128
128
|
end
|
129
129
|
|
130
|
-
it "
|
130
|
+
it "loads the attributes" do
|
131
131
|
@page.attributes.should have(3).items
|
132
132
|
@page.attributes.should include("title" => "Markdown!",)
|
133
133
|
@page.attributes.should include("category" => ["content", "engine"])
|
134
134
|
@page.attributes.should include("view" => :page)
|
135
135
|
end
|
136
136
|
|
137
|
-
it "
|
137
|
+
it "loads the body" do
|
138
138
|
@page.body.should == "### /engines/mdown.mdown\n"
|
139
139
|
end
|
140
140
|
|
141
|
-
it "
|
141
|
+
it "converts to HTML" do
|
142
142
|
@page.to_html.should == "<h3>/engines/mdown.mdown</h3>"
|
143
143
|
end
|
144
144
|
|
145
|
-
it "
|
145
|
+
it "determines the view template's base file name" do
|
146
146
|
@page.view.should == :page
|
147
147
|
end
|
148
148
|
end
|
@@ -155,11 +155,11 @@ category:
|
|
155
155
|
@page = Mango::ContentPage.find_by_path(path)
|
156
156
|
end
|
157
157
|
|
158
|
-
it "
|
158
|
+
it "is an instance of Mango::ContentPage" do
|
159
159
|
@page.should be_instance_of(Mango::ContentPage)
|
160
160
|
end
|
161
161
|
|
162
|
-
it "
|
162
|
+
it "saves the data" do
|
163
163
|
@page.data.should == <<-EOS
|
164
164
|
---
|
165
165
|
title: Markdown!
|
@@ -171,26 +171,26 @@ category:
|
|
171
171
|
EOS
|
172
172
|
end
|
173
173
|
|
174
|
-
it "
|
174
|
+
it "detects the content engine" do
|
175
175
|
@page.content_engine.should == :markdown
|
176
176
|
end
|
177
177
|
|
178
|
-
it "
|
178
|
+
it "loads the attributes" do
|
179
179
|
@page.attributes.should have(3).items
|
180
180
|
@page.attributes.should include("title" => "Markdown!",)
|
181
181
|
@page.attributes.should include("category" => ["content", "engine"])
|
182
182
|
@page.attributes.should include("view" => :page)
|
183
183
|
end
|
184
184
|
|
185
|
-
it "
|
185
|
+
it "loads the body" do
|
186
186
|
@page.body.should == "### /engines/markdown.markdown\n"
|
187
187
|
end
|
188
188
|
|
189
|
-
it "
|
189
|
+
it "converts to HTML" do
|
190
190
|
@page.to_html.should == "<h3>/engines/markdown.markdown</h3>"
|
191
191
|
end
|
192
192
|
|
193
|
-
it "
|
193
|
+
it "determines the view template's base file name" do
|
194
194
|
@page.view.should == :page
|
195
195
|
end
|
196
196
|
end
|
@@ -202,7 +202,7 @@ category:
|
|
202
202
|
@path = File.join(SPEC_APP_ROOT, "content", "unknown")
|
203
203
|
end
|
204
204
|
|
205
|
-
it "
|
205
|
+
it "raises Mango::ContentPage::PageNotFound" do
|
206
206
|
expected_message = "Unable to find content page for path -- #{@path}"
|
207
207
|
lambda {
|
208
208
|
Mango::ContentPage.find_by_path(@path)
|