lib/octopress-docs/command.rb in octopress-docs-0.0.9 vs lib/octopress-docs/command.rb in octopress-docs-0.0.10

- old
+ new

@@ -9,24 +9,28 @@ c.option 'port', '-P', '--port [PORT]', 'Port to listen on' c.option 'host', '-H', '--host [HOST]', 'Host to bind to' if ENV['OCTODEV'] c.option 'watch', '--watch', 'Watch docs site for changes and rebuild. (For docs development)' end - c.option 'jekyll', '--jekyll', "Launch local server with docs for Jekyll v#{Jekyll::VERSION}" c.action do |args, options| serve_docs(options) end end end def self.serve_docs(options) + # Activate dependencies for serving docs. + require "octopress-escape-code" + require "octopress-hooks" + require "octopress-docs/page" + require "octopress-docs/doc" + require "octopress-docs/hooks" + require "octopress-docs/liquid_filters" + Octopress::Docs.docs_mode = true - if options['jekyll'] - options = init_jekyll_docs(options) - else - options = init_octopress_docs(options) - end + options = init_octopress_docs(options) + options["port"] ||= '4444' options["serving"] = true options = Jekyll.configuration Jekyll::Utils.symbolize_hash_keys(options) Jekyll::Commands::Build.process(options) Jekyll::Commands::Serve.process(options) end