class Leg::Representations::Git::State

Attributes

args[RW]
conflict[RW]
operation[RW]
step_number[RW]

Public Class Methods

new() click to toggle source
# File lib/leg/representations/git.rb, line 345
def initialize
  @step_number = nil
  @operation = nil
  @args = []
  @conflict = false
end

Public Instance Methods

add_commit!() click to toggle source
# File lib/leg/representations/git.rb, line 357
def add_commit!
  if @operation.nil?
    @operation = :commit
    @args = [1, false]
  elsif @operation == :commit
    @args[0] += 1
  else
    raise "@operation must be :commit or nil"
  end
  self
end
amend!() click to toggle source
# File lib/leg/representations/git.rb, line 369
def amend!
  if @operation.nil?
    @operation = :commit
    @args = [0, true]
  elsif @operation == :commit
    @args[1] = true
  else
    raise "@operation must be :commit or nil"
  end
  self
end
conflict!() click to toggle source
# File lib/leg/representations/git.rb, line 381
def conflict!
  @conflict = true
  self
end
step!(step_number) click to toggle source
# File lib/leg/representations/git.rb, line 352
def step!(step_number)
  @step_number = step_number
  self
end