Class: Grit::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/webpage-archivist/patches.rb

Overview

Patching the repo grit class to specify the work tree

Instance Method Summary collapse

Instance Method Details

#add(*files) ⇒ Object



21
22
23
# File 'lib/webpage-archivist/patches.rb', line 21

def add(*files)
  self.git.add({:chdir => self.git.work_tree}, *files.flatten)
end

#archive_zip(id, file) ⇒ Object



33
34
35
# File 'lib/webpage-archivist/patches.rb', line 33

def archive_zip(id, file)
  self.git.archive({:chdir => self.git.work_tree}, "--output=#{file}", id)
end

#commit_index(message) ⇒ Object



29
30
31
# File 'lib/webpage-archivist/patches.rb', line 29

def commit_index(message)
  self.git.commit({:chdir => self.git.work_tree}, '--allow-empty', '-m', message)
end

#remove(*files) ⇒ Object



25
26
27
# File 'lib/webpage-archivist/patches.rb', line 25

def remove(*files)
  self.git.rm({:chdir => self.git.work_tree}, *files.flatten)
end