Class: CC::CLI::Prepare

Inherits:
Command show all
Defined in:
lib/cc/cli/prepare.rb

Constant Summary collapse

ARGUMENT_LIST =
"[--allow-internal-ips]".freeze
SHORT_HELP =
"Run the commands in your prepare step.".freeze
HELP =
"#{SHORT_HELP}\n" \
"\n" \
"    --allow-internal-ips    Allow fetching from internal IPs.".freeze
InternalHostError =
Class.new(StandardError)
FetchError =
Class.new(StandardError)
PRIVATE_ADDRESS_SUBNETS =
[
  IPAddr.new("10.0.0.0/8"),
  IPAddr.new("172.16.0.0/12"),
  IPAddr.new("192.168.0.0/16"),
  IPAddr.new("fd00::/8"),
  IPAddr.new("127.0.0.1"),
  IPAddr.new("0:0:0:0:0:0:0:1"),
].freeze

Constants inherited from Command

Command::CODECLIMATE_YAML, Command::NAMESPACE

Instance Method Summary collapse

Methods inherited from Command

[], abstract!, abstract?, all, command_name, #execute, help, inherited, #initialize, short_help, synopsis

Methods included from Output

#colorize, #fatal, #rainbow, #say, #success, #terminal, #warn

Constructor Details

This class inherits a constructor from CC::CLI::Command

Instance Method Details

#runObject



31
32
33
34
35
# File 'lib/cc/cli/prepare.rb', line 31

def run
  ::CC::Resolv.with_fixed_dns { fetch_all }
rescue FetchError, InternalHostError => ex
  fatal(ex.message)
end