Sha256: 7cd38750c02670cafcaa96151df930f2a5084a37d4d076ce1c8da8193f7afe13

Contents?: true

Size: 803 Bytes

Versions: 16

Compression:

Stored size: 803 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?
        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

16 entries across 16 versions & 1 rubygems

Version Path
fwtoolkit-2.6.4 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.6.3 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.6.2 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.6.1 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.6.0 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.5.0 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.4.0 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.3.6 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.3.5 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.3.4 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.3.3 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.3.2 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.3.1 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.3.0 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.2.4 lib/fwtoolkit/cli/ext/thor.rb
fwtoolkit-2.2.3 lib/fwtoolkit/cli/ext/thor.rb