Class: Repository
- Inherits:
-
Object
show all
- Defined in:
- lib/repository.rb,
lib/repository/status.rb,
lib/repository/inspector.rb,
lib/repository/migration.rb,
lib/repository/sequencer.rb,
lib/repository/divergence.rb,
lib/repository/hard_reset.rb,
lib/repository/pending_commit.rb
Defined Under Namespace
Classes: Divergence, HardReset, Inspector, Migration, PendingCommit, Sequencer, Status
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(git_path) ⇒ Repository
Returns a new instance of Repository.
17
18
19
|
# File 'lib/repository.rb', line 17
def initialize(git_path)
@git_path = git_path
end
|
Instance Attribute Details
#git_path ⇒ Object
Returns the value of attribute git_path.
15
16
17
|
# File 'lib/repository.rb', line 15
def git_path
@git_path
end
|
Instance Method Details
#config ⇒ Object
21
22
23
|
# File 'lib/repository.rb', line 21
def config
@config ||= Config::Stack.new(@git_path)
end
|
#database ⇒ Object
25
26
27
|
# File 'lib/repository.rb', line 25
def database
@database ||= Database.new(@git_path.join("objects"))
end
|
#divergence(ref) ⇒ Object
29
30
31
|
# File 'lib/repository.rb', line 29
def divergence(ref)
Divergence.new(self, ref)
end
|
#hard_reset(oid) ⇒ Object
33
34
35
|
# File 'lib/repository.rb', line 33
def hard_reset(oid)
HardReset.new(self, oid).execute
end
|
#index ⇒ Object
37
38
39
|
# File 'lib/repository.rb', line 37
def index
@index ||= Index.new(@git_path.join("index"))
end
|
#migration(tree_diff) ⇒ Object
41
42
43
|
# File 'lib/repository.rb', line 41
def migration(tree_diff)
Migration.new(self, tree_diff)
end
|
#pending_commit ⇒ Object
45
46
47
|
# File 'lib/repository.rb', line 45
def pending_commit
PendingCommit.new(@git_path)
end
|
#refs ⇒ Object
49
50
51
|
# File 'lib/repository.rb', line 49
def refs
@refs ||= Refs.new(@git_path)
end
|
#remotes ⇒ Object
53
54
55
|
# File 'lib/repository.rb', line 53
def remotes
@remotes ||= Remotes.new(config.file(:local))
end
|
#status(commit_oid = nil) ⇒ Object
57
58
59
|
# File 'lib/repository.rb', line 57
def status(commit_oid = nil)
Status.new(self, commit_oid)
end
|
#workspace ⇒ Object
61
62
63
|
# File 'lib/repository.rb', line 61
def workspace
@workspace ||= Workspace.new(@git_path.dirname)
end
|