diff --git a/lib/middleman/cli.rb b/lib/middleman/cli.rb index 709208b3..c633c392 100644 --- a/lib/middleman/cli.rb +++ b/lib/middleman/cli.rb @@ -1,5 +1,4 @@ require 'thor' -require 'rbconfig' module Middleman class CLI < Thor @@ -39,19 +38,14 @@ module Middleman def server v1_check - if Config::CONFIG['host_os'].downcase =~ %r{mswin|mingw} - ::Middleman.start_server(options) - puts "== The Middleman is standing watch on port #{options[:port]}" - else - if options["livereload"] - livereload_options = {:port => options["livereload-port"]} - end - - Middleman::Guard.start({ - :port => options[:port], - :environment => options[:environment] - }, livereload_options) + if options["livereload"] + livereload_options = {:port => options["livereload-port"]} end + + Middleman::Guard.start({ + :port => options[:port], + :environment => options[:environment] + }, livereload_options) end desc "build", "Builds the static site for deployment" diff --git a/lib/middleman/guard.rb b/lib/middleman/guard.rb index 124f84e2..5962971f 100644 --- a/lib/middleman/guard.rb +++ b/lib/middleman/guard.rb @@ -1,8 +1,12 @@ require "guard" require "guard/guard" require "guard/livereload" -require "webrick" +require "rbconfig" +if Config::CONFIG['host_os'].downcase =~ %r{mswin|mingw} + require "win32/process" +end + module Middleman::Guard def self.start(options={}, livereload={}) options_hash = "" diff --git a/middleman.gemspec b/middleman.gemspec index 59c1b4fc..fe0dd99f 100644 --- a/middleman.gemspec +++ b/middleman.gemspec @@ -56,11 +56,13 @@ eos case Config::CONFIG['host_os'].downcase when %r{mswin|mingw} - else - s.add_runtime_dependency("guard", ["~> 0.5.1"]) - s.add_runtime_dependency("guard-livereload", ["~> 0.3.0"]) + # s.add_runtime_dependency "windows-api", "= 0.4.0" + # s.add_runtime_dependency "windows-pr", "= 1.1.2" + s.add_runtime_dependency("win32-process", ["~> 0.6.5"]) end + s.add_runtime_dependency("guard", ["~> 0.5.1"]) + s.add_runtime_dependency("guard-livereload", ["~> 0.3.0"]) s.add_development_dependency("coffee-filter", ["~> 0.1.1"]) s.add_development_dependency("cucumber", ["~> 1.0.2"]) s.add_development_dependency("rake", ["0.8.7"])