lib/rubyfox/server/cli.rb in rubyfox-server-2.3.0.0 vs lib/rubyfox/server/cli.rb in rubyfox-server-2.8.0.0
- old
+ new
@@ -1,9 +1,10 @@
require 'thor'
require 'mime/types'
require 'rubyfox/server'
+require 'rubyfox/server/version'
require 'rubyfox/server/environment'
module Rubyfox
module Server
class CLI < Thor
@@ -11,20 +12,20 @@
def self.source_root
Rubyfox::Server.data_dir
end
- desc "install TARGET_DIR", "install SmartFox Server into TARGET_DIR"
+ desc "install TARGET_DIR", "Install SmartFox Server into TARGET_DIR"
def install(target_dir)
if File.exist?(target_dir)
abort "Directory #{target_dir} already exists!"
end
directory self.class.source_root, target_dir
end
- desc "configure TARGET_DIR TEMPLATE_DIR", "configures SmartFox Server in TARGET_DIR via TEMPLATE_DIR"
+ desc "configure TARGET_DIR TEMPLATE_DIR", "Configure SmartFox Server in TARGET_DIR via TEMPLATE_DIR"
def configure(target_dir, template_dir)
template_dir = File.expand_path(template_dir, Dir.pwd)
target_dir = File.expand_path(target_dir, Dir.pwd)
Dir["#{template_dir}/**/*"].each do |file|
@@ -40,14 +41,19 @@
end
end
end
map "config" => :configure
- desc "start TARGET_DIR", "start SmartFox Server in TARGET_DIR"
+ desc "start TARGET_DIR", "Start SmartFox Server in TARGET_DIR"
def start(target_dir)
inside(target_dir) do
system "sh ./sfs2x.sh"
end
+ end
+
+ desc "version", "Display version of this command"
+ def version
+ puts Rubyfox::Server::VERSION
end
no_tasks do
def env
@env ||= Environment.new(ENV)