Merge remote-tracking branch 'origin/3.0-stable'

Conflicts:
	.travis.yml
	Gemfile
	middleman-core/lib/middleman-core/version.rb
	middleman-core/middleman-core-x86-mingw32.gemspec
	middleman-core/middleman-core.gemspec
This commit is contained in:
Ben Hollis 2013-03-02 22:32:03 -08:00
commit 4745418200
14 changed files with 85 additions and 69 deletions

View file

@ -17,3 +17,4 @@ matrix:
allow_failures: allow_failures:
- rvm: jruby-18mode - rvm: jruby-18mode
- rvm: jruby-19mode - rvm: jruby-19mode

View file

@ -1,6 +1,27 @@
Master 3.0.12
=== ===
* Update to listen 0.7.x. No longer depend on rb-inotify. *nix users should add to Gemfile.
* Support Haml 4
* :debug_assets can no longer be turned on in the build environment.
* Helpers now work with JS/CSS files with .erb processing.
* Provide an informative exception when link_to is used improperly.
* Force .svgz files to be treated as binary.
* Add a url_for method that performs the link_to magic URL generation without a link. Make form_for use url_for. #739
* Fix issues when combining relative assets and cache buster.
* Support the .yaml extension for data files.
* Handle non-english default languages in i18n. Fixes #584. #771
* Allow frontmatter to be parsed on templates outside the project root
* Improve detection of binary files. #763
* Add before_render and after_render hooks that can be used by extensions to modify templates before they're rendered or modify the rendered output before it's returned. #761 & #774
* Tightened up dependencies
* Print the command for running middleman in verbose mode with quotes so Bundler doesn't swallow the verbose flag. #750
3.0.11
====
* Mitigate major perf regression caused by the Middleman::Util#binary? method
3.0.10 3.0.10
==== ====

16
Gemfile
View file

@ -1,4 +1,7 @@
source 'https://rubygems.org' source 'http://rubygems.org'
# Make sure to use Haml 4 for tests
gem "haml", "~> 4.0.0"
# Build and doc tools # Build and doc tools
gem "rake", "~> 10.0.3" gem "rake", "~> 10.0.3"
@ -12,15 +15,14 @@ gem "rspec", "~> 2.12"
# Optional middleman dependencies, included for tests # Optional middleman dependencies, included for tests
gem "sinatra" gem "sinatra"
gem "slim", "~> 1.2.0" gem "slim", :require => false
gem "coffee-filter", "~> 0.1.1" gem "liquid", "~> 2.2", :require => false
gem "liquid", "~> 2.2" gem "less", "~> 2.2", :require => false
gem "less", "~> 2.2" gem "stylus", :require => false
gem "stylus", "~> 0.6.2"
platforms :ruby do platforms :ruby do
gem "therubyracer", "0.10.2" gem "therubyracer", "0.10.2"
gem "redcarpet", "~> 2.1.1" gem "redcarpet"
end end
platforms :jruby do platforms :jruby do

View file

@ -11,25 +11,29 @@ module Middleman
class << self class << self
# Once registered # Once registered
def registered(app) def registered(app)
app.before_configuration do
template_extensions :coffee => :js
end
# Tell Tilt to use it as well (for inline scss blocks) # Tell Tilt to use it as well (for inline scss blocks)
::Tilt.register 'coffee', DebuggingCoffeeScriptTemplate ::Tilt.register 'coffee', DebuggingCoffeeScriptTemplate
::Tilt.prefer(DebuggingCoffeeScriptTemplate) ::Tilt.prefer(DebuggingCoffeeScriptTemplate)
app.before_configuration do
template_extensions :coffee => :js
DebuggingCoffeeScriptTemplate.middleman_app = self
end
end end
alias :included :registered alias :included :registered
end end
# A Template for Tilt which outputs debug messages # A Template for Tilt which outputs debug messages
class DebuggingCoffeeScriptTemplate < ::Tilt::CoffeeScriptTemplate class DebuggingCoffeeScriptTemplate < ::Tilt::CoffeeScriptTemplate
# Make the current Middleman app accessible to the template
cattr_accessor :middleman_app
# Add exception messaging # Add exception messaging
# @param [Class] context # @param [Class] context
# @param [Hash] locals # @param [Hash] locals
# @return [String] # @return [String]
def evaluate(context, locals, &block) def evaluate(context, locals, &block)
return super if context.build? return super if middleman_app.build?
begin begin
super super

View file

@ -1,4 +1,6 @@
source :rubygems # If you have OpenSSL installed, we recommend updating
# the following line to use "https"
source 'http://rubygems.org'
# Specify your gem's dependencies in <%= name %>.gemspec # Specify your gem's dependencies in <%= name %>.gemspec
gemspec gemspec

View file

@ -1,3 +1,5 @@
source :rubygems # If you have OpenSSL installed, we recommend updating
# the following line to use "https"
source 'http://rubygems.org'
gem "middleman", "~><%= Middleman::VERSION %>" gem "middleman", "~><%= Middleman::VERSION %>"

View file

@ -32,5 +32,7 @@ Gem::Specification.new do |s|
s.add_dependency("activesupport", ["~> 3.2.6"]) s.add_dependency("activesupport", ["~> 3.2.6"])
# Watcher # Watcher
s.add_dependency("listen", ["~> 0.5.2"]) s.add_dependency("listen", ["~> 0.7.3"])
s.add_dependency("rb-fsevent", ["~> 0.9.3"]) # OS X
# s.add_dependency("rb-inotify", ["~> 0.9.0"]) # Linux
end end

View file

@ -53,13 +53,11 @@ Feature: Minify CSS
When I go to "/inline-css.html" When I go to "/inline-css.html"
Then I should see: Then I should see:
""" """
<style type='text/css'> <style>
/*<![CDATA[*/ body {
body { test: style;
test: style; good: deal;
good: deal; }
}
/*]]>*/
</style> </style>
""" """
@ -83,7 +81,7 @@ Feature: Minify CSS
When I go to "/inline-css.html" When I go to "/inline-css.html"
Then I should see: Then I should see:
""" """
<style type='text/css'> <style>
body { body {
test: style; test: style;
good: deal; } good: deal; }
@ -108,7 +106,7 @@ Feature: Minify CSS
When I go to "/inline-css.html" When I go to "/inline-css.html"
Then I should see: Then I should see:
""" """
<style type='text/css'> <style>
Hello Hello
</style> </style>
""" """
@ -123,9 +121,7 @@ Feature: Minify CSS
When I go to "/inline-css.html" When I go to "/inline-css.html"
Then I should see: Then I should see:
""" """
<style type='text/css'> <style>
/*<![CDATA[*/ body{test:style;good:deal}
body{test:style;good:deal}
/*]]>*/
</style> </style>
""" """

View file

@ -10,15 +10,13 @@ Feature: Minify Javascript
When I go to "/inline-js.html" When I go to "/inline-js.html"
Then I should see: Then I should see:
""" """
<script type='text/javascript'> <script>
//<![CDATA[ ;(function() {
;(function() { this;
this; should();
should(); all.be();
all.be(); on = { one: line };
on = { one: line }; })();
})();
//]]>
</script> </script>
<script> <script>
;(function() { ;(function() {
@ -61,15 +59,13 @@ Feature: Minify Javascript
When I go to "/inline-js.html" When I go to "/inline-js.html"
Then I should see: Then I should see:
""" """
<script type='text/javascript'> <script>
//<![CDATA[ ;(function() {
;(function() { this;
this; should();
should(); all.be();
all.be(); on = { one: line };
on = { one: line }; })();
})();
//]]>
</script> </script>
<script> <script>
;(function() { ;(function() {
@ -110,10 +106,8 @@ Feature: Minify Javascript
When I go to "/inline-js.html" When I go to "/inline-js.html"
Then I should see: Then I should see:
""" """
<script type='text/javascript'> <script>
//<![CDATA[ Hello
Hello
//]]>
</script> </script>
<script> <script>
Hello Hello
@ -138,10 +132,8 @@ Feature: Minify Javascript
When I go to "/inline-js.html" When I go to "/inline-js.html"
Then I should see: Then I should see:
""" """
<script type='text/javascript'> <script>
//<![CDATA[ (function(){this,should(),all.be(),on={one:line}})();
(function(){this,should(),all.be(),on={one:line}})();
//]]>
</script> </script>
<script> <script>
(function(){this,should(),too()})(); (function(){this,should(),too()})();
@ -177,12 +169,11 @@ Feature: Minify Javascript
Given a fixture app "minify-js-app" Given a fixture app "minify-js-app"
And a file named "config.rb" with: And a file named "config.rb" with:
""" """
require "coffee-filter"
activate :minify_javascript, :inline => true activate :minify_javascript, :inline => true
""" """
And the Server is running at "minify-js-app" And the Server is running at "minify-js-app"
When I go to "/inline-coffeescript.html" When I go to "/inline-coffeescript.html"
Then I should see "6" lines Then I should see "3" lines
Scenario: Rendering external js (coffeescript) with the feature enabled Scenario: Rendering external js (coffeescript) with the feature enabled
Given a fixture app "minify-js-app" Given a fixture app "minify-js-app"
@ -198,8 +189,6 @@ Feature: Minify Javascript
Given a fixture app "passthrough-app" Given a fixture app "passthrough-app"
And a file named "config.rb" with: And a file named "config.rb" with:
""" """
require "coffee-filter"
module ::PassThrough module ::PassThrough
def self.compress(data) def self.compress(data)
data data
@ -214,7 +203,7 @@ Feature: Minify Javascript
""" """
And the Server is running at "passthrough-app" And the Server is running at "passthrough-app"
When I go to "/inline-coffeescript.html" When I go to "/inline-coffeescript.html"
Then I should see "16" lines Then I should see "13" lines
Scenario: Rendering external js (coffeescript) with a passthrough minifier Scenario: Rendering external js (coffeescript) with a passthrough minifier
Given a fixture app "passthrough-app" Given a fixture app "passthrough-app"

View file

@ -1 +0,0 @@
require "coffee-filter"

View file

@ -1 +0,0 @@
require "coffee-filter"

View file

@ -1,5 +1,4 @@
%style(type="text/css") :sass
:sass body
body test: style
test: style good: deal
good: deal

View file

@ -25,6 +25,6 @@ Gem::Specification.new do |s|
s.add_dependency("coffee-script-source", ["~> 1.3.3"]) s.add_dependency("coffee-script-source", ["~> 1.3.3"])
s.add_dependency("execjs", ["~> 1.4.0"]) s.add_dependency("execjs", ["~> 1.4.0"])
s.add_dependency("maruku", ["~> 0.6.0"]) s.add_dependency("maruku", ["~> 0.6.0"])
s.add_dependency("i18n", ["~> 0.6.0"]) s.add_dependency("i18n", ["~> 0.6.0", "< 0.6.2"]) # 0.6.2 broke Ruby 1.8 support
s.add_dependency("padrino-helpers", ["0.10.7"]) s.add_dependency("padrino-helpers", ["0.10.7"])
end end

View file

@ -19,6 +19,6 @@ Gem::Specification.new do |s|
s.add_dependency("middleman-core", Middleman::VERSION) s.add_dependency("middleman-core", Middleman::VERSION)
s.add_dependency("middleman-more", Middleman::VERSION) s.add_dependency("middleman-more", Middleman::VERSION)
s.add_dependency("middleman-sprockets", "~> 3.0.6") s.add_dependency("middleman-sprockets", "~> 3.0.8")
end end