Sha256: 72fcc1591be6104b0899172602fc0324b4cdb5b781ba639cd86243ce4248f50b

Contents?: true

Size: 436 Bytes

Versions: 3

Compression:

Stored size: 436 Bytes

Contents

module Todidnt
  class GitCommand
    def initialize(command, options)
      @command = command
      @options = options
    end

    def output_lines
      run!.strip.split(/\n/)
    end

    def run!
      `git #{command_with_options}`
    end

    def command_with_options
      full_command = @command.to_s

      for option in @options
        full_command << " #{option.join(' ')}"
      end

      full_command
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
todidnt-0.2.0 lib/todidnt/git_command.rb
todidnt-0.1.0 lib/todidnt/git_command.rb
todidnt-0.0.0 lib/todidnt/git_command.rb