module Roark::CLI::Shared
Public Instance Methods
aws()
click to toggle source
# File lib/roark/cli/shared.rb, line 30 def aws Roark::Aws::Connection.new :access_key_id => @options[:access_key_id], :aws_secret_key => @options[:secret_access_key], :region => @options[:region] end
command_name()
click to toggle source
# File lib/roark/cli/shared.rb, line 22 def command_name self.class.name.split('::').last.downcase end
help()
click to toggle source
# File lib/roark/cli/shared.rb, line 26 def help puts option_parser.help end
validate_account_ids_format()
click to toggle source
# File lib/roark/cli/shared.rb, line 13 def validate_account_ids_format @options[:account_ids].each do |a| unless a =~ /^[0-9]{12}$/ @logger.error "Account '#{a}' invalid. IDs must be 12 digits without dashes." exit 1 end end end
validate_required_options(options)
click to toggle source
# File lib/roark/cli/shared.rb, line 4 def validate_required_options(options) options.each do |o| unless @options[o] @logger.error "Option '#{o.to_s}' required." exit 1 end end end