commandant 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/commandant.rb +1 -1
- data/spec/commandant_spec.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/commandant.rb
CHANGED
@@ -68,7 +68,7 @@ module Commandant
|
|
68
68
|
# @raise [UnknownCommand] command is unknown and no :main command is available
|
69
69
|
def run(cmdline=ARGV)
|
70
70
|
name, *args = cmdline
|
71
|
-
name = name.to_sym if name
|
71
|
+
name = name.to_sym if name && COMMANDS[name.to_sym]
|
72
72
|
|
73
73
|
name, *args = :main, name, *args unless COMMANDS[name]
|
74
74
|
|
data/spec/commandant_spec.rb
CHANGED
@@ -63,7 +63,7 @@ describe Commandant do
|
|
63
63
|
end
|
64
64
|
|
65
65
|
it "defaults to the :main command, if available" do
|
66
|
-
Commandant.run(%w{ some args }).should == 'main called with [
|
66
|
+
Commandant.run(%w{ some args }).should == 'main called with ["some", "args"]'
|
67
67
|
end
|
68
68
|
|
69
69
|
it "runs the main command if no arguments are passed" do
|