Skip to content

Commit

Permalink
added version as constant + to commandline
Browse files Browse the repository at this point in the history
  • Loading branch information
cldwalker committed Feb 22, 2010
1 parent 678f0a3 commit b6bdb43
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Rakefile
Expand Up @@ -16,8 +16,11 @@ end

begin
require 'jeweler'
require File.dirname(__FILE__) + "/lib/boson/version"

Jeweler::Tasks.new do |s|
s.name = "boson"
s.version = Boson::VERSION
s.description = "A command/task framework similar to rake and thor that opens your ruby universe to the commandline and irb."
s.summary = "Boson provides users with the power to turn any ruby method into a full-fledged commandline tool. Boson achieves this with powerful options (borrowed from thor) and views (thanks to hirb). Some other unique features that differentiate it from rake and thor include being accessible from irb and the commandline, being able to write boson commands in non-dsl ruby and toggling a pretty view of a command's output without additional view code."
s.email = "gabriel.horner@gmail.com"
Expand Down
5 changes: 0 additions & 5 deletions VERSION.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/boson.rb
Expand Up @@ -5,7 +5,7 @@
# order of library subclasses matters
%w{module file gem require local_file}.each {|e| require "boson/libraries/#{e}_library" }
(%w{namespace view command util commands option_parser options} +
%w{index repo_index scientist option_command pipe pipes}).each {|e| require "boson/#{e}" }
%w{index repo_index scientist option_command pipe pipes version}).each {|e| require "boson/#{e}" }

# This module stores the libraries, commands, repos and main object used throughout Boson.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/boson/runners/bin_runner.rb
Expand Up @@ -34,6 +34,7 @@ module Boson
class BinRunner < Runner
GLOBAL_OPTIONS = {
:verbose=>{:type=>:boolean, :desc=>"Verbose description of loading libraries, errors or help"},
:version=>{:type=>:boolean, :desc=>"Prints the current version"},
:index=>{:type=>:array, :desc=>"Libraries to index. Libraries must be passed with '='.",
:bool_default=>nil, :values=>all_libraries, :regexp=>true, :enum=>false},
:execute=>{:type=>:string, :desc=>"Executes given arguments as a one line script"},
Expand All @@ -53,6 +54,7 @@ class <<self
# Starts, processes and ends a commandline request.
def start(args=ARGV)
@command, @options, @args = parse_args(args)
return puts(Boson::VERSION) if @options[:version]
return print_usage if args.empty? || (@command.nil? && !@options[:console] && !@options[:execute])
return ConsoleRunner.bin_start(@options[:console], @options[:load]) if @options[:console]
init
Expand Down
3 changes: 3 additions & 0 deletions lib/boson/version.rb
@@ -0,0 +1,3 @@
module Boson
VERSION = '0.2.3'
end

0 comments on commit b6bdb43

Please sign in to comment.