Sha256: 4a6cbc3592ab17b225ab299bc01a8466095860ad1caf7e826cac1bd0d79d687c

Contents?: true

Size: 497 Bytes

Versions: 16

Compression:

Stored size: 497 Bytes

Contents

module BardIO
  include Term::ANSIColor
  private

    def warn(message)
      $stderr.puts yellow("!!! ") + message
    end

    def fatal(message)
      raise Thor::Error, red("!!! ") + message
    end

    def run_crucial(command, verbose = false)
      status, stdout, stderr = systemu command
      fatal "Running command: #{yellow(command)}: #{stderr}" if status.to_i.nonzero?
      if verbose
        $stdout.puts stdout
        $stderr.puts stderr
      end
      stdout.chomp
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bard-0.6.4 lib/bard/io.rb
bard-0.6.3 lib/bard/io.rb
bard-0.6.2 lib/bard/io.rb
bard-0.6.1 lib/bard/io.rb
bard-0.6.0 lib/bard/io.rb
bard-0.5.8 lib/bard/io.rb
bard-0.5.7 lib/bard/io.rb
bard-0.5.6 lib/bard/io.rb
bard-0.5.5 lib/bard/io.rb
bard-0.5.4 lib/bard/io.rb
bard-0.5.3 lib/bard/io.rb
bard-0.5.2 lib/bard/io.rb
bard-0.5.1 lib/bard/io.rb
bard-0.5.0 lib/bard/io.rb
bard-0.4.0 lib/bard/io.rb
bard-0.3.1 lib/bard/io.rb