Class: Gitti::GitMirror
- Inherits:
-
Object
- Object
- Gitti::GitMirror
- Defined in:
- lib/gitti/mirror.rb
Class Method Summary collapse
- .open(path, &blk) ⇒ Object
-
.update(path) ⇒ Object
all-in-one convenience shortcut.
Instance Method Summary collapse
-
#initialize(path) ⇒ GitMirror
constructor
A new instance of GitMirror.
- #open(&blk) ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(path) ⇒ GitMirror
Returns a new instance of GitMirror.
14 15 16 17 18 19 20 |
# File 'lib/gitti/mirror.rb', line 14 def initialize( path ) raise ArgumentError, "dir >#{path}< not found; dir MUST already exist for GitMirror class - sorry" unless Dir.exist?( path ) ## todo/check: check for more dirs and files e.g. ## /info,/objects,/refs, /hooks, HEAD, config, description -- why? why not? raise ArgumentError, "dir >#{path}/objects< not found; dir MUST already be initialized with git for GitMirror class - sorry" unless Dir.exist?( "#{path}/objects" ) @path = path end |
Class Method Details
.open(path, &blk) ⇒ Object
4 5 6 |
# File 'lib/gitti/mirror.rb', line 4 def self.open( path, &blk ) new( path ).open( &blk ) end |
.update(path) ⇒ Object
all-in-one convenience shortcut
8 9 10 |
# File 'lib/gitti/mirror.rb', line 8 def self.update( path ) ### all-in-one convenience shortcut new( path).open { |mirror| mirror.update } end |