From 558863a224357e265c9e49e87be14a8374458414 Mon Sep 17 00:00:00 2001 From: Greg Jastrab Date: Fri, 5 Dec 2008 14:37:06 -0500 Subject: [PATCH] Bringing versioning of CmdParser in line with Gem. --- bin/puremvc-gen | 25 ++----------------------- lib/pure_m_v_c_gen.rb | 23 +++++++++++++++++++++++ lib/pure_m_v_c_gen/version.rb | 3 ++- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/bin/puremvc-gen b/bin/puremvc-gen index fe83d84..66ba186 100644 --- a/bin/puremvc-gen +++ b/bin/puremvc-gen @@ -1,26 +1,5 @@ #!/usr/bin/env ruby -require 'rubygems' -require 'cmdparse' - -PMVC_GEN_LIB = File.join(File.dirname(__FILE__), '..', 'lib', 'pure_m_v_c_gen') -require File.join(PMVC_GEN_LIB, 'ant_checker') - -unless PureMVCGen::AntChecker.has_ant_installed? - err = <<-EOL - You must have ANT installed to run puremvc-gen. - Install it! ==> http://ant.apache.org - If you have it installed, ensure it is on your path. - EOL - puts err - exit 1 -end - -CMD_PATH = File.join(PMVC_GEN_LIB, 'commands') - -require File.join(CMD_PATH, 'command_extensions') -require File.join(CMD_PATH, 'check_command') -require File.join(CMD_PATH, 'initialize_command') -require File.join(CMD_PATH, 'new_command') +require 'pure_m_v_c_gen' include PureMVCGen::Commands @@ -33,7 +12,7 @@ end cmd = CmdParse::CommandParser.new(true, true) cmd.program_name = "puremvc-gen " -cmd.program_version = [0, 0, 1] +cmd.program_version = PureMVCGen::Version::ARRAY cmd.add_command(CmdParse::HelpCommand.new) cmd.add_command(CmdParse::VersionCommand.new) diff --git a/lib/pure_m_v_c_gen.rb b/lib/pure_m_v_c_gen.rb index e69de29..ca57760 100644 --- a/lib/pure_m_v_c_gen.rb +++ b/lib/pure_m_v_c_gen.rb @@ -0,0 +1,23 @@ +require 'rubygems' +require 'cmdparse' +require 'pure_m_v_c_gen/version' + +PMVC_GEN_LIB = File.join(File.dirname(__FILE__), '..', 'lib', 'pure_m_v_c_gen') +require File.join(PMVC_GEN_LIB, 'ant_checker') + +unless PureMVCGen::AntChecker.has_ant_installed? + err = <<-EOL + You must have ANT installed to run puremvc-gen. + Install it! ==> http://ant.apache.org + If you have it installed, ensure it is on your path. + EOL + puts err + exit 1 +end + +CMD_PATH = File.join(PMVC_GEN_LIB, 'commands') + +require File.join(CMD_PATH, 'command_extensions') +require File.join(CMD_PATH, 'check_command') +require File.join(CMD_PATH, 'initialize_command') +require File.join(CMD_PATH, 'new_command') \ No newline at end of file diff --git a/lib/pure_m_v_c_gen/version.rb b/lib/pure_m_v_c_gen/version.rb index cabc6bc..f3c2ebe 100644 --- a/lib/pure_m_v_c_gen/version.rb +++ b/lib/pure_m_v_c_gen/version.rb @@ -14,7 +14,8 @@ module PureMVCGen MINOR = 1 TINY = 0 - STRING = [MAJOR, MINOR, TINY].join(".") + ARRAY = [MAJOR, MINOR, TINY] + STRING = ARRAY.join(".") end end