Method: Fact::ClearCase#parse_cc_version

Defined in:
lib/fact/clearcase.rb

#parse_cc_version(version_str) ⇒ Object

Parses a string representing ClearCase element version and converts it into a hash with a key for each part of the version string.

version_str is expected to be of the following form:

<file full path>@@<branch name>/{<version number>|CHECKEDOUT.<checkout number>}

Returns a hash with the following keys: :file, :version.



187
188
189
190
191
# File 'lib/fact/clearcase.rb', line 187

def parse_cc_version(version_str)
  if version_str =~ /(.*)@@(.+)\/(CHECKEDOUT\.)?(\d+)$/
    return { :file => $1, :version => "#{$2}/#{$3}#{$4}" }
  end
end