Class: Gel::GitCatalog
- Inherits:
-
Object
- Object
- Gel::GitCatalog
- Defined in:
- lib/gel/git_catalog.rb
Instance Attribute Summary collapse
-
#git_depot ⇒ Object
readonly
Returns the value of attribute git_depot.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#ref_type ⇒ Object
readonly
Returns the value of attribute ref_type.
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
Instance Method Summary collapse
- #checkout_result ⇒ Object
- #gem_info(name) ⇒ Object
-
#initialize(git_depot, remote, ref_type, ref) ⇒ GitCatalog
constructor
A new instance of GitCatalog.
- #path_catalog ⇒ Object
- #prepare ⇒ Object
- #revision ⇒ Object
Constructor Details
#initialize(git_depot, remote, ref_type, ref) ⇒ GitCatalog
Returns a new instance of GitCatalog.
8 9 10 11 12 13 14 15 16 |
# File 'lib/gel/git_catalog.rb', line 8 def initialize(git_depot, remote, ref_type, ref) @git_depot = git_depot @remote = remote @ref_type = ref_type @ref = ref @monitor = Monitor.new @result = nil end |
Instance Attribute Details
#git_depot ⇒ Object (readonly)
Returns the value of attribute git_depot.
6 7 8 |
# File 'lib/gel/git_catalog.rb', line 6 def git_depot @git_depot end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
6 7 8 |
# File 'lib/gel/git_catalog.rb', line 6 def ref @ref end |
#ref_type ⇒ Object (readonly)
Returns the value of attribute ref_type.
6 7 8 |
# File 'lib/gel/git_catalog.rb', line 6 def ref_type @ref_type end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
6 7 8 |
# File 'lib/gel/git_catalog.rb', line 6 def remote @remote end |
Instance Method Details
#checkout_result ⇒ Object
18 19 20 21 |
# File 'lib/gel/git_catalog.rb', line 18 def checkout_result @result || @monitor.synchronize { @result ||= git_depot.resolve_and_checkout(remote, ref) } end |
#gem_info(name) ⇒ Object
27 28 29 |
# File 'lib/gel/git_catalog.rb', line 27 def gem_info(name) path_catalog.gem_info(name) end |
#path_catalog ⇒ Object
31 32 33 |
# File 'lib/gel/git_catalog.rb', line 31 def path_catalog @path_catalog ||= Gel::PathCatalog.new(checkout_result[1]) end |
#prepare ⇒ Object
35 36 37 |
# File 'lib/gel/git_catalog.rb', line 35 def prepare checkout_result end |
#revision ⇒ Object
23 24 25 |
# File 'lib/gel/git_catalog.rb', line 23 def revision checkout_result[0] end |