Sha256: 145b433eb44e65b1c22139e3c95525d9a1eea8781ca46037553c086acb98fba7
Contents?: true
Size: 865 Bytes
Versions: 26
Compression:
Stored size: 865 Bytes
Contents
require 'thor' class Thor module Actions alias_method :run_base, :run def run(command, config={}) command_output = run_base(command, config) if config[:raise_errors] && !$?.success? command_output.gsub!(/e\[\d+m/, '') #Stripping colors say "An error has occured while running: \"#{command}\"", :red say 'Command output:' raise Thor::Error, "\n***\n#{command_output}***" end end def run!(command, config={}) config.merge!({ :raise_errors => true }) run command, config end end end class Thor module Actions class EmptyDirectory protected def convert_encoded_instructions(filename) filename.gsub(/%(.*?)%/) do |initial_string| config[$1.strip.to_sym] or call_public_method($1.strip) or initial_string end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems