class Baha::ContainerOptions::Cmd
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/baha/container_options/cmd.rb, line 12 def initialize(*args) if args.length < 2 then @conf = 'Cmd' super('Cmd',*args) else @conf = args[0] super(*args) end end
split_command(cmd)
click to toggle source
# File lib/baha/container_options/cmd.rb, line 7 def self.split_command(cmd) require 'csv' CSV.parse_line(cmd,{:col_sep => ' ', :skip_blanks => true, :quote_char => '"'}) end
Public Instance Methods
apply(config)
click to toggle source
# File lib/baha/container_options/cmd.rb, line 21 def apply(config) if @value.kind_of?(Array) config[@conf] = @value else config[@conf] = Cmd::split_command(@value) end end
validate!()
click to toggle source
# File lib/baha/container_options/cmd.rb, line 28 def validate! raise ERROR("should be an array or string") unless @value.kind_of?(Array) or @value.kind_of?(String) end