pupcap 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ class Pupcap::Action::Cook < Pupcap::Action::Base
17
17
  unless @parsed_options
18
18
  options = default_options.dup
19
19
  OptionParser.new do |opts|
20
- opts.banner = "Usage: #{File.basename($0)} [options] <role> cook"
20
+ opts.banner = "Usage: #{File.basename($0)} cook [options] <role>"
21
21
 
22
22
  opts.on("-f", "--file FILE", "A recipe file to load") do |file|
23
23
  options[:file] = File.expand_path(file)
@@ -22,7 +22,7 @@ class Pupcap::Action::Prepare < Pupcap::Action::Base
22
22
  unless @parsed_options
23
23
  options = default_options.dup
24
24
  OptionParser.new do |opts|
25
- opts.banner = "Usage: #{File.basename($0)} [options] <role> prepare"
25
+ opts.banner = "Usage: #{File.basename($0)} prepare [options] <role>"
26
26
 
27
27
  opts.on("-h", "--help", "Displays this help info") do
28
28
  puts opts
@@ -17,7 +17,7 @@ class Pupcap::Action::Ssh < Pupcap::Action::Base
17
17
  unless @parsed_options
18
18
  options = default_options.dup
19
19
  OptionParser.new do |opts|
20
- opts.banner = "Usage: #{File.basename($0)} [options] <role> ssh"
20
+ opts.banner = "Usage: #{File.basename($0)} [options] ssh <role>"
21
21
 
22
22
  opts.on("-f", "--file FILE", "A recipe file to load") do |file|
23
23
  options[:file] = File.expand_path(file)
@@ -1,9 +1,11 @@
1
1
  namespace :ssh do
2
2
  task :default do
3
3
  server = find_servers_for_task(current_task).first
4
- host = Pupcap::Command.server_host(self, server)
5
- port = Pupcap::Command.server_port(self, server)
6
- exec "ssh #{host} -t -p #{port} -i #{ssh_options[:keys]} '${SHELL} -l'"
4
+ if server
5
+ host = Pupcap::Command.server_host(self, server)
6
+ port = Pupcap::Command.server_port(self, server)
7
+ exec "ssh #{host} -t -p #{port} -i #{ssh_options[:keys]} '${SHELL} -l'"
8
+ end
7
9
  end
8
10
  end
9
11
 
data/lib/pupcap/cli.rb CHANGED
@@ -4,13 +4,12 @@ require 'pupcap'
4
4
  class Pupcap::CLI
5
5
  class << self
6
6
  def start
7
- action = ARGV.last
7
+ action = ARGV.shift
8
8
  if !action || !valid_actions.include?(action)
9
9
  $stderr.puts "Please specify a action to run: #{valid_actions.join("|")}"
10
10
  exit 1
11
11
  end
12
12
 
13
- ARGV.pop
14
13
  require "pupcap/action/#{action}"
15
14
  klass = Pupcap::Action.const_get(action.capitalize)
16
15
  inst = klass.new
@@ -5,7 +5,7 @@ module Pupcap
5
5
 
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 2
8
+ PATCH = 3
9
9
 
10
10
  def self.to_s
11
11
  "#{MAJOR}.#{MINOR}.#{PATCH}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pupcap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: