Module: PEBuild::Util::VersionedPath Private

Defined in:
lib/pe_build/util/versioned_path.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.9.0

Class Method Summary collapse

Class Method Details

.versioned_path(path, version = nil, series = nil) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Substitute release information into a path.

Parameters:

  • path (String)

    A path.

  • version (String, nil) (defaults to: nil)

    A string that will be substituted for any :version token in path.

  • series (String, nil) (defaults to: nil)

    A string that will be substituted for any :series token in path.

Returns:

  • (String)

Since:

  • 0.9.0



17
18
19
20
21
22
23
# File 'lib/pe_build/util/versioned_path.rb', line 17

def self.versioned_path(path, version = nil, series = nil)
  result = path.dup
  result.gsub!(/:version/, version) unless version.nil?
  result.gsub!(/:series/, series) unless series.nil?

  result
end