Sha256: d57584b5d0b3bfc18b66208b8aefd86352e90047e0eb79058ef11a74e41cafec
Contents?: true
Size: 997 Bytes
Versions: 22
Compression:
Stored size: 997 Bytes
Contents
module SimpleDeploy module CLI module Shared def self.parse_attributes(args) attributes = args[:attributes] logger = args[:logger] attrs = [] attributes.each do |attribs| key = attribs.split('=').first.gsub(/\s+/, "") value = attribs.gsub(/^.+?=/, '') logger.info "Read #{key}=#{value}" attrs << { key => value } end attrs end def self.valid_options?(args) provided = args[:provided] required = args[:required] required.each do |opt| unless provided[opt] puts "Option '#{opt} (-#{opt[0]})' required but not specified." exit 1 end end if required.include? :environment unless Config.new.environments.keys.include? provided[:environment] puts "Environment '#{provided[:environment]}' does not exist." exit 1 end end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems