Class: Retter::Repository
- Inherits:
-
Object
- Object
- Retter::Repository
- Defined in:
- lib/retter/repository.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(working_dir) ⇒ Repository
constructor
A new instance of Repository.
- #open {|@repo| ... } ⇒ Object
Constructor Details
#initialize(working_dir) ⇒ Repository
Returns a new instance of Repository.
11 12 13 |
# File 'lib/retter/repository.rb', line 11 def initialize(working_dir) @repo = Grit::Repo.new(working_dir.to_s) end |
Class Method Details
.open(working_dir, &block) ⇒ Object
7 8 9 |
# File 'lib/retter/repository.rb', line 7 def self.open(working_dir, &block) new(working_dir).open(&block) end |
Instance Method Details
#open {|@repo| ... } ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/retter/repository.rb', line 15 def open pwd = Dir.pwd Dir.chdir @repo.working_dir yield @repo Dir.chdir pwd end |