Class: Gel::GitCatalog

Inherits:
Object
  • Object
show all
Defined in:
lib/gel/git_catalog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_depotObject (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

#refObject (readonly)

Returns the value of attribute ref.



6
7
8
# File 'lib/gel/git_catalog.rb', line 6

def ref
  @ref
end

#ref_typeObject (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

#remoteObject (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_resultObject



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_catalogObject



31
32
33
# File 'lib/gel/git_catalog.rb', line 31

def path_catalog
  @path_catalog ||= Gel::PathCatalog.new(checkout_result[1])
end

#prepareObject



35
36
37
# File 'lib/gel/git_catalog.rb', line 35

def prepare
  checkout_result
end

#revisionObject



23
24
25
# File 'lib/gel/git_catalog.rb', line 23

def revision
  checkout_result[0]
end