middleman-more 3.0.0.alpha.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. data/Rakefile +5 -0
  2. data/features/asset_host_compass.feature +7 -0
  3. data/features/cache_buster.feature +26 -0
  4. data/features/coffee-script.feature +17 -0
  5. data/features/content_for.feature +11 -0
  6. data/features/fonts.feature +13 -0
  7. data/features/ignore_already_minified.features +12 -0
  8. data/features/liquid.feature +11 -0
  9. data/features/markdown.feature +27 -0
  10. data/features/minify_css.feature +19 -0
  11. data/features/minify_javascript.feature +55 -0
  12. data/features/relative_assets.feature +50 -0
  13. data/features/sass_partials.feature +83 -0
  14. data/features/scss-support.feature +12 -0
  15. data/features/slim.feature +7 -0
  16. data/features/sprockets.feature +52 -0
  17. data/features/sprockets_gems.feature +10 -0
  18. data/features/support/env.rb +7 -0
  19. data/fixtures/already-minified-app/config.rb +2 -0
  20. data/fixtures/already-minified-app/source/javascripts/test.min.js +10 -0
  21. data/fixtures/already-minified-app/source/stylesheets/test.min.css +10 -0
  22. data/fixtures/asset-host-app/config.rb +6 -0
  23. data/fixtures/asset-host-app/source/.htaccess +1 -0
  24. data/fixtures/asset-host-app/source/images/blank.gif +0 -0
  25. data/fixtures/asset-host-app/source/stylesheets/asset_host.css.sass +3 -0
  26. data/fixtures/cache-buster-app/config.rb +0 -0
  27. data/fixtures/cache-buster-app/source/cache-buster.html.erb +2 -0
  28. data/fixtures/cache-buster-app/source/images/blank.gif +0 -0
  29. data/fixtures/cache-buster-app/source/stylesheets/relative_assets.css.sass +3 -0
  30. data/fixtures/cache-buster-app/source/stylesheets/site.css.sass +1 -0
  31. data/fixtures/coffeescript-app/config.rb +1 -0
  32. data/fixtures/coffeescript-app/source/inline-coffeescript.html.haml +3 -0
  33. data/fixtures/coffeescript-app/source/javascripts/broken-coffee.js.coffee +3 -0
  34. data/fixtures/coffeescript-app/source/javascripts/coffee_test.js.coffee +3 -0
  35. data/fixtures/content-for-app/config.rb +6 -0
  36. data/fixtures/content-for-app/source/content_for_haml.html.haml +4 -0
  37. data/fixtures/content-for-app/source/content_for_slim.html.slim +4 -0
  38. data/fixtures/content-for-app/source/layouts/content_for.erb +4 -0
  39. data/fixtures/fonts-app/config.rb +0 -0
  40. data/fixtures/fonts-app/source/fonts/StMarie-Thin.otf +0 -0
  41. data/fixtures/fonts-app/source/stylesheets/fonts.css.sass +3 -0
  42. data/fixtures/liquid-app/config.rb +0 -0
  43. data/fixtures/liquid-app/data/test.yml +4 -0
  44. data/fixtures/liquid-app/data/test2.json +4 -0
  45. data/fixtures/liquid-app/source/_liquid_partial.liquid +1 -0
  46. data/fixtures/liquid-app/source/data2.html.liquid +2 -0
  47. data/fixtures/liquid-app/source/liquid_master.html.liquid +1 -0
  48. data/fixtures/markdown-app/config.rb +9 -0
  49. data/fixtures/markdown-app/source/autolink.html.markdown +5 -0
  50. data/fixtures/markdown-app/source/fenced_code_blocks.html.markdown +7 -0
  51. data/fixtures/markdown-app/source/index.html.markdown +4 -0
  52. data/fixtures/markdown-app/source/no_intra_emphasis.html.markdown +5 -0
  53. data/fixtures/markdown-app/source/smarty_pants.html.markdown +5 -0
  54. data/fixtures/markdown-app/source/space_after_headers.html.markdown +5 -0
  55. data/fixtures/markdown-app/source/strikethrough.html.markdown +5 -0
  56. data/fixtures/markdown-app/source/superscript.html.markdown +5 -0
  57. data/fixtures/markdown-app/source/tables.html.markdown +8 -0
  58. data/fixtures/minify-css-app/config.rb +0 -0
  59. data/fixtures/minify-css-app/source/stylesheets/site.css.sass +1 -0
  60. data/fixtures/minify-js-app/config.rb +1 -0
  61. data/fixtures/minify-js-app/source/inline-coffeescript.html.haml +3 -0
  62. data/fixtures/minify-js-app/source/inline-js.html.haml +7 -0
  63. data/fixtures/minify-js-app/source/javascripts/coffee_test.js.coffee +3 -0
  64. data/fixtures/minify-js-app/source/javascripts/js_test.js +8 -0
  65. data/fixtures/passthrough-app/config.rb +17 -0
  66. data/fixtures/passthrough-app/source/.htaccess +1 -0
  67. data/fixtures/passthrough-app/source/inline-coffeescript.html.haml +3 -0
  68. data/fixtures/passthrough-app/source/inline-css.html.haml +4 -0
  69. data/fixtures/passthrough-app/source/inline-js.html.haml +7 -0
  70. data/fixtures/passthrough-app/source/javascripts/coffee_test.js.coffee +3 -0
  71. data/fixtures/passthrough-app/source/javascripts/js_test.js +8 -0
  72. data/fixtures/passthrough-app/source/stylesheets/site.css.sass +1 -0
  73. data/fixtures/preview-app/config.rb +0 -0
  74. data/fixtures/preview-app/source/content.html.erb +1 -0
  75. data/fixtures/preview-app/source/layout.erb +1 -0
  76. data/fixtures/preview-app/source/stylesheets/_partial.sass +2 -0
  77. data/fixtures/preview-app/source/stylesheets/_partial2.css.sass +2 -0
  78. data/fixtures/preview-app/source/stylesheets/main.css.sass +4 -0
  79. data/fixtures/preview-app/source/stylesheets/main2.css.sass +4 -0
  80. data/fixtures/preview-app/source/stylesheets/plain.css.sass +2 -0
  81. data/fixtures/relative-app/config.rb +0 -0
  82. data/fixtures/relative-app/source/images/blank.gif +0 -0
  83. data/fixtures/relative-app/source/stylesheets/relative_assets.css.sass +3 -0
  84. data/fixtures/relative-assets-app/config.rb +0 -0
  85. data/fixtures/relative-assets-app/source/images/blank.gif +0 -0
  86. data/fixtures/relative-assets-app/source/img/blank.gif +0 -0
  87. data/fixtures/relative-assets-app/source/relative_image.html.erb +1 -0
  88. data/fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass +3 -0
  89. data/fixtures/scss-app/config.rb +0 -0
  90. data/fixtures/scss-app/source/stylesheets/layout.css.sass +2 -0
  91. data/fixtures/scss-app/source/stylesheets/site_scss.css.scss +1 -0
  92. data/fixtures/slim-app/config.rb +1 -0
  93. data/fixtures/slim-app/source/slim.html.slim +7 -0
  94. data/fixtures/sprockets-app/config.rb +2 -0
  95. data/fixtures/sprockets-app/source/library/css/bootstrap_include.css.scss +1 -0
  96. data/fixtures/sprockets-app/source/library/css/plain.css +3 -0
  97. data/fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss +1 -0
  98. data/fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss +1 -0
  99. data/fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss +1 -0
  100. data/fixtures/sprockets-app/source/library/js/jquery_include.js +1 -0
  101. data/fixtures/sprockets-app/source/library/js/plain.js +3 -0
  102. data/fixtures/sprockets-app/source/library/js/sprockets_base.js +5 -0
  103. data/fixtures/sprockets-app/source/library/js/sprockets_sub.js +3 -0
  104. data/fixtures/sprockets-app2/config.rb +0 -0
  105. data/fixtures/sprockets-app2/data/test.yml +4 -0
  106. data/fixtures/sprockets-app2/data/test2.json +4 -0
  107. data/fixtures/sprockets-app2/source/javascripts/multiple_engines.js.coffee.erb +1 -0
  108. data/fixtures/sprockets-app2/source/javascripts/sprockets_base.js +5 -0
  109. data/fixtures/sprockets-app2/source/javascripts/sprockets_sub.js +3 -0
  110. data/fixtures/sprockets-app2/source/stylesheets/sprockets_base1.css.scss +1 -0
  111. data/fixtures/sprockets-app2/source/stylesheets/sprockets_base2.css.scss +1 -0
  112. data/fixtures/sprockets-app2/source/stylesheets/sprockets_sub.css.scss +1 -0
  113. data/lib/middleman-more.rb +64 -0
  114. data/lib/middleman-more/core_extensions/compass.rb +75 -0
  115. data/lib/middleman-more/core_extensions/sprockets.rb +142 -0
  116. data/lib/middleman-more/extensions/cache_buster.rb +59 -0
  117. data/lib/middleman-more/extensions/minify_css.rb +17 -0
  118. data/lib/middleman-more/extensions/minify_css/cssmin.rb +55 -0
  119. data/lib/middleman-more/extensions/minify_javascript.rb +56 -0
  120. data/lib/middleman-more/extensions/relative_assets.rb +46 -0
  121. data/lib/middleman-more/renderers/haml.rb +13 -0
  122. data/lib/middleman-more/renderers/liquid.rb +21 -0
  123. data/lib/middleman-more/renderers/markdown.rb +28 -0
  124. data/lib/middleman-more/renderers/sass.rb +53 -0
  125. data/lib/middleman-more/renderers/slim.rb +15 -0
  126. data/middleman-more.gemspec +32 -0
  127. metadata +468 -0
@@ -0,0 +1,7 @@
1
+ PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
+
3
+ core_root = File.expand_path("../../../../middleman-core/lib/middleman-core", __FILE__)
4
+
5
+ require core_root
6
+ require File.join(core_root, "step_definitions")
7
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-more')
@@ -0,0 +1,2 @@
1
+ activate :minify_javascript
2
+ activate :minify_css
@@ -0,0 +1,10 @@
1
+ var numbers = [ 1,
2
+ 2,
3
+ 3,
4
+ 4,
5
+ 5,
6
+ 6,
7
+ 7,
8
+ 8,
9
+ 9,
10
+ 10 ];
@@ -0,0 +1,10 @@
1
+ body { one: 1;
2
+ two: 2;
3
+ three: 3;
4
+ four: 4;
5
+ five: 5;
6
+ six: 6;
7
+ seven: 7;
8
+ eight: 8;
9
+ nine: 9;
10
+ ten: 10; }
@@ -0,0 +1,6 @@
1
+ set :layout, false
2
+
3
+ activate :asset_host
4
+ set :asset_host do |asset|
5
+ "http://assets%d.example.com" % (asset.hash % 4)
6
+ end
@@ -0,0 +1 @@
1
+ # I'm an htaccess file!
@@ -0,0 +1,3 @@
1
+ @import "compass"
2
+ h1
3
+ background: image-url("blank.gif")
File without changes
@@ -0,0 +1,2 @@
1
+ <%= stylesheet_link_tag "site.css" %>
2
+ <%= javascript_include_tag "empty-with-include.js" %>
@@ -0,0 +1,3 @@
1
+ @import "compass"
2
+ h1
3
+ background: image-url("blank.gif")
@@ -0,0 +1 @@
1
+ @import "compass/reset"
@@ -0,0 +1 @@
1
+ require "coffee-filter"
@@ -0,0 +1,3 @@
1
+ :coffeescript
2
+ race = (winner, runners...) ->
3
+ print winner, runners
@@ -0,0 +1,3 @@
1
+ function test() {
2
+ hello
3
+ }
@@ -0,0 +1,3 @@
1
+ # Splats:
2
+ race = (winner, runners...) ->
3
+ print winner, runners
@@ -0,0 +1,6 @@
1
+ require "slim"
2
+
3
+ with_layout :content_for do
4
+ page "/content_for_haml.html"
5
+ page "/content_for_slim.html"
6
+ end
@@ -0,0 +1,4 @@
1
+ - content_for :from_template do
2
+ = "I am the yielded content haml"
3
+
4
+ %p I am in the template
@@ -0,0 +1,4 @@
1
+ - content_for :from_template do
2
+ | I am the yielded content slim
3
+
4
+ | I am in the template
@@ -0,0 +1,4 @@
1
+ In Layout: <%= yield_content(:from_template).chomp.strip %>
2
+
3
+ In Template:
4
+ <%= yield %>
File without changes
@@ -0,0 +1,3 @@
1
+ @import "compass/css3/font-face"
2
+
3
+ +font-face("St Marie", font-files("StMarie-Thin.otf", opentype))
File without changes
@@ -0,0 +1,4 @@
1
+ -
2
+ title: "One"
3
+ -
4
+ title: "Two"
@@ -0,0 +1,4 @@
1
+ [
2
+ { "title": "One" },
3
+ { "title": "Two" }
4
+ ]
@@ -0,0 +1 @@
1
+ Greetings
@@ -0,0 +1,2 @@
1
+ {{data}}
2
+ {% for item in data.test %}{{item.title}}{% endfor %}
@@ -0,0 +1 @@
1
+ {% include "liquid_partial" %}
@@ -0,0 +1,9 @@
1
+ set :markdown, :smartypants => true,
2
+ :no_intra_emphasis => true,
3
+ :tables => true,
4
+ :fenced_code_blocks => true,
5
+ :autolink => true,
6
+ :strikethrough => true,
7
+ :lax_html_blocks => true,
8
+ :space_after_headers => true,
9
+ :superscript => true
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ http://example.com
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ ~~~~~~~~~~~~~~~~~~~~~
6
+ a one-line code block
7
+ ~~~~~~~~~~~~~~~~~~~~~
@@ -0,0 +1,4 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+ Hello World
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ foo_bar_baz
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ "Hello"
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ #this is my header
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ ~~Nope~~
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ this is the 2^(nd) time
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ First Header | Second Header
6
+ ------------- | -------------
7
+ Content Cell | Content Cell
8
+ Content Cell | Content Cell
File without changes
@@ -0,0 +1 @@
1
+ @import "compass/reset"
@@ -0,0 +1 @@
1
+ require "coffee-filter"
@@ -0,0 +1,3 @@
1
+ :coffeescript
2
+ race = (winner, runners...) ->
3
+ print winner, runners
@@ -0,0 +1,7 @@
1
+ :javascript
2
+ ;(function() {
3
+ this;
4
+ should();
5
+ all.be();
6
+ on = { one: line };
7
+ })();
@@ -0,0 +1,3 @@
1
+ # Splats:
2
+ race = (winner, runners...) ->
3
+ print winner, runners
@@ -0,0 +1,8 @@
1
+ var race;
2
+ var __slice = Array.prototype.slice;
3
+
4
+ race = function() {
5
+ var runners, winner;
6
+ winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
7
+ return print(winner, runners);
8
+ };
@@ -0,0 +1,17 @@
1
+ module ::PassThrough
2
+ def self.compress(data)
3
+ data
4
+ end
5
+ end
6
+
7
+ set :js_compressor, ::PassThrough
8
+ set :css_compressor, ::PassThrough
9
+
10
+ activate :minify_javascript
11
+ activate :minify_css
12
+
13
+ with_layout false do
14
+ page "/inline-css.html"
15
+ page "/inline-js.html"
16
+ page "/inline-coffeescript.html"
17
+ end
@@ -0,0 +1 @@
1
+ # I'm an htaccess file!
@@ -0,0 +1,3 @@
1
+ :coffeescript
2
+ race = (winner, runners...) ->
3
+ print winner, runners
@@ -0,0 +1,4 @@
1
+ :sass
2
+ body
3
+ test: style
4
+ good: deal
@@ -0,0 +1,7 @@
1
+ :javascript
2
+ ;(function() {
3
+ this;
4
+ should();
5
+ all.be();
6
+ on = { one: line };
7
+ })();
@@ -0,0 +1,3 @@
1
+ # Splats:
2
+ race = (winner, runners...) ->
3
+ print winner, runners
@@ -0,0 +1,8 @@
1
+ var race;
2
+ var __slice = Array.prototype.slice;
3
+
4
+ race = function() {
5
+ var runners, winner;
6
+ winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
7
+ return print(winner, runners);
8
+ };
@@ -0,0 +1 @@
1
+ @import "compass/reset"
File without changes
@@ -0,0 +1 @@
1
+ Hola Mundo
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,2 @@
1
+ body
2
+ font-size: 18px
@@ -0,0 +1,2 @@
1
+ body
2
+ font-size: 18px
@@ -0,0 +1,4 @@
1
+ @import partial.sass
2
+
3
+ red
4
+ color: blue
@@ -0,0 +1,4 @@
1
+ //= require "_partial2.css.sass"
2
+
3
+ red
4
+ color: blue
@@ -0,0 +1,2 @@
1
+ red
2
+ color: blue
File without changes
@@ -0,0 +1,3 @@
1
+ @import "compass"
2
+ h1
3
+ background: image-url("blank.gif")
File without changes
@@ -0,0 +1 @@
1
+ <%= image_tag "blank.gif" %>
@@ -0,0 +1,3 @@
1
+ @import "compass"
2
+ h1
3
+ background: image-url("blank.gif")
File without changes
@@ -0,0 +1,2 @@
1
+ html
2
+ test: value
@@ -0,0 +1 @@
1
+ @import "compass/reset";
@@ -0,0 +1 @@
1
+ require "slim"
@@ -0,0 +1,7 @@
1
+ doctype 5
2
+ html lang='en'
3
+ head
4
+ meta charset="utf-8"
5
+
6
+ body
7
+ h1 Welcome to Slim
@@ -0,0 +1,2 @@
1
+ set :js_dir, "library/js"
2
+ set :css_dir, "library/css"
@@ -0,0 +1 @@
1
+ //= require "bootstrap.scss"
@@ -0,0 +1,3 @@
1
+ #helloWorld {
2
+ color: red;
3
+ }
@@ -0,0 +1 @@
1
+ //= require "sprockets_sub"
@@ -0,0 +1 @@
1
+ @import "sprockets_sub";