Module: Thor::Actions
Defined Under Namespace
Classes: EmptyDirectory, TemplateDirectory
Instance Method Summary
collapse
Instance Method Details
#run(command, config = {}) ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/fwtoolkit/cli/ext/thor.rb', line 6
def run(command, config={})
command_output = run_base(command, config)
if config[:raise_errors] && !$?.success?
command_output.gsub!(/e\[\d+m/, '') say "An error has occured while running: \"#{command}\"", :red
say 'Command output:'
raise Thor::Error, "\n***\n#{command_output}***"
end
end
|
#run!(command, config = {}) ⇒ Object
16
17
18
19
|
# File 'lib/fwtoolkit/cli/ext/thor.rb', line 16
def run!(command, config={})
config.merge!({ :raise_errors => true })
run command, config
end
|
#run_base ⇒ Object
5
|
# File 'lib/fwtoolkit/cli/ext/thor.rb', line 5
alias_method :run_base, :run
|
#template_directory(source, *args, &block) ⇒ Object
8
9
10
11
12
|
# File 'lib/fwtoolkit/cli/fw_actions/template_dir.rb', line 8
def template_directory(source, *args, &block)
config = args.last.is_a?(Hash) ? args.pop : {}
destination = args.first || source
action TemplateDirectory.new(self, source, destination || source, config, &block)
end
|