Class: R10K::Git::Alternates
- Inherits:
-
Object
- Object
- R10K::Git::Alternates
- Defined in:
- lib/r10k/git/alternates.rb
Overview
Manage ‘$GIT_DIR/objects/info/alternates`
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #<<(path) ⇒ Object
- #include?(path) ⇒ Boolean
-
#initialize(git_dir) ⇒ Alternates
constructor
A new instance of Alternates.
- #to_a ⇒ Object
Constructor Details
#initialize(git_dir) ⇒ Alternates
Returns a new instance of Alternates.
13 14 15 |
# File 'lib/r10k/git/alternates.rb', line 13 def initialize(git_dir) @file = Pathname.new(File.join(git_dir, 'objects', 'info', 'alternates')) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
10 11 12 |
# File 'lib/r10k/git/alternates.rb', line 10 def file @file end |
Instance Method Details
#<<(path) ⇒ Object
21 22 23 |
# File 'lib/r10k/git/alternates.rb', line 21 def <<(path) write(to_a << path) end |
#include?(path) ⇒ Boolean
25 26 27 |
# File 'lib/r10k/git/alternates.rb', line 25 def include?(path) to_a.include?(path) end |
#to_a ⇒ Object
17 18 19 |
# File 'lib/r10k/git/alternates.rb', line 17 def to_a read() end |