mango 0.5.0.beta5 → 0.5.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.
Files changed (58) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGES.mdown +6 -5
  3. data/Gemfile +15 -0
  4. data/Gemfile.lock +41 -0
  5. data/README.mdown +195 -82
  6. data/lib/mango/application.rb +4 -0
  7. data/lib/mango/content_page.rb +1 -1
  8. data/lib/mango/dependencies.rb +2 -2
  9. data/lib/mango/runner.rb +26 -19
  10. data/lib/mango/templates/Gemfile +1 -2
  11. data/lib/mango/templates/README.md +22 -1
  12. data/lib/mango/templates/content/index.md +1 -1
  13. data/lib/mango/templates/themes/default/public/styles/reset.css +1 -1
  14. data/lib/mango/version.rb +1 -1
  15. data/mango.gemspec +4 -4
  16. data/spec/bin/mango_spec.rb +10 -0
  17. data/spec/{app_root → fixture}/content/about/index.haml +0 -0
  18. data/spec/{app_root → fixture}/content/about/us.haml +0 -0
  19. data/spec/{app_root → fixture}/content/engines/haml.haml +0 -0
  20. data/spec/{app_root → fixture}/content/engines/markdown.markdown +0 -0
  21. data/spec/{app_root → fixture}/content/engines/md.md +0 -0
  22. data/spec/{app_root → fixture}/content/engines/mdown.mdown +0 -0
  23. data/spec/{app_root → fixture}/content/index.haml +0 -0
  24. data/spec/{app_root → fixture}/content/override.haml +0 -0
  25. data/spec/{app_root → fixture}/content/page_with_missing_view.haml +0 -0
  26. data/spec/{app_root → fixture}/content/turner+hooch.haml +0 -0
  27. data/spec/{app_root → fixture}/security_hole.haml +0 -0
  28. data/spec/{app_root → fixture}/themes/default/public/default.css +0 -0
  29. data/spec/{app_root → fixture}/themes/default/public/images/index.html +0 -0
  30. data/spec/{app_root → fixture}/themes/default/public/images/ripe-mango.jpg +0 -0
  31. data/spec/{app_root → fixture}/themes/default/public/override +0 -0
  32. data/spec/{app_root → fixture}/themes/default/public/robots.txt +0 -0
  33. data/spec/{app_root → fixture}/themes/default/public/styles/override.css +0 -0
  34. data/spec/{app_root → fixture}/themes/default/public/styles/reset.css +0 -0
  35. data/spec/{app_root → fixture}/themes/default/public/styles/subfolder/another.css +0 -0
  36. data/spec/{app_root → fixture}/themes/default/security_hole.sass +0 -0
  37. data/spec/{app_root → fixture}/themes/default/security_hole.txt +0 -0
  38. data/spec/{app_root → fixture}/themes/default/styles/override.sass +0 -0
  39. data/spec/{app_root → fixture}/themes/default/styles/screen.sass +0 -0
  40. data/spec/{app_root → fixture}/themes/default/styles/subfolder/screen.sass +0 -0
  41. data/spec/{app_root → fixture}/themes/default/views/404.haml +0 -0
  42. data/spec/{app_root → fixture}/themes/default/views/layout.haml +0 -0
  43. data/spec/{app_root → fixture}/themes/default/views/page.haml +0 -0
  44. data/spec/{mango → lib}/application/routing_content_pages_spec.rb +11 -11
  45. data/spec/{mango → lib}/application/routing_public_files_spec.rb +7 -7
  46. data/spec/{mango → lib}/application/routing_style_sheets_spec.rb +9 -9
  47. data/spec/{mango → lib}/application_spec.rb +5 -9
  48. data/spec/{mango → lib}/content_page/finding_spec.rb +5 -5
  49. data/spec/{mango → lib}/content_page/initializing_spec.rb +0 -0
  50. data/spec/{mango → lib}/content_page_spec.rb +0 -0
  51. data/spec/{mango → lib}/dependencies_spec.rb +9 -9
  52. data/spec/{mango → lib}/flavored_markdown_spec.rb +0 -0
  53. data/spec/{mango → lib}/rack/debugger_spec.rb +0 -0
  54. data/spec/lib/runner_spec.rb +380 -0
  55. data/spec/{mango → lib}/version_spec.rb +2 -2
  56. data/spec/quality_spec.rb +2 -2
  57. data/spec/spec_helper.rb +5 -4
  58. metadata +93 -102
@@ -118,6 +118,10 @@ module Mango
118
118
  use Mango::Rack::Debugger
119
119
  end
120
120
 
121
+ # For static files that don't have an extension, send the file as HTML content
122
+ #
123
+ mime_type "", "text/html"
124
+
121
125
  # Renders the `404.haml` template found within `settings.views` and sends it with 404 HTTP
122
126
  # response.
123
127
  #
@@ -172,7 +172,7 @@ module Mango
172
172
  # @return [Symbol] The view template's base file name.
173
173
  #
174
174
  def view
175
- File.basename(attributes["view"], '.*').to_sym
175
+ File.basename(attributes["view"].to_s, '.*').to_sym
176
176
  end
177
177
 
178
178
  # Adds syntactic suger for reading attributes.
@@ -36,13 +36,13 @@ module Mango
36
36
  # @see Mango::Dependencies.create_warning_for
37
37
  # @see Mango::Dependencies.warn_at_exit
38
38
  class Dependencies
39
- SUPPORTED_RUBY_VERSIONS = ["1.9.1", "1.9.2"]
39
+ SUPPORTED_RUBY_VERSIONS = ["1.9.2"]
40
40
 
41
41
  # bluecloth is a hidden yard dependency for markdown support
42
42
  DEVELOPMENT_GEMS = {
43
43
  :"rack-test" => "0.5.6",
44
44
  :rspec => "2.0.1",
45
- :yard => "0.5.8",
45
+ :yard => "0.6.1",
46
46
  :"yard-sinatra" => "0.5.1",
47
47
  :bluecloth => "2.0.9"
48
48
  }
data/lib/mango/runner.rb CHANGED
@@ -7,16 +7,16 @@ module Mango
7
7
 
8
8
  add_runtime_options!
9
9
 
10
- source_root File.join(File.dirname(__FILE__), "templates")
10
+ source_root File.expand_path("templates", File.dirname(__FILE__))
11
11
 
12
- desc "create /path/to/your/app",
13
- "Creates a new Mango application with a default directory structure and configuration at the path you specify."
12
+ desc "create /path/to/your/app", "Creates a new Mango application at the specified path"
14
13
  def create(destination)
15
14
  self.destination_root = destination
16
- copy_file(".gitignore", File.join(self.destination_root, ".gitignore"))
17
- copy_file("config.ru", File.join(self.destination_root, "config.ru"))
18
- copy_file("Gemfile", File.join(self.destination_root, "Gemfile"))
19
- copy_file("README.md", File.join(self.destination_root, "README.md"))
15
+
16
+ copy_file(".gitignore")
17
+ copy_file("config.ru")
18
+ copy_file("Gemfile")
19
+ copy_file("README.md")
20
20
 
21
21
  build_content_path
22
22
  build_themes_path
@@ -29,7 +29,8 @@ module Mango
29
29
  def build_content_path
30
30
  content_root = File.join(self.destination_root, "content")
31
31
  empty_directory(content_root)
32
- copy_file("content/index.md", File.join(content_root, "index.md"))
32
+
33
+ copy_file("content/index.md")
33
34
  end
34
35
 
35
36
  def build_themes_path
@@ -51,8 +52,9 @@ module Mango
51
52
  def build_public_path(destination)
52
53
  public_root = File.join(destination, "public")
53
54
  empty_directory(public_root)
54
- create_file(File.join(public_root, "favicon.ico"))
55
- copy_file("themes/default/public/robots.txt", File.join(public_root, "robots.txt"))
55
+
56
+ create_file("themes/default/public/favicon.ico")
57
+ copy_file("themes/default/public/robots.txt")
56
58
 
57
59
  build_public_images_path public_root
58
60
  build_public_javascripts_path public_root
@@ -62,35 +64,40 @@ module Mango
62
64
  def build_public_images_path(destination)
63
65
  public_images_root = File.join(destination, "images")
64
66
  empty_directory(public_images_root)
65
- copy_file("themes/default/public/images/particles.gif", File.join(public_images_root, "particles.gif"))
67
+
68
+ copy_file("themes/default/public/images/particles.gif")
66
69
  end
67
70
 
68
71
  def build_public_javascripts_path(destination)
69
72
  public_javascripts_root = File.join(destination, "javascripts")
70
73
  empty_directory(public_javascripts_root)
71
- copy_file("themes/default/public/javascripts/fireworks.js", File.join(public_javascripts_root, "fireworks.js"))
72
- copy_file("themes/default/public/javascripts/timer.js", File.join(public_javascripts_root, "timer.js"))
74
+
75
+ copy_file("themes/default/public/javascripts/fireworks.js")
76
+ copy_file("themes/default/public/javascripts/timer.js")
73
77
  end
74
78
 
75
79
  def build_public_styles_path(destination)
76
80
  public_styles_root = File.join(destination, "styles")
77
81
  empty_directory(public_styles_root)
78
- copy_file("themes/default/public/styles/fireworks.css", File.join(public_styles_root, "fireworks.css"))
79
- copy_file("themes/default/public/styles/reset.css", File.join(public_styles_root, "reset.css"))
82
+
83
+ copy_file("themes/default/public/styles/fireworks.css")
84
+ copy_file("themes/default/public/styles/reset.css")
80
85
  end
81
86
 
82
87
  def build_styles_path(destination)
83
88
  styles_root = File.join(destination, "styles")
84
89
  empty_directory(styles_root)
85
- copy_file("themes/default/styles/screen.sass", File.join(styles_root, "screen.sass"))
90
+
91
+ copy_file("themes/default/styles/screen.sass")
86
92
  end
87
93
 
88
94
  def build_views_path(destination)
89
95
  views_root = File.join(destination, "views")
90
96
  empty_directory(views_root)
91
- copy_file("themes/default/views/404.haml", File.join(views_root, "404.haml"))
92
- copy_file("themes/default/views/layout.haml", File.join(views_root, "layout.haml"))
93
- copy_file("themes/default/views/page.haml", File.join(views_root, "page.haml"))
97
+
98
+ copy_file("themes/default/views/404.haml")
99
+ copy_file("themes/default/views/layout.haml")
100
+ copy_file("themes/default/views/page.haml")
94
101
  end
95
102
  end
96
103
  end
@@ -1,4 +1,3 @@
1
1
  # encoding: UTF-8
2
2
  source "http://rubygems.org"
3
-
4
- gem "mango", "0.5.0.beta5"
3
+ gem "mango", "~> 0.5.0"
@@ -1 +1,22 @@
1
- test readme
1
+ Your Mango Application Name
2
+ ===========================
3
+
4
+ Summary
5
+ -------
6
+
7
+
8
+
9
+ Getting Started
10
+ ---------------
11
+
12
+
13
+
14
+ Publishing
15
+ ----------
16
+
17
+
18
+
19
+ Credits
20
+ -------
21
+
22
+
@@ -2,4 +2,4 @@
2
2
  title: Congratulations!
3
3
  ---
4
4
 
5
- ## You did it!
5
+ ## You did it!
@@ -51,4 +51,4 @@ del {
51
51
  table {
52
52
  border-collapse: collapse;
53
53
  border-spacing: 0;
54
- }
54
+ }
data/lib/mango/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mango
4
4
  # Current stable released version
5
- VERSION = "0.5.0.beta5"
5
+ VERSION = "0.5.0"
6
6
  end
data/mango.gemspec CHANGED
@@ -8,23 +8,23 @@ Gem::Specification.new do |s|
8
8
  s.author = "Ryan Sobol"
9
9
  s.email = "contact@ryansobol.com"
10
10
  s.homepage = "http://github.com/ryansobol/mango"
11
- s.summary = "Mango is a dynamic, database-free, and open source website framework"
11
+ s.summary = "Mango is a dynamic, database-free, and open source website framework."
12
12
  s.description = "Mango is a dynamic, database-free, and open source website framework that is designed to make life easier for small teams of designers, developers, and content writers."
13
13
 
14
- s.required_ruby_version = "~> 1.9.1"
14
+ s.required_ruby_version = "~> 1.9.2"
15
15
  s.required_rubygems_version = "~> 1.3.7"
16
16
  s.rubyforge_project = "mango"
17
17
 
18
18
  s.add_runtime_dependency "bundler", "~> 1.0.3"
19
19
  s.add_runtime_dependency "rack", "~> 1.2.1"
20
- s.add_runtime_dependency "sinatra", "~> 1.0.0"
20
+ s.add_runtime_dependency "sinatra", "~> 1.1.0"
21
21
  s.add_runtime_dependency "haml", "~> 3.0.22"
22
22
  s.add_runtime_dependency "bluecloth", "~> 2.0.9"
23
23
  s.add_runtime_dependency "thor", "~> 0.14.3"
24
24
 
25
25
  s.add_development_dependency "rspec", "~> 2.0.1"
26
26
  s.add_development_dependency "rack-test", "~> 0.5.6"
27
- s.add_development_dependency "yard", "~> 0.5.8"
27
+ s.add_development_dependency "yard", "~> 0.6.1"
28
28
  s.add_development_dependency "bluecloth", "~> 2.0.9"
29
29
  s.add_development_dependency "yard-sinatra", "~> 0.5.1"
30
30
 
@@ -0,0 +1,10 @@
1
+ # encoding: UTF-8
2
+ require "spec_helper"
3
+
4
+ describe "bin/mango" do
5
+ describe "generates a help message that" do
6
+ it "includes the create task" do
7
+ `#{PROJECT_ROOT + "bin/mango --help"}`.should match /mango create \/path\/to\/your\/app/
8
+ end
9
+ end
10
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -21,7 +21,7 @@ describe Mango::Application do
21
21
  end
22
22
 
23
23
  it "sends the correct Content-Type header" do
24
- last_response["Content-Type"] == "text/html"
24
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
25
25
  end
26
26
 
27
27
  it "sends the correct body content" do
@@ -55,7 +55,7 @@ describe Mango::Application do
55
55
  end
56
56
 
57
57
  it "sends the correct Content-Type header" do
58
- last_response["Content-Type"] == "text/html"
58
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
59
59
  end
60
60
 
61
61
  it "sends the correct body content" do
@@ -89,7 +89,7 @@ describe Mango::Application do
89
89
  end
90
90
 
91
91
  it "sends the correct Content-Type header" do
92
- last_response["Content-Type"] == "text/html"
92
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
93
93
  end
94
94
 
95
95
  it "sends the correct body content" do
@@ -123,7 +123,7 @@ describe Mango::Application do
123
123
  end
124
124
 
125
125
  it "sends the correct Content-Type header" do
126
- last_response["Content-Type"] == "text/html"
126
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
127
127
  end
128
128
 
129
129
  it "sends the correct body content" do
@@ -157,7 +157,7 @@ describe Mango::Application do
157
157
  end
158
158
 
159
159
  it "sends the correct Content-Type header" do
160
- last_response["Content-Type"] == "text/html"
160
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
161
161
  end
162
162
 
163
163
  it "sends the correct body content" do
@@ -191,7 +191,7 @@ describe Mango::Application do
191
191
  end
192
192
 
193
193
  it "sends the correct Content-Type header" do
194
- last_response["Content-Type"] == "text/html"
194
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
195
195
  end
196
196
 
197
197
  it "sends the correct body content" do
@@ -225,7 +225,7 @@ describe Mango::Application do
225
225
  end
226
226
 
227
227
  it "sends the correct Content-Type header" do
228
- last_response["Content-Type"] == "text/html"
228
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
229
229
  end
230
230
 
231
231
  it "sends the correct body content" do
@@ -259,7 +259,7 @@ describe Mango::Application do
259
259
  end
260
260
 
261
261
  it "sends the correct Content-Type header" do
262
- last_response["Content-Type"] == "text/html"
262
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
263
263
  end
264
264
 
265
265
  it "sends the correct body content" do
@@ -293,7 +293,7 @@ describe Mango::Application do
293
293
  end
294
294
 
295
295
  it "sends the correct Content-Type header" do
296
- last_response["Content-Type"] == "text/html"
296
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
297
297
  end
298
298
 
299
299
  it "sends the correct body content" do
@@ -316,7 +316,7 @@ describe Mango::Application do
316
316
 
317
317
  describe "GET /page_with_missing_view" do
318
318
  it "raises RuntimeError" do
319
- path = File.join(SPEC_APP_ROOT, "themes", "default", "views", "missing_view_template.haml")
319
+ path = FIXTURE_ROOT + "themes/default/views/missing_view_template.haml"
320
320
  lambda {
321
321
  get "/page_with_missing_view"
322
322
  }.should raise_exception(RuntimeError, "Unable to find a view template file -- #{path}")
@@ -335,7 +335,7 @@ describe Mango::Application do
335
335
  end
336
336
 
337
337
  it "sends the correct Content-Type header" do
338
- last_response["Content-Type"] == "text/html"
338
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
339
339
  end
340
340
 
341
341
  it "sends the correct body content" do
@@ -21,7 +21,7 @@ describe Mango::Application do
21
21
  end
22
22
 
23
23
  it "sends the correct Content-Type header" do
24
- last_response["Content-Type"] == "text/plain"
24
+ last_response["Content-Type"].should == "text/plain;charset=utf-8"
25
25
  end
26
26
 
27
27
  it "sends the correct body content" do
@@ -44,7 +44,7 @@ Disallow: /cgi-bin/
44
44
  end
45
45
 
46
46
  it "sends the correct Content-Type header" do
47
- last_response["Content-Type"] == "text/html"
47
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
48
48
  end
49
49
 
50
50
  it "sends the correct body content" do
@@ -95,7 +95,7 @@ Disallow: /cgi-bin/
95
95
  end
96
96
 
97
97
  it "sends the correct Content-Type header" do
98
- last_response["Content-Type"] == "text/html"
98
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
99
99
  end
100
100
 
101
101
  it "sends the correct body content" do
@@ -115,7 +115,7 @@ Disallow: /cgi-bin/
115
115
  end
116
116
 
117
117
  it "sends the correct Content-Type header" do
118
- last_response["Content-Type"] == "image/jpeg"
118
+ last_response["Content-Type"].should == "image/jpeg;charset=utf-8"
119
119
  end
120
120
 
121
121
  it "sends the correct body content" do
@@ -136,7 +136,7 @@ Disallow: /cgi-bin/
136
136
  end
137
137
 
138
138
  it "sends the correct Content-Type header" do
139
- last_response["Content-Type"] == "text/html"
139
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
140
140
  end
141
141
 
142
142
  it "sends the correct body content" do
@@ -168,7 +168,7 @@ Disallow: /cgi-bin/
168
168
  end
169
169
 
170
170
  it "sends the correct Content-Type header" do
171
- last_response["Content-Type"] == "text/html"
171
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
172
172
  end
173
173
 
174
174
  it "sends the correct body content" do
@@ -199,7 +199,7 @@ Disallow: /cgi-bin/
199
199
  end
200
200
 
201
201
  it "sends the correct Content-Type header" do
202
- last_response["Content-Type"] == "text/html"
202
+ last_response["Content-Type"].should == "text/html;charset=utf-8"
203
203
  end
204
204
 
205
205
  it "sends the correct body content" do