Added command to display current version of homesick.

This commit is contained in:
Jeremy Cook
2014-01-05 14:27:52 -05:00
parent ab46cf7b2f
commit df8f6b1cb0
4 changed files with 29 additions and 1 deletions

View File

@@ -4,9 +4,11 @@ require 'thor'
class Homesick < Thor
autoload :Shell, 'homesick/shell'
autoload :Actions, 'homesick/actions'
autoload :Version, 'homesick/version'
include Thor::Actions
include Homesick::Actions
include Homesick::Version
add_runtime_options!
@@ -15,6 +17,9 @@ class Homesick < Thor
DEFAULT_CASTLE_NAME = 'dotfiles'
map '-v' => :version
map '--version' => :version
def initialize(args = [], options = {}, config = {})
super
self.shell = Homesick::Shell.new
@@ -264,6 +269,11 @@ class Homesick < Thor
end
end
desc 'version', 'Display the current version of homesick'
def version
say Homesick::Version::STRING
end
protected
def home_dir

10
lib/homesick/version.rb Normal file
View File

@@ -0,0 +1,10 @@
# -*- encoding : utf-8 -*-
class Homesick
module Version
MAJOR = 0
MINOR = 9
PATCH = 8
STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
end
end