Class: CC::CLI::Prepare
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, #require_codeclimate_yml, 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
#run ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/cc/cli/prepare.rb', line 31 def run require_codeclimate_yml fatal("No fetches configured") unless fetches.present? Dir.chdir(CC::Analyzer::MountedPath.code.container_path) do ::CC::Resolv.with_fixed_dns { fetch_all } end success("All fetches fetched") rescue FetchError, InternalHostError => ex fatal(ex.) end |