class Shipmonk::CLI

Public Class Methods

source_root() click to toggle source
# File lib/shipmonk/cli.rb, line 24
def self.source_root
  File.expand_path '../shipmonk/default', File.dirname(__FILE__)
end

Public Instance Methods

new(site_name) click to toggle source
# File lib/shipmonk/cli.rb, line 8
def new(site_name)
  site_path = File.expand_path site_name, Dir.pwd
  abort "Site already exists, choose another name or delete the existing site." if Dir.exists? site_path
  create_site site_path
end
server(*args) click to toggle source
# File lib/shipmonk/cli.rb, line 16
def server(*args)
  require 'shipmonk/server'
  # get rid of 'server' in the args list
  # otherwise :config in default_options gets set to 'server'
  ARGV.shift
  Shipmonk::Server.new.start
end

Private Instance Methods

create_site(site_path) click to toggle source
# File lib/shipmonk/cli.rb, line 30
def create_site(site_path)
  self.destination_root = site_path
  Dir.mkdir destination_root
  copy_file 'config.ru'
  copy_file 'Gemfile'
  directory 'src'
end