Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9901b9f924 | ||
|
|
4c2d569810 | ||
|
|
26f9c8186d | ||
|
|
24ed8946f3 | ||
|
|
83b2a9cc50 | ||
|
|
a0228b9fa0 | ||
|
|
b1a2a4a0cd | ||
|
|
7774b7f150 | ||
|
|
b01355a093 |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
foreman (0.48.0.pre2)
|
foreman (0.48.0.pre3)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
|
|||||||
+11
-1
@@ -3,13 +3,17 @@ require "foreman/helpers"
|
|||||||
require "foreman/engine"
|
require "foreman/engine"
|
||||||
require "foreman/engine/cli"
|
require "foreman/engine/cli"
|
||||||
require "foreman/export"
|
require "foreman/export"
|
||||||
|
require "foreman/version"
|
||||||
require "shellwords"
|
require "shellwords"
|
||||||
|
require "yaml"
|
||||||
require "thor"
|
require "thor"
|
||||||
|
|
||||||
class Foreman::CLI < Thor
|
class Foreman::CLI < Thor
|
||||||
|
|
||||||
include Foreman::Helpers
|
include Foreman::Helpers
|
||||||
|
|
||||||
|
map ["-v", "--version"] => :version
|
||||||
|
|
||||||
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
||||||
class_option :root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
|
class_option :root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
|
||||||
|
|
||||||
@@ -80,6 +84,12 @@ class Foreman::CLI < Thor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "version", "Display Foreman gem version"
|
||||||
|
|
||||||
|
def version
|
||||||
|
puts Foreman::VERSION
|
||||||
|
end
|
||||||
|
|
||||||
no_tasks do
|
no_tasks do
|
||||||
def engine
|
def engine
|
||||||
@engine ||= begin
|
@engine ||= begin
|
||||||
@@ -123,7 +133,7 @@ private ######################################################################
|
|||||||
def options
|
def options
|
||||||
original_options = super
|
original_options = super
|
||||||
return original_options unless File.exists?(".foreman")
|
return original_options unless File.exists?(".foreman")
|
||||||
defaults = YAML::load_file(".foreman") || {}
|
defaults = ::YAML::load_file(".foreman") || {}
|
||||||
Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options))
|
Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module Foreman
|
module Foreman
|
||||||
|
|
||||||
VERSION = "0.48.0.pre2"
|
VERSION = "0.48.0.pre3"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -74,4 +74,14 @@ describe "Foreman::CLI", :fakefs do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "version" do
|
||||||
|
it "displays gem version" do
|
||||||
|
foreman("version").chomp.should == Foreman::VERSION
|
||||||
|
end
|
||||||
|
|
||||||
|
it "displays gem version on shortcut command" do
|
||||||
|
foreman("-v").chomp.should == Foreman::VERSION
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user