Module: GClouder::GSUtil

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Config::Project

load, #project, project

Methods included from Helpers

#hash_to_args, #module_exists?, #to_arg, #to_deep_merge_hash, #valid_json?

Methods included from Logging

#add, #bad, #change, #debug, #error, #fatal, #good, #info, log, loggers, #remove, report, #resource_state, setup, #warn, #warning

Methods included from Config::CLIArgs

check, #cli_args, cli_args, load, valid_resources

Methods included from Shell

#shell

Class Method Details

.included(klass) ⇒ Object



9
10
11
# File 'lib/gclouder/gsutil.rb', line 9

def self.included(klass)
  klass.extend GSUtil
end

Instance Method Details

#gsutil(command, args, force: false) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/gclouder/gsutil.rb', line 13

def gsutil(command, args, force: false)
  info "# gsutil #{command} #{args}" if cli_args[:debug]

  return if cli_args[:dry_run] && !force

  gsutil_exec(command, args)
end

#gsutil_exec(command, args) ⇒ Object



21
22
23
# File 'lib/gclouder/gsutil.rb', line 21

def gsutil_exec(command, args)
  shell("gsutil #{command} #{args}")
end