Method: Beaker::Options::Parser#parse_git_repos

Defined in:
lib/beaker/options/parser.rb

#parse_git_repos(git_opts) ⇒ Array

Converts array of paths into array of fully qualified git repo URLS with expanded keywords

Supports the following keywords

PUPPET
FACTER
HIERA
HIERA-PUPPET

Examples:

opts = ["PUPPET/3.1"]
parse_git_repos(opts) == ["#{GITREPO}/puppet.git#3.1"]

Parameters:

  • git_opts (Array)

    An array of paths

Returns:

  • (Array)

    An array of fully qualified git repo URLs with expanded keywords



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/beaker/options/parser.rb', line 111

def parse_git_repos(git_opts)
  git_opts.map! { |opt|
    case opt
      when /^PUPPET\//
        opt = "#{repo}/puppet.git##{opt.split('/', 2)[1]}"
      when /^FACTER\//
        opt = "#{repo}/facter.git##{opt.split('/', 2)[1]}"
      when /^HIERA\//
        opt = "#{repo}/hiera.git##{opt.split('/', 2)[1]}"
      when /^HIERA-PUPPET\//
        opt = "#{repo}/hiera-puppet.git##{opt.split('/', 2)[1]}"
    end
    opt
  }
  git_opts
end