middleman 0.5.5 → 0.9.0.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 (147) hide show
  1. data/.document +1 -2
  2. data/.gitignore +3 -2
  3. data/LICENSE +0 -0
  4. data/README.rdoc +4 -0
  5. data/Rakefile +28 -36
  6. data/VERSION +1 -1
  7. data/bin/mm-build +7 -113
  8. data/bin/mm-init +11 -5
  9. data/bin/mm-server +56 -3
  10. data/features/asset_host.feature +12 -0
  11. data/features/automatic_image_sizes.feature +14 -0
  12. data/features/cache_buster.feature +22 -0
  13. data/features/generator.feature +8 -0
  14. data/features/minify_css.feature +22 -0
  15. data/features/minify_javascript.feature +12 -0
  16. data/features/page_alias_and_layouts.feature +12 -0
  17. data/features/relative_assets.feature +12 -0
  18. data/features/step_definitions/asset_host_steps.rb +7 -0
  19. data/features/step_definitions/env.rb +3 -0
  20. data/features/step_definitions/generator_steps.rb +24 -0
  21. data/features/step_definitions/middleman_steps.rb +28 -0
  22. data/features/step_definitions/page_layout_steps.rb +13 -0
  23. data/lib/middleman.rb +6 -132
  24. data/lib/middleman/assets.rb +33 -0
  25. data/lib/middleman/base.rb +147 -0
  26. data/lib/middleman/builder.rb +59 -0
  27. data/lib/middleman/config.ru +2 -0
  28. data/lib/middleman/features.rb +39 -0
  29. data/lib/middleman/features/asset_host.rb +21 -0
  30. data/lib/middleman/features/automatic_image_sizes.rb +31 -0
  31. data/lib/middleman/features/automatic_image_sizes/fastimage.rb +282 -0
  32. data/lib/middleman/features/cache_buster.rb +43 -0
  33. data/lib/middleman/features/default_helpers.rb +68 -0
  34. data/lib/middleman/features/livereload.rb +19 -0
  35. data/lib/middleman/features/minify_css.rb +9 -0
  36. data/lib/middleman/features/minify_javascript.rb +20 -0
  37. data/lib/middleman/features/minify_javascript/rack.rb +31 -0
  38. data/lib/middleman/features/relative_assets.rb +35 -0
  39. data/lib/middleman/features/slickmap.rb +118 -0
  40. data/lib/middleman/features/smush_pngs.rb +38 -0
  41. data/lib/middleman/features/ugly_haml.rb +7 -0
  42. data/lib/middleman/renderers.rb +26 -0
  43. data/lib/middleman/renderers/coffee.rb +28 -0
  44. data/lib/middleman/renderers/haml.rb +47 -0
  45. data/lib/middleman/renderers/sass.rb +67 -0
  46. data/lib/middleman/template/init.rbt +57 -0
  47. data/lib/middleman/template/views/index.html.haml +4 -0
  48. data/lib/middleman/template/views/layout.haml +11 -4
  49. data/lib/middleman/template/views/stylesheets/site.css.sass +27 -0
  50. data/lib/middleman/templater+dynamic_renderer.rb +26 -0
  51. data/middleman.gemspec +121 -107
  52. data/spec/builder_spec.rb +17 -16
  53. data/spec/fixtures/sample/init.rb +28 -2
  54. data/spec/fixtures/sample/public/images/blank.gif +0 -0
  55. data/spec/fixtures/sample/public/static.html +0 -0
  56. data/{vendor/sinatra-maruku/examples/public/javascripts/application.js → spec/fixtures/sample/public/stylesheets/auto-css.css} +0 -0
  57. data/spec/fixtures/sample/public/stylesheets/static.css +0 -0
  58. data/{vendor/sinatra-maruku/examples/public/stylesheets/print.css → spec/fixtures/sample/public/stylesheets/sub1/auto-css.css} +0 -0
  59. data/spec/fixtures/sample/public/stylesheets/sub1/sub2/auto-css.css +0 -0
  60. data/spec/fixtures/sample/views/_partial.haml +0 -0
  61. data/spec/fixtures/sample/views/asset_host.html.haml +1 -0
  62. data/spec/fixtures/sample/views/auto-css.html.haml +1 -0
  63. data/spec/fixtures/sample/views/auto-image-sizes.html.haml +1 -0
  64. data/spec/fixtures/sample/views/cache-buster.html.haml +2 -0
  65. data/spec/fixtures/sample/views/{index.haml → custom-layout.html.haml} +0 -0
  66. data/spec/fixtures/sample/views/custom.haml +5 -0
  67. data/spec/fixtures/sample/views/index.html.haml +1 -0
  68. data/spec/fixtures/sample/views/inline-css.html.haml +4 -0
  69. data/spec/fixtures/sample/views/{inline-js.haml → inline-js.html.haml} +0 -0
  70. data/spec/fixtures/sample/views/layout.haml +1 -1
  71. data/spec/fixtures/sample/views/{maruku.maruku → maruku.html.maruku} +0 -0
  72. data/spec/fixtures/sample/views/page-classes.html.haml +1 -0
  73. data/spec/fixtures/sample/views/services/{index.haml → index.html.haml} +0 -0
  74. data/spec/fixtures/sample/views/stylesheets/asset_host.css.sass +3 -0
  75. data/spec/fixtures/sample/views/stylesheets/relative_assets.css.sass +3 -0
  76. data/spec/fixtures/sample/views/stylesheets/site.css.sass +1 -0
  77. data/spec/fixtures/sample/views/stylesheets/site_scss.css.scss +1 -0
  78. data/spec/fixtures/sample/views/stylesheets/test_less.css.less +5 -0
  79. data/spec/helpers_spec.rb +43 -0
  80. data/spec/spec_helper.rb +3 -5
  81. metadata +298 -127
  82. data/lib/middleman/helpers.rb +0 -131
  83. data/lib/middleman/markaby.rb +0 -4
  84. data/lib/middleman/maruku.rb +0 -4
  85. data/lib/middleman/sprockets_ext.rb +0 -29
  86. data/lib/middleman/template/init.rb +0 -22
  87. data/lib/middleman/template/views/index.haml +0 -1
  88. data/lib/middleman/template/views/stylesheets/site.sass +0 -1
  89. data/spec/fixtures/sample/views/markaby.mab +0 -5
  90. data/spec/fixtures/sample/views/stylesheets/site.sass +0 -1
  91. data/spec/generator_spec.rb +0 -34
  92. data/vendor/rack-test/History.txt +0 -64
  93. data/vendor/rack-test/MIT-LICENSE.txt +0 -19
  94. data/vendor/rack-test/README.rdoc +0 -57
  95. data/vendor/rack-test/Rakefile +0 -62
  96. data/vendor/rack-test/lib/rack/mock_session.rb +0 -57
  97. data/vendor/rack-test/lib/rack/test.rb +0 -246
  98. data/vendor/rack-test/lib/rack/test/cookie_jar.rb +0 -169
  99. data/vendor/rack-test/lib/rack/test/methods.rb +0 -73
  100. data/vendor/rack-test/lib/rack/test/mock_digest_request.rb +0 -27
  101. data/vendor/rack-test/lib/rack/test/uploaded_file.rb +0 -36
  102. data/vendor/rack-test/lib/rack/test/utils.rb +0 -75
  103. data/vendor/rack-test/spec/fixtures/config.ru +0 -3
  104. data/vendor/rack-test/spec/fixtures/fake_app.rb +0 -109
  105. data/vendor/rack-test/spec/fixtures/foo.txt +0 -1
  106. data/vendor/rack-test/spec/rack/test/cookie_spec.rb +0 -176
  107. data/vendor/rack-test/spec/rack/test/digest_auth_spec.rb +0 -48
  108. data/vendor/rack-test/spec/rack/test/multipart_spec.rb +0 -85
  109. data/vendor/rack-test/spec/rack/test/utils_spec.rb +0 -44
  110. data/vendor/rack-test/spec/rack/test_spec.rb +0 -363
  111. data/vendor/rack-test/spec/rcov.opts +0 -1
  112. data/vendor/rack-test/spec/spec.opts +0 -1
  113. data/vendor/rack-test/spec/spec_helper.rb +0 -48
  114. data/vendor/sinatra-content-for/LICENSE +0 -22
  115. data/vendor/sinatra-content-for/README.rdoc +0 -49
  116. data/vendor/sinatra-content-for/Rakefile +0 -33
  117. data/vendor/sinatra-content-for/lib/sinatra/content_for.rb +0 -58
  118. data/vendor/sinatra-content-for/sinatra-content-for.gemspec +0 -34
  119. data/vendor/sinatra-content-for/test/content_for_test.rb +0 -156
  120. data/vendor/sinatra-markaby/CHANGES +0 -7
  121. data/vendor/sinatra-markaby/LICENSE +0 -20
  122. data/vendor/sinatra-markaby/README.rdoc +0 -33
  123. data/vendor/sinatra-markaby/Rakefile +0 -45
  124. data/vendor/sinatra-markaby/TODO +0 -3
  125. data/vendor/sinatra-markaby/VERSION.yml +0 -4
  126. data/vendor/sinatra-markaby/lib/sinatra/markaby.rb +0 -31
  127. data/vendor/sinatra-markaby/sinatra-markaby.gemspec +0 -49
  128. data/vendor/sinatra-markaby/test/sinatra_markaby_test.rb +0 -72
  129. data/vendor/sinatra-markaby/test/test_helper.rb +0 -19
  130. data/vendor/sinatra-markaby/test/views/hello.mab +0 -1
  131. data/vendor/sinatra-markaby/test/views/html.mab +0 -4
  132. data/vendor/sinatra-maruku/LICENSE +0 -22
  133. data/vendor/sinatra-maruku/README.markdown +0 -85
  134. data/vendor/sinatra-maruku/Rakefile +0 -34
  135. data/vendor/sinatra-maruku/VERSION.yml +0 -4
  136. data/vendor/sinatra-maruku/examples/app.rb +0 -8
  137. data/vendor/sinatra-maruku/examples/config.ru +0 -4
  138. data/vendor/sinatra-maruku/examples/mapp.rb +0 -15
  139. data/vendor/sinatra-maruku/examples/public/stylesheets/application.css +0 -23
  140. data/vendor/sinatra-maruku/examples/views/index.maruku +0 -32
  141. data/vendor/sinatra-maruku/examples/views/layout.maruku +0 -9
  142. data/vendor/sinatra-maruku/lib/sinatra/maruku.rb +0 -25
  143. data/vendor/sinatra-maruku/sinatra-maruku.gemspec +0 -70
  144. data/vendor/sinatra-maruku/test/sinatra_maruku_test.rb +0 -91
  145. data/vendor/sinatra-maruku/test/test_helper.rb +0 -21
  146. data/vendor/sinatra-maruku/test/views/hello.maruku +0 -1
  147. data/vendor/sinatra-maruku/test/views/layout2.maruku +0 -2
data/.document CHANGED
@@ -2,5 +2,4 @@ README.rdoc
2
2
  lib/**/*.rb
3
3
  bin/*
4
4
  features/**/*.feature
5
- LICENSE
6
- vendor/**/*
5
+ LICENSE
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
- *.sw?
2
1
  .DS_Store
3
2
  coverage
4
3
  rdoc
5
4
  pkg
6
- .sass-cache
5
+ .sass-cache
6
+ .sassc
7
+ .tmp
data/LICENSE CHANGED
File without changes
@@ -2,6 +2,10 @@
2
2
 
3
3
  The Middleman is ever-vigilant against tag-soup, unreadable CSS and repetition. He stands-watch over your Haml and Sass producing only the cleanest and efficient markup.
4
4
 
5
+ == Getting Started
6
+
7
+ Everything you need to know is on the wiki: http://wiki.github.com/tdreyno/middleman
8
+
5
9
  == Copyright
6
10
 
7
11
  Copyright (c) 2009 Thomas Reynolds. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,60 +1,52 @@
1
- require 'rubygems'
1
+ require 'lib/middleman'
2
2
  require 'rake'
3
+ require 'spec/rake/spectask'
4
+ require 'cucumber/rake/task'
3
5
 
4
6
  begin
5
7
  require 'jeweler'
6
8
  Jeweler::Tasks.new do |gem|
7
9
  gem.name = "middleman"
8
- gem.summary = %Q{A static site generator utilizing Haml and Sass}
10
+ gem.summary = %Q{A static site generator utilizing Haml, Sass and providing YUI compression and cache busting}
9
11
  gem.email = "tdreyno@gmail.com"
10
- gem.homepage = "http://github.com/tdreyno/middleman"
12
+ gem.homepage = "http://wiki.github.com/tdreyno/middleman"
11
13
  gem.authors = ["Thomas Reynolds"]
12
14
  gem.rubyforge_project = "middleman"
13
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
15
  gem.executables = %w(mm-init mm-build mm-server)
15
- gem.add_dependency("templater")
16
- gem.add_dependency("yui-compressor")
17
- gem.add_dependency("sprockets")
18
- gem.add_dependency("sinatra")
19
- gem.add_dependency("markaby")
20
- gem.add_dependency("maruku")
21
- gem.add_dependency("haml", ">=2.1.0")
22
- gem.add_dependency("chriseppstein-compass")
16
+ gem.add_dependency("rack", "~>1.0")
17
+ gem.add_dependency("thin", "~>1.2.0")
18
+ gem.add_dependency("shotgun", "~>0.8.0")
19
+ gem.add_dependency("templater", "~>1.0.0")
20
+ gem.add_dependency("sinatra", "~>1.0")
21
+ gem.add_dependency("sinatra-content-for", "~>0.2.0")
22
+ gem.add_dependency("rack-test", "~>0.5.0")
23
+ gem.add_dependency("yui-compressor", "~>0.9.0")
24
+ gem.add_dependency("haml", "~>3.0")
25
+ gem.add_dependency("compass", "~>0.10.0")
26
+ gem.add_dependency("json_pure", "~>1.4.0")
27
+ gem.add_dependency("smusher", "~>0.4.5")
28
+ gem.add_dependency("compass-slickmap", "~>0.3.0")
29
+ # gem.add_dependency("livereload", "~>1.4.0")
30
+
31
+ gem.add_development_dependency("rspec")
32
+ gem.add_development_dependency("cucumber")
33
+ gem.add_development_dependency("jeweler")
23
34
  end
24
35
 
25
- Jeweler::RubyforgeTasks.new do |rubyforge|
26
- rubyforge.doc_task = "rdoc"
27
- end
36
+ Jeweler::GemcutterTasks.new
28
37
  rescue LoadError
29
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
38
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
30
39
  end
31
40
 
32
- require 'spec/rake/spectask'
33
41
  Spec::Rake::SpecTask.new(:spec) do |spec|
34
42
  spec.libs << 'lib' << 'spec'
35
43
  spec.spec_files = FileList['spec/**/*_spec.rb']
36
44
  end
37
45
 
38
- Spec::Rake::SpecTask.new(:rcov) do |spec|
39
- spec.libs << 'lib' << 'spec'
40
- spec.pattern = 'spec/**/*_spec.rb'
41
- spec.rcov = true
46
+ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
47
+ t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
42
48
  end
43
49
 
44
50
  task :spec => :check_dependencies
45
51
 
46
- task :default => :spec
47
-
48
- require 'rake/rdoctask'
49
- Rake::RDocTask.new do |rdoc|
50
- if File.exist?('VERSION')
51
- version = File.read('VERSION')
52
- else
53
- version = ""
54
- end
55
-
56
- rdoc.rdoc_dir = 'rdoc'
57
- rdoc.title = "middleman #{version}"
58
- rdoc.rdoc_files.include('README*')
59
- rdoc.rdoc_files.include('lib/**/*.rb')
60
- end
52
+ task :default => [:cucumber, :spec]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.5
1
+ 0.9.0.pre
@@ -1,118 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Require app
4
- require 'templater'
5
-
6
- MIDDLEMAN_BUILDER = true
7
- require File.join(File.dirname(__FILE__), '..', 'lib', 'middleman')
8
- require File.join(File.dirname(__FILE__), '..', 'vendor', 'rack-test', 'lib', 'rack', 'test')
9
-
10
- module Generators
11
- extend Templater::Manifold
12
- desc "Build a staticmatic site"
13
-
14
- class Builder < Templater::Generator
15
- # Define source and desintation
16
- def self.source_root; Dir.pwd; end
17
- def destination_root; File.join(Dir.pwd, 'build'); end
18
-
19
- # Override template to ask middleman for the correct extension to output
20
- def self.template(name, *args, &block)
21
- return if args.first.include?('layout')
22
- args.first.split('/').each do |part|
23
- return if part[0,1] == '_'
24
- end
25
-
26
- if (args[0] === args[1])
27
- file_name_parts = File.basename(args.first).split('.')
28
-
29
- if file_name_parts.length > 2
30
- # static ext embedded in filename
31
- newext = ""
32
- else
33
- # use defaults
34
- newext = case file_name_parts.last
35
- when 'haml', 'erb', 'mab', 'maruku'
36
- '.html'
37
- when 'sass'
38
- '.css'
39
- end
40
- end
41
-
42
- args[1] = args[0].gsub(".#{file_name_parts.last}", newext).gsub('views/', '')
43
- end
44
-
45
- super(name, *args, &block)
46
- end
47
-
48
- def self.file(name, *args, &block)
49
- args[1] = args[0].gsub('views/', '') if (args[0] === args[1])
50
- super(name, *args, &block)
51
- end
52
-
53
- public_files_glob = File.join(source_root, "public", '**/*')
54
- Dir[public_files_glob].each do |action|
55
- next if File.directory?(action)
56
- action = action.sub("#{source_root}/", '')
57
- template_sym = action.downcase.gsub(/[^a-z0-9]+/, '_').to_sym
58
-
59
- if File.extname(action) == '.js' && !action.include?('min')
60
- template(template_sym, action, action.gsub('public/', ''))
61
- else
62
- file(template_sym, action, action.gsub('public/', ''))
63
- end
64
- end
3
+ ENV['MM_ENV'] = "build"
65
4
 
66
- glob! "views", (Middleman.supported_formats << "sass")
67
- end
68
-
69
- add :build, Builder
70
- end
71
-
72
- class BuildConfig
73
- def self.render(source, destination)
74
- renderer.render(source, destination)
75
- end
76
-
77
- def self.renderer
78
- @@renderer ||= BuildRenderer
79
- end
80
-
81
- def self.renderer=(val)
82
- @@renderer = val
83
- end
84
- end
85
-
86
- # Monkey-patch to use a dynamic renderer
87
- class Templater::Actions::Template
88
- def render
89
- BuildConfig.render(source, destination)
90
- end
91
- end
92
-
93
- # Default render through middleman
94
- class BuildRenderer
95
- def self.render(source, destination)
96
- request_path = destination.gsub(File.join(Dir.pwd, 'build'), "")
97
- browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman))
98
- browser.get(request_path)
99
- browser.last_response.body
100
- end
101
- end
5
+ # Require app
6
+ require File.join(File.dirname(__FILE__), "..", "lib", "middleman")
7
+ require 'middleman/builder'
102
8
 
103
- class SprocketsRenderer < BuildRenderer
104
- def self.render(source, destination)
105
- if File.extname(source) == '.js'
106
- secretary = Sprockets::Secretary.new( :asset_root => "public",
107
- :load_path => ["public/assets/javascripts/**/*.js"],
108
- :source_files => [source] )
109
- compressor = YUI::JavaScriptCompressor.new(:munge => true)
110
- compressor.compress(secretary.concatenation.to_s)
111
- else
112
- super
113
- end
114
- end
115
- end
116
- BuildConfig.renderer = SprocketsRenderer
9
+ # Middleman::Base.init!
10
+ Middleman::Builder.init!
117
11
 
118
- Generators.run_cli(Dir.pwd, 'mm-build', 1, %w(build --force).concat(ARGV))
12
+ Middleman::Generators.run_cli(Dir.pwd, 'mm-build', 1, %w(build --force).concat(ARGV))
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ require File.join(File.dirname(File.dirname(__FILE__)), 'lib', 'middleman')
2
3
  require 'templater'
3
4
 
4
5
  module Generators
@@ -6,8 +7,12 @@ module Generators
6
7
  desc "Generator for streamlining staticmatic"
7
8
 
8
9
  class NewSite < Templater::Generator
9
- desc "Creates a new staticmatic scaffold."
10
+ desc "Creates a new middleman scaffold."
10
11
  first_argument :location, :required => true, :desc => "Project location"
12
+
13
+ option :css_dir, :desc => 'The path to the css files'
14
+ option :js_dir, :desc => 'The path to the javascript files'
15
+ option :images_dir, :desc => 'The path to the image files'
11
16
 
12
17
  def destination_root
13
18
  File.expand_path(location)
@@ -17,12 +22,13 @@ module Generators
17
22
  File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'template')
18
23
  end
19
24
 
20
- file :init, "init.rb"
25
+ template :init, "init.rb"
21
26
  glob! :views
22
27
  glob! :public
23
- empty_directory :stylesheets, "public/stylesheets"
24
- empty_directory :javascripts, "public/javascripts"
25
- empty_directory :images, "public/images"
28
+
29
+ empty_directory :stylesheets, "public/stylesheets"#, File.join("public", css_dir)
30
+ empty_directory :javascripts, "public/javascripts"#, File.join("public", js_dir)
31
+ empty_directory :images, "public/images"#, File.join("public", images_dir)
26
32
  end
27
33
 
28
34
  add :setup, NewSite
@@ -1,8 +1,61 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # Non-blocking site rebuilding
4
+ trap("TSTP") do
5
+ fork do
6
+ require "open3"
7
+ first_run = true
8
+ Open3.popen3(%Q{cd "#{Dir.pwd}" && #{File.join(File.dirname(__FILE__), "mm-build")} | grep FORCED}) do |stdin, stdout, stderr|
9
+ puts "\n== Building the site..."
10
+ stdout.readlines.each do |l|
11
+ puts "== Updated:" if first_run
12
+ puts " " + l.split("[FORCED]").last.chomp
13
+ first_run = false
14
+ end
15
+ puts "== Build complete"
16
+ end
17
+ end
18
+ end
19
+
20
+ require 'optparse'
21
+
3
22
  # Require Middleman
4
23
  require File.join(File.dirname(__FILE__), '..', 'lib', 'middleman')
5
24
 
6
- # Start Middleman
7
- Middleman.set :server, %w[thin webrick]
8
- Middleman.run!(:root => Dir.pwd)
25
+ env = ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development'
26
+ options = { :Port => 4567, :AccessLog => [] }
27
+
28
+ OptionParser.new { |opts|
29
+ opts.banner = "Usage: mm-server [rack options]"
30
+ opts.separator ""
31
+ opts.separator "Rack options:"
32
+ opts.on("-p", "--port PORT", "use PORT (default: 4567)") { |port|
33
+ options[:Port] = port
34
+ }
35
+ opts.on("-E", "--env ENVIRONMENT", "use ENVIRONMENT for defaults (default: development)") { |e|
36
+ env = e
37
+ }
38
+ opts.on("--debug", "Debug mode") {
39
+ ::Middleman::Base.set :logging, true
40
+ }
41
+
42
+ opts.parse! ARGV
43
+ }
44
+
45
+ ENV['RACK_ENV'] = env
46
+
47
+ class Middleman::Base
48
+ set :root, Dir.pwd
49
+ end
50
+
51
+ require 'shotgun'
52
+ config = File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'config.ru')
53
+ app = Shotgun.new(config, &lambda { |inner_app| Middleman::Base })
54
+
55
+ require 'rubygems'
56
+ require 'thin'
57
+ Thin::Logging.silent = true
58
+
59
+ Rack::Handler::Thin.run app, options do |inst|
60
+ puts "== The Middleman is standing watch on port #{options[:Port]}"
61
+ end
@@ -0,0 +1,12 @@
1
+ Feature: Alternate between multiple asset hosts
2
+ In order to speed up page loading
3
+
4
+ Scenario: Rendering css with the feature enabled
5
+ Given I am using an asset host
6
+ When I go to "/stylesheets/asset_host.css"
7
+ Then I should see "http://assets"
8
+
9
+ Scenario: Rendering html with the feature enabled
10
+ Given I am using an asset host
11
+ When I go to "/asset_host.html"
12
+ Then I should see "http://assets"
@@ -0,0 +1,14 @@
1
+ Feature: Automatically detect and insert image dimensions into tags
2
+ In order to speed up development and appease YSlow
3
+
4
+ Scenario: Rendering an image with the feature disabled
5
+ Given "automatic_image_sizes" feature is "disabled"
6
+ When I go to "/auto-image-sizes.html"
7
+ Then I should not see "width="
8
+ And I should not see "height="
9
+
10
+ Scenario: Rendering an image with the feature enabled
11
+ Given "automatic_image_sizes" feature is "enabled"
12
+ When I go to "/auto-image-sizes.html"
13
+ Then I should see "width="
14
+ And I should see "height="
@@ -0,0 +1,22 @@
1
+ Feature: Generate mtime-based query string for busting browser caches
2
+ In order to display the most recent content for IE & CDNs and appease YSlow
3
+
4
+ Scenario: Rendering css with the feature disabled
5
+ Given "cache_buster" feature is "disabled"
6
+ When I go to "/stylesheets/relative_assets.css"
7
+ Then I should not see "?"
8
+
9
+ Scenario: Rendering html with the feature disabled
10
+ Given "cache_buster" feature is "disabled"
11
+ When I go to "/cache-buster.html"
12
+ Then I should not see "?"
13
+
14
+ Scenario: Rendering css with the feature enabled
15
+ Given "cache_buster" feature is "enabled"
16
+ When I go to "/stylesheets/relative_assets.css"
17
+ Then I should see "?"
18
+
19
+ Scenario: Rendering html with the feature enabled
20
+ Given "cache_buster" feature is "enabled"
21
+ When I go to "/cache-buster.html"
22
+ Then I should not see "?"
@@ -0,0 +1,8 @@
1
+ Feature: Generator
2
+ In order to generate static assets for client
3
+
4
+ Scenario: Copying template files
5
+ Given generated directory at "generator-test"
6
+ Then template files should exist at "generator-test"
7
+ And empty directories should exist at "generator-test"
8
+ And cleanup at "generator-test"
@@ -0,0 +1,22 @@
1
+ Feature: Minify CSS
2
+ In order reduce bytes sent to client and appease YSlow
3
+
4
+ Scenario: Rendering inline css with the feature disabled
5
+ Given "minify_css" feature is "disabled"
6
+ When I go to "/inline-css.html"
7
+ Then I should see "4" lines
8
+
9
+ Scenario: Rendering external css with the feature disabled
10
+ Given "minify_css" feature is "disabled"
11
+ When I go to "/stylesheets/site.css"
12
+ Then I should see "51" lines
13
+
14
+ Scenario: Rendering inline css with the feature enabled
15
+ Given "minify_css" feature is "enabled"
16
+ When I go to "/inline-css.html"
17
+ Then I should see "1" lines
18
+
19
+ Scenario: Rendering external css with the feature enabled
20
+ Given "minify_css" feature is "enabled"
21
+ When I go to "/stylesheets/site.css"
22
+ Then I should see "1" lines
@@ -0,0 +1,12 @@
1
+ Feature: Minify Javascript
2
+ In order reduce bytes sent to client and appease YSlow
3
+
4
+ Scenario: Rendering inline js with the feature disabled
5
+ Given "minify_javascript" feature is "disabled"
6
+ When I go to "/inline-js.html"
7
+ Then I should see "10" lines
8
+
9
+ Scenario: Rendering inline js with the feature enabled
10
+ Given "minify_javascript" feature is "enabled"
11
+ When I go to "/inline-js.html"
12
+ Then I should see "1" lines