lib/hyde/cli.rb in hydeweb-0.1.9 vs lib/hyde/cli.rb in hydeweb-0.1.10

- old
+ new

@@ -66,13 +66,17 @@ project port = (params.extract('-p') || 4833).to_i host = (params.extract('-o') || '0.0.0.0') daemon = (!! params.delete('-D')) + cache = (!! params.delete('--cache')) require 'hyde/server' + # No caching whatsoever. + Hyde::Server.options[:cache] = cache + if daemon pid = fork { Hyde::Server.run! :Host => host, :Port => port, :quiet => true } sleep 2 puts puts "Listening on #{host}:#{port} on pid #{pid}." @@ -85,15 +89,18 @@ task.description = "Starts the server" task.category = :project task.help = %{ Usage: - #{executable} start [-p PORT] [-o HOST] [-D] + #{executable} start [-p PORT] [-o HOST] [--cache] [-D] Starts an HTTP server so you may rapidly test your project locally. If the -p and/or -o is specified, it will listen on the specified HOST:PORT. Otherwise, the default is 0.0.0.0:4833. + + Hyde doesn't send cache instructions, ensuring that every page load is fresh. + You can use --cache to override this behavior. If -D is specified, it goes into daemon mode. }.gsub(/^ {4}/, '').strip.split("\n") task(:version) do