Module: RunCommand::ClassMethods

Defined in:
lib/city_watch/util/run_command.rb

Instance Method Summary collapse

Instance Method Details

#command(cmd, opts = {}) ⇒ Object



66
67
68
69
# File 'lib/city_watch/util/run_command.rb', line 66

def command(cmd,opts={})
	options[:command] = cmd
	set_opts opts
end

#dataObject



75
76
77
# File 'lib/city_watch/util/run_command.rb', line 75

def data
	new.data
end

#grep(str) ⇒ Object



71
72
73
# File 'lib/city_watch/util/run_command.rb', line 71

def grep(str)
	options[:grep] = str
end

#optionsObject



62
63
64
# File 'lib/city_watch/util/run_command.rb', line 62

def options
	@opts ||= {}
end

#set_opts(opts = {}) ⇒ Object



57
58
59
60
# File 'lib/city_watch/util/run_command.rb', line 57

def set_opts(opts={})
	@opts = options.merge(opts)
	@command = nil
end