From 723a0a62ae0b28001f7b6766af3aa06ea011b703 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Tue, 2 Aug 2011 21:58:20 -0700 Subject: [PATCH] update some deps --- features/sprockets_gems.feature | 7 +++++++ fixtures/test-app/source/javascripts/jquery_base.js | 5 +++++ lib/middleman/core_extensions/sprockets.rb | 13 ++++++++++--- middleman.gemspec | 13 ++++++------- 4 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 features/sprockets_gems.feature create mode 100644 fixtures/test-app/source/javascripts/jquery_base.js diff --git a/features/sprockets_gems.feature b/features/sprockets_gems.feature new file mode 100644 index 00000000..300b39ad --- /dev/null +++ b/features/sprockets_gems.feature @@ -0,0 +1,7 @@ +@wip +Feature: Sprockets Gems + + Scenario: Sprockets can pull jQuery from gem + Given the Server is running at "test-app" + When I go to "/javascripts/jquery_base.js" + # Then I should see "sprockets_sub_function" \ No newline at end of file diff --git a/fixtures/test-app/source/javascripts/jquery_base.js b/fixtures/test-app/source/javascripts/jquery_base.js new file mode 100644 index 00000000..52111548 --- /dev/null +++ b/fixtures/test-app/source/javascripts/jquery_base.js @@ -0,0 +1,5 @@ +//= require "jquery-ui" + +function then_do_stuff() { + +} \ No newline at end of file diff --git a/lib/middleman/core_extensions/sprockets.rb b/lib/middleman/core_extensions/sprockets.rb index f28902d5..05956b7b 100644 --- a/lib/middleman/core_extensions/sprockets.rb +++ b/lib/middleman/core_extensions/sprockets.rb @@ -1,8 +1,8 @@ require "sprockets" - + module Middleman::CoreExtensions::Sprockets class << self - def registered(app) + def registered(app) app.set :js_compressor, false app.map "/#{app.js_dir}" do @@ -15,7 +15,7 @@ module Middleman::CoreExtensions::Sprockets alias :included :registered end - class MiddlemanEnvironment < Sprockets::Environment + class MiddlemanEnvironment < ::Sprockets::Environment def initialize(app) full_path = app.views full_path = File.join(app.root, app.views) unless app.views.include?(app.root) @@ -35,6 +35,13 @@ module Middleman::CoreExtensions::Sprockets # configure search paths append_path app.js_dir + + # jQuery for Sprockets + # begin + # require "jquery-rails" + # jquery-rails / vendor / assets / javascripts + # rescue LoadError + # end end end diff --git a/middleman.gemspec b/middleman.gemspec index 9cf3daaf..11fe9c9c 100644 --- a/middleman.gemspec +++ b/middleman.gemspec @@ -11,8 +11,6 @@ Gem::Specification.new do |s| s.homepage = "http://middlemanapp.com" s.summary = "A static site generator based on Sinatra. Providing Haml, Sass, Compass, CoffeeScript and including minification, compression and cache busting." - s.rubyforge_project = "middleman" - s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {fixtures,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } @@ -24,21 +22,22 @@ Gem::Specification.new do |s| s.add_runtime_dependency("tilt", ["~> 1.3.1"]) s.add_runtime_dependency("rdiscount", ["~> 1.6.8"]) s.add_runtime_dependency("sinatra", ["~> 1.2.6"]) - s.add_runtime_dependency("padrino-core", ["~> 0.10.0"]) - s.add_runtime_dependency("padrino-helpers", ["~> 0.10.0"]) + s.add_runtime_dependency("padrino-core", ["~> 0.10.1"]) + s.add_runtime_dependency("padrino-helpers", ["~> 0.10.1"]) s.add_runtime_dependency("rack-test", ["~> 0.6.1"]) s.add_runtime_dependency("uglifier", ["~> 1.0.0"]) s.add_runtime_dependency("slim", ["~> 0.9.0"]) s.add_runtime_dependency("haml", ["~> 3.1.0"]) - s.add_runtime_dependency("sass", ["~> 3.1.5"]) + s.add_runtime_dependency("sass", ["~> 3.1.6"]) s.add_runtime_dependency("coffee-script", ["~> 2.2.0"]) s.add_runtime_dependency("compass", ["~> 0.11.3"]) s.add_runtime_dependency("sprockets", ["2.0.0.beta.12"]) s.add_runtime_dependency("httparty", ["~> 0.7.0"]) s.add_runtime_dependency("guard", ["~> 0.5.1"]) - s.add_runtime_dependency("guard-livereload", ["~> 0.2.0"]) + s.add_runtime_dependency("guard-livereload", ["~> 0.2.1"]) s.add_development_dependency("coffee-filter", ["~> 0.1.1"]) - s.add_development_dependency("cucumber", ["~> 0.10.0"]) + # s.add_development_dependency("jquery-rails", ["~> 1.0.12"]) + s.add_development_dependency("cucumber", ["~> 1.0.2"]) s.add_development_dependency("rake", ["0.8.7"]) s.add_development_dependency("rspec", ["~> 2.6.0"]) end