middleman 0.99.1.pre → 0.99.2.pre
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 +9 -17
- data/VERSION +1 -1
- data/features/builder.feature +16 -0
- data/features/coffee-script.feature +7 -0
- data/features/helpers_auto_stylesheet_link_tag.feature +17 -0
- data/features/helpers_page_classes.feature +17 -0
- data/features/less-css.feature +7 -0
- data/features/padrino_helpers.feature +10 -0
- data/features/scss-support.feature +7 -0
- data/features/step_definitions/asset_host_steps.rb +1 -1
- data/features/step_definitions/builder_steps.rb +45 -0
- data/features/step_definitions/env.rb +1 -1
- data/features/step_definitions/generator_steps.rb +9 -3
- data/features/step_definitions/middleman_steps.rb +8 -6
- data/features/step_definitions/page_layout_steps.rb +2 -2
- data/features/{asset_host.feature → w_asset_host.feature} +0 -0
- data/features/{automatic_image_sizes.feature → x_automatic_image_sizes.feature} +0 -0
- data/features/{cache_buster.feature → y_cache_buster.feature} +0 -0
- data/features/{relative_assets.feature → z_relative_assets.feature} +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/config.rb +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/public/images/blank.gif +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/public/static.html +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/auto-css.css +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/static.css +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/sub1/auto-css.css +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/sub1/sub2/auto-css.css +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/_partial.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/asset_host.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/auto-css.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/auto-image-sizes.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/cache-buster.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/custom-layout.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/index.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/inline-css.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/inline-js.html.haml +0 -0
- data/fixtures/test-app/views/javascripts/coffee_test.js.coffee +3 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/layout.haml +0 -0
- data/{spec/fixtures/sample/views → fixtures/test-app/views/layouts}/custom.haml +0 -0
- data/fixtures/test-app/views/padrino_test.html.haml +5 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/page-classes.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/services/index.html.haml +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/asset_host.css.sass +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/relative_assets.css.sass +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/site.css.sass +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/site_scss.css.scss +0 -0
- data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/test_less.css.less +0 -0
- data/lib/middleman.rb +9 -1
- data/lib/middleman/features.rb +29 -36
- data/lib/middleman/features/asset_host.rb +16 -15
- data/lib/middleman/features/automatic_image_sizes.rb +26 -24
- data/lib/middleman/features/cache_buster.rb +34 -33
- data/lib/middleman/features/default_helpers.rb +26 -33
- data/lib/middleman/features/livereload.rb +1 -1
- data/lib/middleman/features/minify_css.rb +8 -7
- data/lib/middleman/features/minify_javascript.rb +11 -10
- data/lib/middleman/features/relative_assets.rb +30 -29
- data/lib/middleman/features/slickmap.rb +43 -42
- data/lib/middleman/features/smush_pngs.rb +29 -29
- data/lib/middleman/features/ugly_haml.rb +7 -6
- data/lib/middleman/renderers/{coffee.rb → coffee_script.rb} +11 -8
- data/lib/middleman/renderers/haml.rb +28 -33
- data/lib/middleman/renderers/sass.rb +30 -28
- data/lib/middleman/server.rb +44 -49
- data/lib/middleman/template/config.rbt +6 -6
- data/middleman.gemspec +49 -50
- metadata +79 -75
- data/lib/middleman/renderers.rb +0 -26
- data/spec/builder_spec.rb +0 -62
- data/spec/fixtures/sample/views/maruku.html.maruku +0 -1
- data/spec/helpers_spec.rb +0 -43
- data/spec/spec_helper.rb +0 -8
data/lib/middleman/renderers.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
module Middleman
|
2
|
-
|
3
|
-
module Renderers
|
4
|
-
@@render_method_for_template_types = {}
|
5
|
-
|
6
|
-
def self.register(method_name, template_type)
|
7
|
-
@@render_method_for_template_types[template_type.to_s] = method_name
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.get_method(template_path)
|
11
|
-
template_type = Tilt[template_path].to_s
|
12
|
-
@@render_method_for_template_types[template_type]
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# Types built into Sinatra
|
19
|
-
Middleman::Renderers.register(:less, Tilt::LessTemplate)
|
20
|
-
Middleman::Renderers.register(:haml, Tilt::HamlTemplate)
|
21
|
-
Middleman::Renderers.register(:builder, Tilt::BuilderTemplate)
|
22
|
-
Middleman::Renderers.register(:erb, Tilt::ERBTemplate)
|
23
|
-
|
24
|
-
%w(haml
|
25
|
-
sass
|
26
|
-
coffee).each { |renderer| require "middleman/renderers/#{renderer}" }
|
data/spec/builder_spec.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
|
3
|
-
describe "Builder" do
|
4
|
-
def project_file(*parts)
|
5
|
-
File.expand_path(File.join(File.dirname(__FILE__), "..", *parts))
|
6
|
-
end
|
7
|
-
|
8
|
-
before :all do
|
9
|
-
@root_dir = project_file("spec", "fixtures", "sample")
|
10
|
-
end
|
11
|
-
|
12
|
-
before :each do
|
13
|
-
build_cmd = project_file("bin", "mm-build")
|
14
|
-
`cd #{@root_dir} && MM_DIR="#{@root_dir}" #{build_cmd}`
|
15
|
-
end
|
16
|
-
|
17
|
-
after :each do
|
18
|
-
FileUtils.rm_rf(File.join(@root_dir, "build"))
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should use layout" do
|
22
|
-
File.exists?("#{@root_dir}/build/index.html").should be_true
|
23
|
-
File.read("#{@root_dir}/build/index.html").should include("Comment in layout")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should build haml files" do
|
27
|
-
File.exists?("#{@root_dir}/build/index.html").should be_true
|
28
|
-
File.read("#{@root_dir}/build/index.html").should include("<h1>Welcome</h1>")
|
29
|
-
end
|
30
|
-
|
31
|
-
it "should build static files" do
|
32
|
-
File.exists?("#{@root_dir}/build/static.html").should be_true
|
33
|
-
File.read("#{@root_dir}/build/static.html").should include("Static, no code!")
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should build subdirectory files" do
|
37
|
-
File.exists?("#{@root_dir}/build/services/index.html").should be_true
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should build sass files" do
|
41
|
-
File.exists?("#{@root_dir}/build/stylesheets/site.css").should be_true
|
42
|
-
File.read("#{@root_dir}/build/stylesheets/site.css").gsub(/\s/, "").should include("html,body,div,span,applet,object,iframe")
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should build less files" do
|
46
|
-
File.exists?("#{@root_dir}/build/stylesheets/test_less.css").should be_true
|
47
|
-
File.read("#{@root_dir}/build/stylesheets/test_less.css").should include("666")
|
48
|
-
end
|
49
|
-
|
50
|
-
it "should build scss files" do
|
51
|
-
File.exists?("#{@root_dir}/build/stylesheets/site_scss.css").should be_true
|
52
|
-
File.read("#{@root_dir}/build/stylesheets/site_scss.css").gsub(/\s/, "").should include("html,body,div,span,applet,object,iframe")
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should build static css files" do
|
56
|
-
File.exists?("#{@root_dir}/build/stylesheets/static.css").should be_true
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should not build partial files" do
|
60
|
-
File.exists?("#{@root_dir}/build/_partial.html").should be_false
|
61
|
-
end
|
62
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
# Hello Maruku {.header}
|
data/spec/helpers_spec.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), "spec_helper")
|
2
|
-
|
3
|
-
base = ::Middleman::Server
|
4
|
-
|
5
|
-
describe "page_classes helper" do
|
6
|
-
it "should generate root paths correctly" do
|
7
|
-
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
|
8
|
-
browser.get("/page-class.html")
|
9
|
-
browser.last_response.body.chomp.should == "page-class"
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should generate 1-deep paths correctly" do
|
13
|
-
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
|
14
|
-
browser.get("/sub1/page-class.html")
|
15
|
-
browser.last_response.body.chomp.should == "sub1 sub1_page-class"
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should generate 2-deep paths correctly" do
|
19
|
-
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
|
20
|
-
browser.get("/sub1/sub2/page-class.html")
|
21
|
-
browser.last_response.body.chomp.should == "sub1 sub1_sub2 sub1_sub2_page-class"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "auto_stylesheet_link_tag helper" do
|
26
|
-
it "should generate root paths correctly" do
|
27
|
-
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
|
28
|
-
browser.get("/auto-css.html")
|
29
|
-
browser.last_response.body.chomp.should include("stylesheets/auto-css.css")
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should generate 1-deep paths correctly" do
|
33
|
-
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
|
34
|
-
browser.get("/sub1/auto-css.html")
|
35
|
-
browser.last_response.body.chomp.should include("stylesheets/sub1/auto-css.css")
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should generate 2-deep paths correctly" do
|
39
|
-
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
|
40
|
-
browser.get("/sub1/sub2/auto-css.html")
|
41
|
-
browser.last_response.body.chomp.should include("stylesheets/sub1/sub2/auto-css.css")
|
42
|
-
end
|
43
|
-
end
|
data/spec/spec_helper.rb
DELETED