tdreyno-staticmatic 2.9.0 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/bin/sm-build +19 -2
  2. data/bin/sm-init +2 -2
  3. data/bin/sm-server +12 -2
  4. data/lib/builder.rb +46 -0
  5. data/lib/generator.rb +27 -0
  6. data/lib/merb/init.rb +31 -0
  7. data/lib/merb/router.rb +3 -0
  8. data/lib/merb/site.rb +41 -0
  9. data/lib/{templates → template}/helpers/site_helper.rb +3 -1
  10. data/lib/{templates/layouts → template/layout}/site.html.haml +1 -1
  11. data/lib/{templates → template}/pages/index.html.haml +0 -0
  12. data/lib/{templates/stylesheets/site.css.sass → template/stylesheets/sass/site.sass} +0 -0
  13. data/spec/builder_spec.rb +31 -16
  14. data/spec/fixtures/sample/helpers/speech_helper.rb +5 -3
  15. data/spec/fixtures/sample/{layouts → pages/layout}/site.html.erb +0 -0
  16. data/spec/fixtures/sample/{layouts → pages/layout}/specified_layout.html.erb +0 -0
  17. data/spec/fixtures/sample/pages/partial_test.html.erb +1 -1
  18. data/spec/fixtures/sample/stylesheets/{site.css.sass → sass/site.sass} +0 -0
  19. metadata +27 -76
  20. data/lib/staticmatic/actionpack_support/mime.rb +0 -5
  21. data/lib/staticmatic/actionpack_support/remove_controller_caching.rb +0 -7
  22. data/lib/staticmatic/actionpack_support/remove_partial_benchmark.rb +0 -6
  23. data/lib/staticmatic/autoload.rb +0 -18
  24. data/lib/staticmatic/base.rb +0 -77
  25. data/lib/staticmatic/builder/dotnet.rb +0 -44
  26. data/lib/staticmatic/builder/html.rb +0 -23
  27. data/lib/staticmatic/builder.rb +0 -86
  28. data/lib/staticmatic/config.rb +0 -41
  29. data/lib/staticmatic/deprecation.rb +0 -26
  30. data/lib/staticmatic/generator.rb +0 -28
  31. data/lib/staticmatic/helpers/asset_tag_helper.rb +0 -11
  32. data/lib/staticmatic/helpers/page_helper.rb +0 -9
  33. data/lib/staticmatic/helpers/url_helper.rb +0 -19
  34. data/lib/staticmatic/previewer.rb +0 -54
  35. data/lib/staticmatic/template.rb +0 -97
  36. data/lib/staticmatic/template_handlers/haml.rb +0 -15
  37. data/lib/staticmatic/template_handlers/liquid.rb +0 -9
  38. data/lib/staticmatic/template_handlers/markdown.rb +0 -9
  39. data/lib/staticmatic/template_handlers/sass.rb +0 -9
  40. data/lib/staticmatic/template_handlers/textile.rb +0 -9
  41. data/lib/staticmatic/templates/rescues/default_error.html.erb +0 -2
  42. data/lib/staticmatic/templates/rescues/template_error.html.erb +0 -19
  43. data/lib/staticmatic.rb +0 -32
  44. data/spec/action_view_helpers_spec.rb +0 -12
  45. data/spec/asset_helpers_spec.rb +0 -24
  46. data/spec/base_spec.rb +0 -54
  47. data/spec/config_spec.rb +0 -31
  48. data/spec/deprecation_spec.rb +0 -18
  49. data/spec/fixtures/sample/build/haml_test.html +0 -11
  50. data/spec/fixtures/sample/build/hello_world.html +0 -9
  51. data/spec/fixtures/sample/build/index.html +0 -9
  52. data/spec/fixtures/sample/build/page_with_error.html +0 -61
  53. data/spec/fixtures/sample/build/services/index.html +0 -9
  54. data/spec/fixtures/sample/build/services/web_development.html +0 -9
  55. data/spec/fixtures/sample/build/stylesheets/site.css +0 -3
  56. data/spec/fixtures/sample/pages/liquid_test.html.liquid +0 -3
  57. data/spec/fixtures/sample/pages/markdown_test.html.markdown +0 -3
  58. data/spec/fixtures/sample/pages/page_with_error.html.haml +0 -3
  59. data/spec/fixtures/sample/pages/textile_test.html.textile +0 -3
  60. data/spec/layouts_spec.rb +0 -28
  61. data/spec/rendering_spec.rb +0 -62
data/spec/config_spec.rb DELETED
@@ -1,31 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic")
2
-
3
- describe StaticMatic::Config do
4
- before :all do
5
- StaticMatic::Config.setup
6
- end
7
-
8
- it "should be able to get a configuration key" do
9
- StaticMatic::Config[:host].should == StaticMatic::Config.defaults[:host]
10
- end
11
-
12
- it "should be able to set a configuration key" do
13
- StaticMatic::Config[:bar] = "Hello"
14
- StaticMatic::Config[:bar].should == "Hello"
15
- end
16
-
17
- it "should be able to #delete a configuration key" do
18
- StaticMatic::Config[:bar] = "Hello"
19
- StaticMatic::Config[:bar].should == "Hello"
20
- StaticMatic::Config.delete(:bar)
21
- StaticMatic::Config[:bar].should == nil
22
- end
23
-
24
- it "should be able to #fetch a key that does exist" do
25
- StaticMatic::Config.fetch(:host, "192.168.2.1").should == StaticMatic::Config.defaults[:host]
26
- end
27
-
28
- it "should be able to #fetch a key that does exist" do
29
- StaticMatic::Config.fetch(:bar, "heylo").should == "heylo"
30
- end
31
- end
@@ -1,18 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic")
2
-
3
- describe "Deprecation of old methods" do
4
- before :all do
5
- @sample_site_path = File.dirname(__FILE__) + "/fixtures/sample"
6
- @staticmatic = StaticMatic::Base.new(@sample_site_path)
7
- @staticmatic.logger = mock("logger") # Mock the logger
8
- end
9
-
10
- it "should display a message for deprecated methods" do
11
- def deprecate_test
12
- @staticmatic.deprecate :alt => "another_method"
13
- end
14
-
15
- @staticmatic.logger.should_receive(:warn).with(/has been deprecated/)
16
- deprecate_test
17
- end
18
- end
@@ -1,11 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="/stylesheets/application.css">
4
- <h1>My Sample Site</h1>
5
- </head>
6
- <body>
7
- <strong>Hello from haml</strong>
8
- Adding some more text
9
-
10
- </body>
11
- </html>
@@ -1,9 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="/stylesheets/application.css">
4
- <h1>My Sample Site</h1>
5
- </head>
6
- <body>
7
- Hello world!
8
- </body>
9
- </html>
@@ -1,9 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="/stylesheets/application.css">
4
- <h1>My Sample Site</h1>
5
- </head>
6
- <body>
7
- Welcome
8
- </body>
9
- </html>
@@ -1,61 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="/stylesheets/application.css">
4
- <h1>My Sample Site</h1>
5
- </head>
6
- <body>
7
- Illegal Indentation: Indenting more than once per line is illegal.
8
- <pre class='debug_dump'>---
9
- - |-
10
- &nbsp; In users/stephenbartholomew/sites/curve21/utilities/staticmatic/spec/fixtures/sample/src/pages/page_with_errorhtmlhaml
11
- &nbsp;
12
- &nbsp;
13
- &nbsp; &nbsp; &nbsp; (haml):1
14
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:169:in `precompile'
15
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:609:in `each_with_index'
16
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:125:in `each'
17
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:125:in `each_with_index'
18
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:125:in `precompile'
19
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/engine.rb:75:in `initialize'
20
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/template/plugin.rb:27:in `new'
21
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/template/plugin.rb:27:in `compile'
22
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:520:in `delegate_compile'
23
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:567:in `create_template_source'
24
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:604:in `compile_template'
25
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `compile_and_render_template'
26
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:367:in `render_template'
27
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:318:in `render_file'
28
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/base.rb:36:in `render'
29
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/base.rb:44:in `render_with_layout'
30
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:26:in `build_pages'
31
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:13:in `each'
32
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:13:in `build_pages'
33
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:12:in `each'
34
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:12:in `build_pages'
35
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:8:in `initialize'
36
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:81:in `new'
37
- &nbsp; &nbsp; &nbsp; ../../../lib/staticmatic/builder.rb:81:in `build'
38
- &nbsp; &nbsp; &nbsp; ../../../lib/tasks/staticmatic.rb:4
39
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
40
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
41
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
42
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
43
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain'
44
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize'
45
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain'
46
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
47
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task'
48
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
49
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
50
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
51
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
52
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
53
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
54
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
55
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
56
- &nbsp; &nbsp; &nbsp; /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
57
- &nbsp; &nbsp; &nbsp; /usr/local/bin/rake:19:in `load'
58
- &nbsp; &nbsp; &nbsp; /usr/local/bin/rake:19
59
- </pre>
60
- </body>
61
- </html>
@@ -1,9 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="/stylesheets/application.css">
4
- <h1>My Sample Site</h1>
5
- </head>
6
- <body>
7
- <h1>Services</h1>
8
- </body>
9
- </html>
@@ -1,9 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="/stylesheets/application.css">
4
- <h1>My Sample Site</h1>
5
- </head>
6
- <body>
7
- <h1>Web Development</h1>
8
- </body>
9
- </html>
@@ -1,3 +0,0 @@
1
- body {
2
- font-family: verdana;
3
- font-size: 10pt; }
@@ -1,3 +0,0 @@
1
- <strong>{{"Hello from liquid"}}</strong>
2
-
3
- Adding some more text
@@ -1,3 +0,0 @@
1
- **Hello from markdown**
2
-
3
- Adding some more text
@@ -1,3 +0,0 @@
1
- .error
2
- Cannot have text inside
3
- Oh noes!
@@ -1,3 +0,0 @@
1
- *Hello from textile*
2
-
3
- Adding some more text
data/spec/layouts_spec.rb DELETED
@@ -1,28 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic")
2
-
3
- describe StaticMatic::Base do
4
- before :all do
5
- @sample_site_path = File.dirname(__FILE__) + "/fixtures/sample"
6
- @staticmatic = StaticMatic::Base.new(@sample_site_path)
7
- end
8
-
9
- it "should render with layout" do
10
- output = @staticmatic.render("hello_world.html")
11
- output.should include("My Sample Site")
12
- output.should include("Hello world!")
13
- end
14
-
15
- it "should render with layout specified in template" do
16
- output = @staticmatic.render("specify_layout")
17
- output.should include("This is a Specified Layout")
18
- end
19
-
20
- it "should clean layout variable for next request" do
21
- @staticmatic.template("specify_layout").view.instance_variable_get("@layout").should be_nil
22
- end
23
-
24
- it "should allow disabling the layout" do
25
- output = @staticmatic.render("no_layout")
26
- output.should_not include("My Sample Site")
27
- end
28
- end
@@ -1,62 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic")
2
-
3
- describe StaticMatic::Base do
4
- before :all do
5
- @sample_site_path = File.dirname(__FILE__) + "/fixtures/sample"
6
- @staticmatic = StaticMatic::Base.new(@sample_site_path)
7
- end
8
-
9
- it "should render a single template" do
10
- @staticmatic.render("hello_world").should include("Hello world!")
11
- end
12
-
13
- it "should render a page" do
14
- @staticmatic.render("hello_world").should include("Hello world!")
15
- end
16
-
17
- it "should render with layout" do
18
- output = @staticmatic.render("hello_world.html")
19
-
20
- output.should include("My Sample Site")
21
- output.should include("Hello world!")
22
- end
23
-
24
- it "should render haml template" do
25
- output = @staticmatic.render("haml_test")
26
- output.should include("<strong>Hello from haml</strong>")
27
- end
28
-
29
- it "should register a css renderer" do
30
- output = @staticmatic.render("stylesheets/site.css")
31
- output.should include("body {")
32
- output.should include("font-family: verdana")
33
- end
34
-
35
- it "should setup up css type correctly" do
36
- @staticmatic.template("stylesheets/site.css").view.template_format.should == :css
37
- end
38
-
39
- it "should determine format for file with extension" do
40
- @staticmatic.template("stylesheets/site.css.sass").view.template_format.should == :css
41
- end
42
-
43
- it "should have sensible defaults for haml & sass" do
44
- @staticmatic.template("stylesheets/site.sass").view.template_format.should == :css
45
- @staticmatic.template("pages/test.haml").view.template_format.should == :html
46
- end
47
-
48
- it "should render index template from sub-directory" do
49
- output = @staticmatic.render("services/")
50
- output.should include("Services")
51
- end
52
-
53
- it "should render template from sub-directory" do
54
- output = @staticmatic.render("services/web_development")
55
- output.should include("Web Development")
56
- end
57
-
58
- it "should render with layout specified in template" do
59
- output = @staticmatic.render("specify_layout")
60
- output.should include("This is a Specified Layout")
61
- end
62
- end