Class: Fog::Bouncer::CLI::AbstractCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/fog/bouncer/cli.rb

Direct Known Subclasses

DiffCommand, MainCommand

Instance Method Summary collapse

Instance Method Details

#confirmObject



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/fog/bouncer/cli.rb', line 46

def confirm
  unless confirmation
    puts
    puts " !    WARNING: This action is not marked as being safe."
    puts " !    To proceed, enter \"confirmation\" or re-run this command with --confirm confirmation"
    puts
    print "> "

    confirmation = $stdin.gets.chomp
  end

  confirmation == "confirmation" || raise("Confirmation failed")
end

#fileObject



60
61
62
63
64
65
66
67
68
# File 'lib/fog/bouncer/cli.rb', line 60

def file
  if @file && File.exists?(File.expand_path(@file))
    File.expand_path(@file)
  elsif File.exists?(File.expand_path("Doorlist"))
    File.expand_path("Doorlist")
  else
    raise("Doorlist not found")
  end
end