Method: R10K::Module::Forge#expected_version

Defined in:
lib/r10k/module/forge.rb

#expected_versionString

Returns The expected version that the module.

Returns:

  • (String)

    The expected version that the module



92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/r10k/module/forge.rb', line 92

def expected_version
  if @expected_version == :latest
    begin
      if @v3_module.current_release
        @expected_version = @v3_module.current_release.version
      else
        raise PuppetForge::ReleaseNotFound, _("The module %{title} does not appear to have any published releases, cannot determine latest version.") % { title: @title }
      end
    rescue Faraday::ResourceNotFound => e
      raise PuppetForge::ReleaseNotFound, _("The module %{title} does not exist on %{url}.") % {title: @title, url: PuppetForge::V3::Release.conn.url_prefix}, e.backtrace
    end
  end
  @expected_version
end