Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/ruhoh/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ module Ruhoh::Publish; end
class Ruhoh

class Client
DEFAULT_PORT = 9292

DefaultBlogScaffold = 'git://github.com/ruhoh/blog.git'
Help = [
{
"command" => "new <directory_path>",
"desc" => "Create a new blog directory based on the Ruhoh specification."
},
{
"command" => "server [port]",
"desc" => "Start a local server on the given port (defaults to #{DEFAULT_PORT})."
},
{
"command" => "compile",
"desc" => "Compile to static website."
Expand Down Expand Up @@ -118,7 +124,7 @@ def server
require 'rack'
Rack::Server.start({
app: Ruhoh::Program.preview,
Port: (@args[1] || 9292)
Port: (@args[1] || DEFAULT_PORT)
})
end
alias_method :s, :server
Expand Down Expand Up @@ -178,8 +184,8 @@ def blog
if success
green "Success! Now do..."
cyan " cd #{target_directory}"
cyan " rackup -p9292"
cyan " http://localhost:9292"
cyan " rackup -p#{DEFAULT_PORT}"
cyan " http://localhost:#{DEFAULT_PORT}"
else
red "Could not git clone blog scaffold. Please try it manually:"
cyan " git clone git://github.com/ruhoh/blog.git #{target_directory}"
Expand Down