debug flag

This commit is contained in:
Thomas Reynolds 2011-11-10 15:24:24 -08:00
parent 9bfd345849
commit d018511606
2 changed files with 10 additions and 3 deletions

View file

@ -57,12 +57,17 @@ module Middleman
:aliases => "-p", :aliases => "-p",
:default => "4567", :default => "4567",
:desc => "The port Middleman will listen on" :desc => "The port Middleman will listen on"
method_option "debug",
:type => :boolean,
:default => false,
:desc => 'Print debug messages'
def server def server
v1_check v1_check
params = { params = {
:port => options[:port], :port => options["port"],
:environment => options[:environment] :environment => options["environment"],
:debug => options["debug"]
} }
puts "== The Middleman is loading" puts "== The Middleman is loading"

View file

@ -23,6 +23,7 @@ module Middleman
options_hash << ", :#{k} => '#{v}'" options_hash << ", :#{k} => '#{v}'"
end end
$stderr.puts options_hash.inspect
guardfile_contents = %Q{ guardfile_contents = %Q{
guard 'middleman'#{options_hash} do guard 'middleman'#{options_hash} do
watch(%r{(.*)}) watch(%r{(.*)})
@ -81,6 +82,7 @@ module Guard
def server_start def server_start
app = ::Middleman.server app = ::Middleman.server
app.set :environment, @options[:environment].to_sym app.set :environment, @options[:environment].to_sym
app.set :logging, @options[:debug] == "true"
puts "== The Middleman is standing watch on port #{@options[:Port]||4567}" puts "== The Middleman is standing watch on port #{@options[:Port]||4567}"
@app = app.new! @app = app.new!