Sha256: 3689965f20b508699e15a72ee906203c2809f1a014296337ad1bb30b6c8470d1

Contents?: true

Size: 419 Bytes

Versions: 6

Compression:

Stored size: 419 Bytes

Contents

require 'term/ansicolor'
require 'rbconfig'

module CSD
  module Shared
    
    include Term::ANSIColor
    
    def run_command(cmd)
      log "Running command: #{cmd}".green.bold
      ret = ''
      IO.popen(cmd) do |stdout|
        stdout.each do |line|
          log line
          ret << line
        end
      end
      ret
    end

    def log(msg)
      puts msg if @options[:verbose]
    end
      
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
csd-0.0.7 lib/csd/shared.rb
csd-0.0.6 lib/csd/shared.rb
csd-0.0.5 lib/csd/shared.rb
csd-0.0.4 lib/csd/shared.rb
csd-0.0.3 lib/csd/shared.rb
csd-0.0.2 lib/csd/shared.rb