From e496d228b05decc03f2e5611e2aeecb8a60f2416 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sat, 31 Dec 2011 12:47:49 -0800 Subject: [PATCH] try to fix some guard weirdness. hide tilt warnings, closes #220 --- .../core_extensions/rendering.rb | 9 ++- middleman-core/lib/middleman-core/guard.rb | 7 ++- middleman-x86-mingw32.gemspec | 56 ------------------- middleman/Rakefile | 5 ++ middleman/features/support/env.rb | 7 +++ 5 files changed, 25 insertions(+), 59 deletions(-) delete mode 100644 middleman-x86-mingw32.gemspec create mode 100644 middleman/Rakefile create mode 100644 middleman/features/support/env.rb diff --git a/middleman-core/lib/middleman-core/core_extensions/rendering.rb b/middleman-core/lib/middleman-core/core_extensions/rendering.rb index 954eff19..f6f1fd18 100644 --- a/middleman-core/lib/middleman-core/core_extensions/rendering.rb +++ b/middleman-core/lib/middleman-core/core_extensions/rendering.rb @@ -1,3 +1,10 @@ +# Shutup Tilt Warnings +class Tilt::Template + def warn(*args) + # Kernel.warn(*args) + end +end + module Middleman::CoreExtensions::Rendering class << self def registered(app) @@ -244,4 +251,4 @@ module Middleman::CoreExtensions::Rendering end end end -end +end \ No newline at end of file diff --git a/middleman-core/lib/middleman-core/guard.rb b/middleman-core/lib/middleman-core/guard.rb index 04ef230e..f9ee5981 100644 --- a/middleman-core/lib/middleman-core/guard.rb +++ b/middleman-core/lib/middleman-core/guard.rb @@ -55,7 +55,10 @@ module Guard # Start Middleman in a fork # @return [void] def start - @server_job = fork { bootup } + @server_job = fork { + Signal.trap(::Middleman::WINDOWS ? :KILL : :TERM) { exit! } + bootup + } end # Start an instance of Middleman::Base @@ -142,7 +145,7 @@ module Guard end # Trap the interupt signal and shut down Guard (and thus the server) smoothly -trap(::Guard::Middleman.kill_command) do +trap(::Guard::Middleman.kill_command) do ::Guard.stop exit!(0) end \ No newline at end of file diff --git a/middleman-x86-mingw32.gemspec b/middleman-x86-mingw32.gemspec deleted file mode 100644 index 7a5b729b..00000000 --- a/middleman-x86-mingw32.gemspec +++ /dev/null @@ -1,56 +0,0 @@ -# -*- encoding: utf-8 -*- -$:.push File.expand_path("../lib", __FILE__) -require "middleman-core/version" - -Gem::Specification.new do |s| - s.name = "middleman" - s.version = Middleman::VERSION - s.platform = "x86-mingw32" - s.license = "MIT" - s.authors = ["Thomas Reynolds"] - s.email = ["me@tdreyno.com"] - s.homepage = "http://middlemanapp.com" - s.summary = "Hand-crafted frontend development" - s.description = "A static site generator based on Sinatra. Providing dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle." - - 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) } - s.require_paths = ["lib"] - - s.add_dependency("rack", ["~> 1.3.5"]) - s.add_dependency("thin", ["~> 1.3.1"]) - s.add_dependency("thor", ["~> 0.14.0"]) - s.add_dependency("tilt", ["~> 1.3.1"]) - s.add_dependency("i18n", ["~> 0.6.0"]) - s.add_dependency("rack-test", ["~> 0.6.1"]) - s.add_dependency("uglifier", ["~> 1.2.0"]) - s.add_dependency("haml", ["~> 3.1.0"]) - s.add_dependency("sass", ["~> 3.1.7"]) - s.add_dependency("activesupport", ["~> 3.1.0"]) - s.add_dependency("compass", ["~> 0.11.3"]) - s.add_dependency("coffee-script", ["~> 2.2.0"]) - s.add_dependency("execjs", ["~> 1.2.7"]) - s.add_dependency("sprockets", ["~> 2.1"]) - s.add_dependency("sprockets-sass", ["~> 0.6.0"]) - s.add_dependency("guard", ["~> 0.9.4"]) - s.add_dependency("redcarpet", ["~> 2.0.0"]) - - s.add_dependency("eventmachine", ["1.0.0.beta.4.1"]) - s.add_dependency("win32-process", ["~> 0.6.5"]) - - # Development and test - s.add_development_dependency("slim") - s.add_development_dependency("sinatra") - s.add_development_dependency("coffee-filter", ["~> 0.1.1"]) - s.add_development_dependency("liquid", ["~> 2.2"]) - s.add_development_dependency("cucumber", ["~> 1.1.0"]) - s.add_development_dependency("aruba", ["~> 0.4.11"]) - s.add_development_dependency("rake", ["~> 0.9.2"]) - s.add_development_dependency("rspec", ["~> 2.7"]) - s.add_development_dependency("rdoc", ["~> 3.9"]) - s.add_development_dependency("yard") - s.add_development_dependency("jquery-rails") - s.add_development_dependency("bootstrap-rails", ["0.0.5"]) -end - diff --git a/middleman/Rakefile b/middleman/Rakefile new file mode 100644 index 00000000..f33347d2 --- /dev/null +++ b/middleman/Rakefile @@ -0,0 +1,5 @@ +# coding:utf-8 +RAKE_ROOT = __FILE__ + +require 'rubygems' +require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper') \ No newline at end of file diff --git a/middleman/features/support/env.rb b/middleman/features/support/env.rb new file mode 100644 index 00000000..24373181 --- /dev/null +++ b/middleman/features/support/env.rb @@ -0,0 +1,7 @@ +PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) + +core_root = File.expand_path("../../../../middleman-core/lib/middleman-core", __FILE__) + +require core_root +require File.join(core_root, "step_definitions") +require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman') \ No newline at end of file