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.
Files changed (71) hide show
  1. data/Rakefile +9 -17
  2. data/VERSION +1 -1
  3. data/features/builder.feature +16 -0
  4. data/features/coffee-script.feature +7 -0
  5. data/features/helpers_auto_stylesheet_link_tag.feature +17 -0
  6. data/features/helpers_page_classes.feature +17 -0
  7. data/features/less-css.feature +7 -0
  8. data/features/padrino_helpers.feature +10 -0
  9. data/features/scss-support.feature +7 -0
  10. data/features/step_definitions/asset_host_steps.rb +1 -1
  11. data/features/step_definitions/builder_steps.rb +45 -0
  12. data/features/step_definitions/env.rb +1 -1
  13. data/features/step_definitions/generator_steps.rb +9 -3
  14. data/features/step_definitions/middleman_steps.rb +8 -6
  15. data/features/step_definitions/page_layout_steps.rb +2 -2
  16. data/features/{asset_host.feature → w_asset_host.feature} +0 -0
  17. data/features/{automatic_image_sizes.feature → x_automatic_image_sizes.feature} +0 -0
  18. data/features/{cache_buster.feature → y_cache_buster.feature} +0 -0
  19. data/features/{relative_assets.feature → z_relative_assets.feature} +0 -0
  20. data/{spec/fixtures/sample → fixtures/test-app}/config.rb +0 -0
  21. data/{spec/fixtures/sample → fixtures/test-app}/public/images/blank.gif +0 -0
  22. data/{spec/fixtures/sample → fixtures/test-app}/public/static.html +0 -0
  23. data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/auto-css.css +0 -0
  24. data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/static.css +0 -0
  25. data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/sub1/auto-css.css +0 -0
  26. data/{spec/fixtures/sample → fixtures/test-app}/public/stylesheets/sub1/sub2/auto-css.css +0 -0
  27. data/{spec/fixtures/sample → fixtures/test-app}/views/_partial.haml +0 -0
  28. data/{spec/fixtures/sample → fixtures/test-app}/views/asset_host.html.haml +0 -0
  29. data/{spec/fixtures/sample → fixtures/test-app}/views/auto-css.html.haml +0 -0
  30. data/{spec/fixtures/sample → fixtures/test-app}/views/auto-image-sizes.html.haml +0 -0
  31. data/{spec/fixtures/sample → fixtures/test-app}/views/cache-buster.html.haml +0 -0
  32. data/{spec/fixtures/sample → fixtures/test-app}/views/custom-layout.html.haml +0 -0
  33. data/{spec/fixtures/sample → fixtures/test-app}/views/index.html.haml +0 -0
  34. data/{spec/fixtures/sample → fixtures/test-app}/views/inline-css.html.haml +0 -0
  35. data/{spec/fixtures/sample → fixtures/test-app}/views/inline-js.html.haml +0 -0
  36. data/fixtures/test-app/views/javascripts/coffee_test.js.coffee +3 -0
  37. data/{spec/fixtures/sample → fixtures/test-app}/views/layout.haml +0 -0
  38. data/{spec/fixtures/sample/views → fixtures/test-app/views/layouts}/custom.haml +0 -0
  39. data/fixtures/test-app/views/padrino_test.html.haml +5 -0
  40. data/{spec/fixtures/sample → fixtures/test-app}/views/page-classes.html.haml +0 -0
  41. data/{spec/fixtures/sample → fixtures/test-app}/views/services/index.html.haml +0 -0
  42. data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/asset_host.css.sass +0 -0
  43. data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/relative_assets.css.sass +0 -0
  44. data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/site.css.sass +0 -0
  45. data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/site_scss.css.scss +0 -0
  46. data/{spec/fixtures/sample → fixtures/test-app}/views/stylesheets/test_less.css.less +0 -0
  47. data/lib/middleman.rb +9 -1
  48. data/lib/middleman/features.rb +29 -36
  49. data/lib/middleman/features/asset_host.rb +16 -15
  50. data/lib/middleman/features/automatic_image_sizes.rb +26 -24
  51. data/lib/middleman/features/cache_buster.rb +34 -33
  52. data/lib/middleman/features/default_helpers.rb +26 -33
  53. data/lib/middleman/features/livereload.rb +1 -1
  54. data/lib/middleman/features/minify_css.rb +8 -7
  55. data/lib/middleman/features/minify_javascript.rb +11 -10
  56. data/lib/middleman/features/relative_assets.rb +30 -29
  57. data/lib/middleman/features/slickmap.rb +43 -42
  58. data/lib/middleman/features/smush_pngs.rb +29 -29
  59. data/lib/middleman/features/ugly_haml.rb +7 -6
  60. data/lib/middleman/renderers/{coffee.rb → coffee_script.rb} +11 -8
  61. data/lib/middleman/renderers/haml.rb +28 -33
  62. data/lib/middleman/renderers/sass.rb +30 -28
  63. data/lib/middleman/server.rb +44 -49
  64. data/lib/middleman/template/config.rbt +6 -6
  65. data/middleman.gemspec +49 -50
  66. metadata +79 -75
  67. data/lib/middleman/renderers.rb +0 -26
  68. data/spec/builder_spec.rb +0 -62
  69. data/spec/fixtures/sample/views/maruku.html.maruku +0 -1
  70. data/spec/helpers_spec.rb +0 -43
  71. data/spec/spec_helper.rb +0 -8
@@ -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
@@ -1,8 +0,0 @@
1
- ENV["MM_DIR"] = File.join(File.dirname(__FILE__), "fixtures", "sample")
2
- require File.join(File.dirname(File.dirname(__FILE__)), 'lib', 'middleman')
3
- require 'spec'
4
- require 'rack/test'
5
-
6
- Spec::Runner.configure do |config|
7
-
8
- end