ddollar/github-backup

View on GitHub
lib/github-backup/shell.rb

Summary

Maintainability
A
0 mins
Test Coverage
module GithubBackup
  class Shell
    attr_reader :debug

    def initialize(opts = {})
      @debug = opts[:debug] || false
    end

    def run(command)
      puts "EXECUTING: #{command}" if debug
      IO.popen(command, 'r') do |io|
        output = io.read
        puts "OUTPUT:" if debug
        puts output if debug
      end
    end
  end
end