Sha256: 4747dd1ee2892aa91edd061492848e8eed83c25b4a56b1c2183f6a0bed8aa018

Contents?: true

Size: 735 Bytes

Versions: 1

Compression:

Stored size: 735 Bytes

Contents

require 'rake'

module Guard
  class Depend
    class Runner
      def run(cmd)
        cmd = [cmd].flatten
        command = cmd.join(' ')

        begin
          UI.info("Running '#{command}'")
          Notifier.notify(command, title: 'Running', image: :success)

          sh(*cmd)

          Notifier.notify("#{command} succeeded", title: 'Success', image: :success)
        rescue Exception => e
          UI.error("Failed to run '#{command}'. Exception was: #{e.class}: #{e.message}")
          UI.debug(e.backtrace.join("\n"))

          Notifier.notify("#{command} failed with #{e}", title: 'Failed', image: :failed)
        end
      end

      private
      include FileUtils
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
guard-depend-0.0.1 lib/guard/depend/runner.rb