class Repository::Transaction

Attributes

comment[R]
conflicts[R]
jobs[R]
user_id[R]

Public Class Methods

new(user_id, comment) click to toggle source
# File lib/repo/repository.rb, line 285
def initialize(user_id, comment)
  @user_id = user_id
  @comment = comment
  @jobs = []
  @conflicts = []
end

Public Instance Methods

add(path, file_data=nil, mime_type=nil) click to toggle source
# File lib/repo/repository.rb, line 296
def add(path, file_data=nil, mime_type=nil)
  @jobs.push(:action => :add, :path => path, :file_data => file_data, :mime_type => mime_type)
end
add_conflict(conflict) click to toggle source
# File lib/repo/repository.rb, line 308
def add_conflict(conflict)
  @conflicts.push(conflict)
end
add_path(path) click to toggle source
# File lib/repo/repository.rb, line 292
def add_path(path)
  @jobs.push(:action => :add_path, :path => path)
end
conflicts?() click to toggle source
# File lib/repo/repository.rb, line 312
def conflicts?
  @conflicts.size > 0
end
has_jobs?() click to toggle source
# File lib/repo/repository.rb, line 316
def has_jobs?
  @jobs.size > 0
end
remove(path, expected_revision_number) click to toggle source
# File lib/repo/repository.rb, line 300
def remove(path, expected_revision_number)
  @jobs.push(:action => :remove, :path => path, :expected_revision_number => expected_revision_number)
end
replace(path, file_data, mime_type, expected_revision_number) click to toggle source
# File lib/repo/repository.rb, line 304
def replace(path, file_data, mime_type, expected_revision_number)
  @jobs.push(:action => :replace, :path => path, :file_data => file_data, :mime_type => mime_type, :expected_revision_number => expected_revision_number)
end