foreman 0.48.0.pre2 → 0.48.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/foreman/cli.rb CHANGED
@@ -3,13 +3,17 @@ require "foreman/helpers"
3
3
  require "foreman/engine"
4
4
  require "foreman/engine/cli"
5
5
  require "foreman/export"
6
+ require "foreman/version"
6
7
  require "shellwords"
8
+ require "yaml"
7
9
  require "thor"
8
10
 
9
11
  class Foreman::CLI < Thor
10
12
 
11
13
  include Foreman::Helpers
12
14
 
15
+ map ["-v", "--version"] => :version
16
+
13
17
  class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
14
18
  class_option :root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
15
19
 
@@ -80,6 +84,12 @@ class Foreman::CLI < Thor
80
84
  end
81
85
  end
82
86
 
87
+ desc "version", "Display Foreman gem version"
88
+
89
+ def version
90
+ puts Foreman::VERSION
91
+ end
92
+
83
93
  no_tasks do
84
94
  def engine
85
95
  @engine ||= begin
@@ -123,7 +133,7 @@ private ######################################################################
123
133
  def options
124
134
  original_options = super
125
135
  return original_options unless File.exists?(".foreman")
126
- defaults = YAML::load_file(".foreman") || {}
136
+ defaults = ::YAML::load_file(".foreman") || {}
127
137
  Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options))
128
138
  end
129
139
 
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.48.0.pre2"
3
+ VERSION = "0.48.0.pre3"
4
4
 
5
5
  end
@@ -74,4 +74,14 @@ describe "Foreman::CLI", :fakefs do
74
74
  end
75
75
  end
76
76
 
77
+ describe "version" do
78
+ it "displays gem version" do
79
+ foreman("version").chomp.should == Foreman::VERSION
80
+ end
81
+
82
+ it "displays gem version on shortcut command" do
83
+ foreman("-v").chomp.should == Foreman::VERSION
84
+ end
85
+ end
86
+
77
87
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.48.0.pre2
4
+ version: 0.48.0.pre3
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70300230243500 !ruby/object:Gem::Requirement
16
+ requirement: &70226092135660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.13.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70300230243500
24
+ version_requirements: *70226092135660
25
25
  description: Process manager for applications with multiple components
26
26
  email: ddollar@gmail.com
27
27
  executables: