all tests pass

This commit is contained in:
Thomas Reynolds 2011-11-18 20:49:59 -08:00
parent 61c6881ecc
commit 22c37f9b2b
5 changed files with 26 additions and 25 deletions

View file

@ -46,16 +46,18 @@ module Middleman::CoreExtensions::DefaultHelpers
when :css then self.css_dir when :css then self.css_dir
end end
end end
path = current_path.dup
# If the basename of the request as no extension, assume we are serving a # If the basename of the request as no extension, assume we are serving a
# directory and join index_file to the path. # directory and join index_file to the path.
path = File.join(path, self.index_file) if File.extname(path).empty? path = full_path(current_path.dup)
path = path.gsub(%r{^/}, '')
path = path.sub(%r{^/}, '')
path = path.gsub(File.extname(path), ".#{asset_ext}") path = path.gsub(File.extname(path), ".#{asset_ext}")
path = path.gsub("/", separator) path = path.gsub("/", separator)
view = File.join(self.views, asset_dir, path) matching_file = resolve_template(File.join(asset_dir, path))
yield path if File.exists?(view) or Dir["#{view}.*"].any?
yield path if matching_file
end end
def page_classes def page_classes

View file

@ -41,6 +41,11 @@ module Guard
server_start server_start
end end
def reload
server_stop
server_start
end
def run_on_change(paths) def run_on_change(paths)
needs_to_restart = false needs_to_restart = false
@ -52,7 +57,7 @@ module Guard
end end
if needs_to_restart if needs_to_restart
server_restart reload
elsif !@app.nil? elsif !@app.nil?
paths.each do |path| paths.each do |path|
@app.logger.debug :file_change, Time.now, path if @app.settings.logging? @app.logger.debug :file_change, Time.now, path if @app.settings.logging?
@ -71,11 +76,6 @@ module Guard
end end
private private
def server_restart
server_stop
server_start
end
def server_start def server_start
# Quiet down Guard # Quiet down Guard
# ENV['GUARD_ENV'] = 'test' if @options[:debug] == "true" # ENV['GUARD_ENV'] = 'test' if @options[:debug] == "true"

View file

@ -1,3 +1,3 @@
module Middleman module Middleman
VERSION = "2.1.0.pre" VERSION = "3.0.0.pre"
end end

View file

@ -24,34 +24,31 @@ Gem::Specification.new do |s|
s.add_dependency("thin", ["~> 1.2.11"]) s.add_dependency("thin", ["~> 1.2.11"])
s.add_dependency("thor", ["~> 0.14.0"]) s.add_dependency("thor", ["~> 0.14.0"])
s.add_dependency("tilt", ["~> 1.3.1"]) s.add_dependency("tilt", ["~> 1.3.1"])
s.add_dependency("maruku", ["~> 0.6.0"])
s.add_dependency("sinatra", ["~> 1.3.1"])
s.add_dependency("rack-test", ["~> 0.6.1"]) s.add_dependency("rack-test", ["~> 0.6.1"])
s.add_dependency("uglifier", ["~> 1.0.0"]) s.add_dependency("uglifier", ["~> 1.1.0"])
s.add_dependency("slim", ["~> 1.0.2"])
s.add_dependency("haml", ["~> 3.1.0"]) s.add_dependency("haml", ["~> 3.1.0"])
s.add_dependency("sass", ["~> 3.1.7"]) s.add_dependency("sass", ["~> 3.1.7"])
s.add_dependency("activesupport", ["~> 3.1.0"])
s.add_dependency("compass", ["~> 0.11.3"]) s.add_dependency("compass", ["~> 0.11.3"])
s.add_dependency("coffee-script", ["~> 2.2.0"]) s.add_dependency("coffee-script", ["~> 2.2.0"])
s.add_dependency("sprockets", ["~> 2.0.3"]) s.add_dependency("execjs", ["~> 1.2.7"])
s.add_dependency("sprockets", ["~> 2.0"])
s.add_dependency("sprockets-sass", ["~> 0.3.0"]) s.add_dependency("sprockets-sass", ["~> 0.3.0"])
s.add_dependency("padrino-core", ["~> 0.10.5"])
s.add_dependency("padrino-helpers", ["~> 0.10.5"])
s.add_dependency("hooks", ["~> 0.2.0"]) s.add_dependency("hooks", ["~> 0.2.0"])
s.add_dependency("guard", ["~> 0.8.8"])
s.add_dependency("eventmachine", ["1.0.0.beta.4.1"]) s.add_dependency("eventmachine", ["1.0.0.beta.4.1"])
s.add_dependency("win32-process", ["~> 0.6.5"]) s.add_dependency("win32-process", ["~> 0.6.5"])
s.add_dependency("rb-fchange") s.add_dependency("rb-fchange")
s.add_dependency("guard", ["~> 0.8.8"])
# Development and test # Development and test
# s.add_development_dependency("jquery-rails") s.add_development_dependency("slim")
s.add_development_dependency("maruku")
s.add_development_dependency("coffee-filter", ["~> 0.1.1"]) s.add_development_dependency("coffee-filter", ["~> 0.1.1"])
s.add_development_dependency("liquid", ["~> 2.2.0"]) s.add_development_dependency("liquid", ["~> 2.2.0"])
s.add_development_dependency("cucumber", ["~> 1.0.2"]) s.add_development_dependency("cucumber", ["~> 1.1.0"])
s.add_development_dependency("rake", ["~> 0.9.2"]) s.add_development_dependency("rake", ["~> 0.9.2"])
s.add_development_dependency("rspec", ["~> 2.6.0"]) s.add_development_dependency("rspec", ["~> 2.7.0"])
s.add_development_dependency("jquery-rails") s.add_development_dependency("jquery-rails")
s.add_development_dependency("bootstrap-rails") s.add_development_dependency("bootstrap-rails")
end end

View file

@ -35,9 +35,11 @@ Gem::Specification.new do |s|
s.add_dependency("sprockets", ["~> 2.0"]) s.add_dependency("sprockets", ["~> 2.0"])
s.add_dependency("sprockets-sass", ["~> 0.3.0"]) s.add_dependency("sprockets-sass", ["~> 0.3.0"])
s.add_dependency("hooks", ["~> 0.2.0"]) s.add_dependency("hooks", ["~> 0.2.0"])
s.add_dependency("rb-fsevent")
s.add_dependency("guard", ["~> 0.8.8"]) s.add_dependency("guard", ["~> 0.8.8"])
# OSX
s.add_dependency("rb-fsevent")
# Development and test # Development and test
s.add_development_dependency("slim") s.add_development_dependency("slim")
s.add_development_dependency("maruku") s.add_development_dependency("maruku")