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.19.2 lib/bard/io.rb
bard-0.19.1 lib/bard/io.rb
bard-0.19.0 lib/bard/io.rb
bard-0.18.0 lib/bard/io.rb
bard-0.17.1 lib/bard/io.rb
bard-0.17.0 lib/bard/io.rb
bard-0.16.1 lib/bard/io.rb
bard-0.16.0 lib/bard/io.rb
bard-0.15.5 lib/bard/io.rb
bard-0.15.4 lib/bard/io.rb
bard-0.15.3 lib/bard/io.rb
bard-0.15.2 lib/bard/io.rb
bard-0.15.0 lib/bard/io.rb
bard-0.14.2 lib/bard/io.rb
bard-0.14.1 lib/bard/io.rb
bard-0.14.0 lib/bard/io.rb
bard-0.13.2 lib/bard/io.rb
bard-0.13.1 lib/bard/io.rb
bard-0.13.0 lib/bard/io.rb
bard-0.12.0 lib/bard/io.rb