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.
- data/bin/sm-build +19 -2
- data/bin/sm-init +2 -2
- data/bin/sm-server +12 -2
- data/lib/builder.rb +46 -0
- data/lib/generator.rb +27 -0
- data/lib/merb/init.rb +31 -0
- data/lib/merb/router.rb +3 -0
- data/lib/merb/site.rb +41 -0
- data/lib/{templates → template}/helpers/site_helper.rb +3 -1
- data/lib/{templates/layouts → template/layout}/site.html.haml +1 -1
- data/lib/{templates → template}/pages/index.html.haml +0 -0
- data/lib/{templates/stylesheets/site.css.sass → template/stylesheets/sass/site.sass} +0 -0
- data/spec/builder_spec.rb +31 -16
- data/spec/fixtures/sample/helpers/speech_helper.rb +5 -3
- data/spec/fixtures/sample/{layouts → pages/layout}/site.html.erb +0 -0
- data/spec/fixtures/sample/{layouts → pages/layout}/specified_layout.html.erb +0 -0
- data/spec/fixtures/sample/pages/partial_test.html.erb +1 -1
- data/spec/fixtures/sample/stylesheets/{site.css.sass → sass/site.sass} +0 -0
- metadata +27 -76
- data/lib/staticmatic/actionpack_support/mime.rb +0 -5
- data/lib/staticmatic/actionpack_support/remove_controller_caching.rb +0 -7
- data/lib/staticmatic/actionpack_support/remove_partial_benchmark.rb +0 -6
- data/lib/staticmatic/autoload.rb +0 -18
- data/lib/staticmatic/base.rb +0 -77
- data/lib/staticmatic/builder/dotnet.rb +0 -44
- data/lib/staticmatic/builder/html.rb +0 -23
- data/lib/staticmatic/builder.rb +0 -86
- data/lib/staticmatic/config.rb +0 -41
- data/lib/staticmatic/deprecation.rb +0 -26
- data/lib/staticmatic/generator.rb +0 -28
- data/lib/staticmatic/helpers/asset_tag_helper.rb +0 -11
- data/lib/staticmatic/helpers/page_helper.rb +0 -9
- data/lib/staticmatic/helpers/url_helper.rb +0 -19
- data/lib/staticmatic/previewer.rb +0 -54
- data/lib/staticmatic/template.rb +0 -97
- data/lib/staticmatic/template_handlers/haml.rb +0 -15
- data/lib/staticmatic/template_handlers/liquid.rb +0 -9
- data/lib/staticmatic/template_handlers/markdown.rb +0 -9
- data/lib/staticmatic/template_handlers/sass.rb +0 -9
- data/lib/staticmatic/template_handlers/textile.rb +0 -9
- data/lib/staticmatic/templates/rescues/default_error.html.erb +0 -2
- data/lib/staticmatic/templates/rescues/template_error.html.erb +0 -19
- data/lib/staticmatic.rb +0 -32
- data/spec/action_view_helpers_spec.rb +0 -12
- data/spec/asset_helpers_spec.rb +0 -24
- data/spec/base_spec.rb +0 -54
- data/spec/config_spec.rb +0 -31
- data/spec/deprecation_spec.rb +0 -18
- data/spec/fixtures/sample/build/haml_test.html +0 -11
- data/spec/fixtures/sample/build/hello_world.html +0 -9
- data/spec/fixtures/sample/build/index.html +0 -9
- data/spec/fixtures/sample/build/page_with_error.html +0 -61
- data/spec/fixtures/sample/build/services/index.html +0 -9
- data/spec/fixtures/sample/build/services/web_development.html +0 -9
- data/spec/fixtures/sample/build/stylesheets/site.css +0 -3
- data/spec/fixtures/sample/pages/liquid_test.html.liquid +0 -3
- data/spec/fixtures/sample/pages/markdown_test.html.markdown +0 -3
- data/spec/fixtures/sample/pages/page_with_error.html.haml +0 -3
- data/spec/fixtures/sample/pages/textile_test.html.textile +0 -3
- data/spec/layouts_spec.rb +0 -28
- 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
|
data/spec/deprecation_spec.rb
DELETED
@@ -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,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
|
-
In users/stephenbartholomew/sites/curve21/utilities/staticmatic/spec/fixtures/sample/src/pages/page_with_errorhtmlhaml
|
11
|
-
|
12
|
-
|
13
|
-
(haml):1
|
14
|
-
/usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:169:in `precompile'
|
15
|
-
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:609:in `each_with_index'
|
16
|
-
/usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:125:in `each'
|
17
|
-
/usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:125:in `each_with_index'
|
18
|
-
/usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/precompiler.rb:125:in `precompile'
|
19
|
-
/usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/engine.rb:75:in `initialize'
|
20
|
-
/usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/template/plugin.rb:27:in `new'
|
21
|
-
/usr/local/lib/ruby/gems/1.8/gems/haml-1.8.2/lib/haml/template/plugin.rb:27:in `compile'
|
22
|
-
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:520:in `delegate_compile'
|
23
|
-
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:567:in `create_template_source'
|
24
|
-
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:604:in `compile_template'
|
25
|
-
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `compile_and_render_template'
|
26
|
-
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:367:in `render_template'
|
27
|
-
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:318:in `render_file'
|
28
|
-
../../../lib/staticmatic/base.rb:36:in `render'
|
29
|
-
../../../lib/staticmatic/base.rb:44:in `render_with_layout'
|
30
|
-
../../../lib/staticmatic/builder.rb:26:in `build_pages'
|
31
|
-
../../../lib/staticmatic/builder.rb:13:in `each'
|
32
|
-
../../../lib/staticmatic/builder.rb:13:in `build_pages'
|
33
|
-
../../../lib/staticmatic/builder.rb:12:in `each'
|
34
|
-
../../../lib/staticmatic/builder.rb:12:in `build_pages'
|
35
|
-
../../../lib/staticmatic/builder.rb:8:in `initialize'
|
36
|
-
../../../lib/staticmatic/builder.rb:81:in `new'
|
37
|
-
../../../lib/staticmatic/builder.rb:81:in `build'
|
38
|
-
../../../lib/tasks/staticmatic.rb:4
|
39
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
|
40
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
|
41
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
|
42
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
|
43
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain'
|
44
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize'
|
45
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain'
|
46
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
|
47
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task'
|
48
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
|
49
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
|
50
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
|
51
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
|
52
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
|
53
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
|
54
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
|
55
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
|
56
|
-
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
|
57
|
-
/usr/local/bin/rake:19:in `load'
|
58
|
-
/usr/local/bin/rake:19
|
59
|
-
</pre>
|
60
|
-
</body>
|
61
|
-
</html>
|
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
|
data/spec/rendering_spec.rb
DELETED
@@ -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
|