33require 'pathname'
44
55module PuppetReferences
6+ class << self
7+ attr_reader :version_commit
8+ end
9+
610 BASE_DIR = Pathname . new ( File . expand_path ( __FILE__ ) ) . parent . parent
711 PUPPET_DIR = BASE_DIR + 'vendor/openvox'
812 FACTER_DIR = BASE_DIR + 'vendor/openfact'
@@ -38,9 +42,9 @@ def self.build_puppet_references(commit)
3842 ]
3943 config = PuppetReferences ::Config . read
4044 repo = PuppetReferences ::Repo . new ( 'openvox' , PUPPET_DIR , nil , config [ 'puppet' ] [ 'repo' ] )
41- version_commit = commit || repo . describe . split ( '-' ) [ 0 ]
42- puts "Using tag #{ version_commit } "
43- real_commit = repo . checkout ( version_commit )
45+ @ version_commit = commit || repo . describe . split ( '-' ) [ 0 ]
46+ puts "Using tag #{ @ version_commit} "
47+ real_commit = repo . checkout ( @ version_commit)
4448 repo . update_bundle
4549 build_from_list_of_classes ( references , real_commit )
4650 end
@@ -57,13 +61,13 @@ def self.build_facter_references(commit)
5761 # we need the CLI docs for 3.y. We can remove this when we stop building 3.y.
5862 version4 = Gem ::Version . create ( '4.0.0' )
5963 repo = PuppetReferences ::Repo . new ( 'openfact' , FACTER_DIR )
60- version_commit = commit || repo . describe . split ( '-' ) [ 0 ]
61- puts "Using tag #{ version_commit } "
62- real_commit = repo . checkout ( version_commit )
64+ @ version_commit = commit || repo . describe . split ( '-' ) [ 0 ]
65+ puts "Using tag #{ @ version_commit} "
66+ real_commit = repo . checkout ( @ version_commit)
6367 repo . update_bundle
64- if !semantic? ( version_commit ) || ( semantic? ( version_commit ) && Gem ::Version . create ( version_commit ) >= version4 )
68+ if !semantic? ( @ version_commit) || ( semantic? ( @ version_commit) && Gem ::Version . create ( @ version_commit) >= version4 )
6569 references << PuppetReferences ::Facter ::FacterCli
66- elsif semantic? ( version_commit ) && Gem ::Version . create ( version_commit ) < version4
70+ elsif semantic? ( @ version_commit) && Gem ::Version . create ( @ version_commit) < version4
6771 reference = PuppetReferences ::Facter ::FacterCli . new ( real_commit )
6872 reference . build_v3_cli
6973 end
0 commit comments