Sha256: e503f050b7fdb2f91383b7f9044788999f44aa4c5315fa1560bde4621537599a

Contents?: true

Size: 662 Bytes

Versions: 85

Compression:

Stored size: 662 Bytes

Contents

module BardIO
  include Term::ANSIColor
  private

    def warn(message)
      message = message.new.message if message.superclass == Bard::Error
      $stderr.puts yellow("!   ") + message
    end

    def fatal(message)
      raise Bard::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

    def project_name
      @project_name ||= File.expand_path(".").split("/").last
    end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
bard-0.8.11 lib/bard/io.rb
bard-0.8.10 lib/bard/io.rb
bard-0.8.9 lib/bard/io.rb
bard-0.8.8 lib/bard/io.rb
bard-0.8.7 lib/bard/io.rb
bard-0.8.6 lib/bard/io.rb
bard-0.8.5 lib/bard/io.rb
bard-0.8.4 lib/bard/io.rb
bard-0.8.3 lib/bard/io.rb
bard-0.8.2 lib/bard/io.rb
bard-0.8.1 lib/bard/io.rb
bard-0.8.0 lib/bard/io.rb
bard-0.7.9 lib/bard/io.rb
bard-0.7.8 lib/bard/io.rb
bard-0.7.7 lib/bard/io.rb
bard-0.7.6 lib/bard/io.rb
bard-0.7.5 lib/bard/io.rb
bard-0.7.4 lib/bard/io.rb
bard-0.7.3 lib/bard/io.rb
bard-0.7.2 lib/bard/io.rb