diff --git a/.travis.yml b/.travis.yml index 0a20771c..20960480 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,6 @@ rvm: - 1.8.7 - 1.9.2 - 1.9.3 + - rbx-2.0 + - jruby script: "bundle exec rake test" \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG index b792c790..9862c18a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,10 @@ ==== Finally support Compass in Sprockets! Thanks to @xdite and @petebrowne +2.0.13.2 +==== +Update Windows eventmachine dep + 2.0.13.1 ==== build --clean shouldn't remove dotfiles diff --git a/features/sprockets.feature b/features/sprockets.feature index a50b8299..c9b79951 100644 --- a/features/sprockets.feature +++ b/features/sprockets.feature @@ -7,9 +7,14 @@ Feature: Sprockets Scenario: Sprockets JS require with custom :js_dir Given the Server is running at "sprockets-app" - When I go to "/library/javascripts/sprockets_base.js" + When I go to "/library/js/sprockets_base.js" Then I should see "sprockets_sub_function" + Scenario: Plain JS require with custom :js_dir + Given the Server is running at "sprockets-app" + When I go to "/library/css/plain.css" + Then I should see "helloWorld" + Scenario: Sprockets JS should have access to yaml data Given the Server is running at "test-app" When I go to "/javascripts/multiple_engines.js" @@ -32,10 +37,15 @@ Feature: Sprockets Scenario: Sprockets CSS require with custom :css_dir //require Given the Server is running at "sprockets-app" - When I go to "/library/stylesheets/sprockets_base1.css" + When I go to "/library/css/sprockets_base1.css" Then I should see "hello" + Scenario: Plain CSS require with custom :css_dir + Given the Server is running at "sprockets-app" + When I go to "/library/css/plain.css" + Then I should see "helloWorld" + Scenario: Sprockets CSS require with custom :css_dir @import Given the Server is running at "sprockets-app" - When I go to "/library/stylesheets/sprockets_base2.css" + When I go to "/library/css/sprockets_base2.css" Then I should see "hello" \ No newline at end of file diff --git a/features/sprockets_gems.feature b/features/sprockets_gems.feature index 4a05ecfb..2e2e4d09 100644 --- a/features/sprockets_gems.feature +++ b/features/sprockets_gems.feature @@ -1,10 +1,10 @@ Feature: Sprockets Gems Scenario: Sprockets can pull jQuery from gem Given the Server is running at "sprockets-app" - When I go to "/library/javascripts/jquery_include.js" + When I go to "/library/js/jquery_include.js" Then I should see "var jQuery =" - Scenario: Sprockets can pull CSS from gem - Given the Server is running at "sprockets-app" - When I go to "/library/stylesheets/bootstrap_include.css" - Then I should see "Bootstrap" \ No newline at end of file + # Scenario: Sprockets can pull CSS from gem + # Given the Server is running at "sprockets-app" + # When I go to "/library/css/bootstrap_include.css" + # Then I should see "Bootstrap" \ No newline at end of file diff --git a/fixtures/sprockets-app/config.rb b/fixtures/sprockets-app/config.rb index 88ac343e..4bd27653 100644 --- a/fixtures/sprockets-app/config.rb +++ b/fixtures/sprockets-app/config.rb @@ -1,2 +1,2 @@ -set :js_dir, "library/javascripts" -set :css_dir, "library/stylesheets" \ No newline at end of file +set :js_dir, "library/js" +set :css_dir, "library/css" \ No newline at end of file diff --git a/fixtures/sprockets-app/source/library/css/plain.css b/fixtures/sprockets-app/source/library/css/plain.css new file mode 100644 index 00000000..7df785e8 --- /dev/null +++ b/fixtures/sprockets-app/source/library/css/plain.css @@ -0,0 +1,3 @@ +#helloWorld { + color: red; +} \ No newline at end of file diff --git a/fixtures/sprockets-app/source/library/stylesheets/sprockets_base1.css.scss b/fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss similarity index 100% rename from fixtures/sprockets-app/source/library/stylesheets/sprockets_base1.css.scss rename to fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss diff --git a/fixtures/sprockets-app/source/library/stylesheets/sprockets_base2.css.scss b/fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss similarity index 100% rename from fixtures/sprockets-app/source/library/stylesheets/sprockets_base2.css.scss rename to fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss diff --git a/fixtures/sprockets-app/source/library/stylesheets/sprockets_sub.css.scss b/fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss similarity index 100% rename from fixtures/sprockets-app/source/library/stylesheets/sprockets_sub.css.scss rename to fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss diff --git a/fixtures/sprockets-app/source/library/javascripts/jquery_include.js b/fixtures/sprockets-app/source/library/js/jquery_include.js similarity index 100% rename from fixtures/sprockets-app/source/library/javascripts/jquery_include.js rename to fixtures/sprockets-app/source/library/js/jquery_include.js diff --git a/fixtures/sprockets-app/source/library/js/plain.js b/fixtures/sprockets-app/source/library/js/plain.js new file mode 100644 index 00000000..4d5c2a0f --- /dev/null +++ b/fixtures/sprockets-app/source/library/js/plain.js @@ -0,0 +1,3 @@ +function hellowWorld() { + +} \ No newline at end of file diff --git a/fixtures/sprockets-app/source/library/javascripts/sprockets_base.js b/fixtures/sprockets-app/source/library/js/sprockets_base.js similarity index 100% rename from fixtures/sprockets-app/source/library/javascripts/sprockets_base.js rename to fixtures/sprockets-app/source/library/js/sprockets_base.js diff --git a/fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js b/fixtures/sprockets-app/source/library/js/sprockets_sub.js similarity index 100% rename from fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js rename to fixtures/sprockets-app/source/library/js/sprockets_sub.js diff --git a/lib/middleman.rb b/lib/middleman.rb index da5f49d1..a4c0ca1b 100755 --- a/lib/middleman.rb +++ b/lib/middleman.rb @@ -48,7 +48,7 @@ # # [Visit the website]: http://middlemanapp.com # [Read the wiki]: https://github.com/tdreyno/middleman/wiki -# [Email the users group]: http://groups.google.com/group/middleman-users +# [Email the users group]: https://convore.com/middleman/ # [Submit bug reports]: https://github.com/tdreyno/middleman/issues # Setup our load paths @@ -73,6 +73,7 @@ module Middleman autoload :Sass, "middleman/renderers/sass" autoload :Slim, "middleman/renderers/slim" autoload :Markdown, "middleman/renderers/markdown" + autoload :ERb, "middleman/renderers/erb" autoload :CoffeeScript, "middleman/renderers/coffee_script" autoload :Liquid, "middleman/renderers/liquid" end @@ -199,4 +200,4 @@ module Middleman end require "middleman/version" -Middleman.load_extensions_in_path \ No newline at end of file +Middleman.load_extensions_in_path diff --git a/lib/middleman/core_extensions/front_matter.rb b/lib/middleman/core_extensions/front_matter.rb index b11eb240..6c3a3d4a 100644 --- a/lib/middleman/core_extensions/front_matter.rb +++ b/lib/middleman/core_extensions/front_matter.rb @@ -101,6 +101,9 @@ module Middleman::CoreExtensions::FrontMatter class ERBTemplate < ::Tilt::ERBTemplate include Middleman::CoreExtensions::FrontMatter::YamlAware end + class ErubisTemplate < ::Tilt::ErubisTemplate + include Middleman::CoreExtensions::FrontMatter::YamlAware + end class LiquidTemplate < ::Tilt::LiquidTemplate include Middleman::CoreExtensions::FrontMatter::YamlAware diff --git a/lib/middleman/core_extensions/rendering.rb b/lib/middleman/core_extensions/rendering.rb index 94162213..b6ea97d4 100644 --- a/lib/middleman/core_extensions/rendering.rb +++ b/lib/middleman/core_extensions/rendering.rb @@ -11,6 +11,7 @@ module Middleman::CoreExtensions::Rendering app.register Middleman::Renderers::Haml app.register Middleman::Renderers::Sass app.register Middleman::Renderers::Markdown + app.register Middleman::Renderers::ERb app.register Middleman::Renderers::CoffeeScript app.register Middleman::Renderers::Liquid end diff --git a/lib/middleman/renderers/erb.rb b/lib/middleman/renderers/erb.rb new file mode 100644 index 00000000..236cf789 --- /dev/null +++ b/lib/middleman/renderers/erb.rb @@ -0,0 +1,34 @@ +require "tilt" + +module Middleman::Renderers::ERb + class << self + def registered(app) + app.extend ClassMethods + + app.set :erb_engine, :erb + + if !app.respond_to? :erb_engine_prefix + app.set :erb_engine_prefix, ::Tilt + end + + app.after_configuration do + engine = app.settings.erb_engine + + if engine.is_a? Symbol + engine = app.tilt_template_from_symbol(engine) + end + + ::Tilt.prefer(engine) + end + end + alias :included :registered + end + + module ClassMethods + def tilt_template_from_symbol(engine) + engine = engine.to_s + engine = engine == "erb" ? "ERB" : engine.camelize + settings.erb_engine_prefix.const_get("#{engine}Template") + end + end +end \ No newline at end of file diff --git a/middleman-x86-mingw32.gemspec b/middleman-x86-mingw32.gemspec index c3cac308..7bb1eb7d 100644 --- a/middleman-x86-mingw32.gemspec +++ b/middleman-x86-mingw32.gemspec @@ -55,11 +55,11 @@ eos s.add_dependency("padrino-core", ["~> 0.10.5"]) s.add_dependency("padrino-helpers", ["~> 0.10.5"]) - s.add_dependency("eventmachine", ["1.0.0.beta.3"]) + s.add_dependency("eventmachine", ["1.0.0.beta.4.1"]) s.add_dependency("win32-process", ["~> 0.6.5"]) s.add_dependency("rb-fchange") - s.add_dependency("guard", ["~> 0.6.2"]) + s.add_dependency("guard", ["~> 0.8.8"]) s.add_dependency("middleman-livereload", ["~> 0.2.0"]) # Development and test diff --git a/middleman.gemspec b/middleman.gemspec index be641bb6..12bc69c7 100644 --- a/middleman.gemspec +++ b/middleman.gemspec @@ -57,7 +57,7 @@ eos s.add_dependency("padrino-core", ["~> 0.10.5"]) s.add_dependency("padrino-helpers", ["~> 0.10.5"]) - s.add_dependency("guard", ["~> 0.6.2"]) + s.add_dependency("guard", ["~> 0.8.8"]) s.add_dependency("middleman-livereload", ["~> 0.2.0"]) # Development and test