Class: PVN::MultipleRevisionsRegexpOption

Inherits:
RevisionRegexpOption show all
Defined in:
lib/pvn/revision/multiple_revisions_option.rb

Overview

A revision option with multiple values.

Direct Known Subclasses

Seek::SeekRevisionOption

Constant Summary collapse

REVISION_DESCRIPTION =
RevisionRegexpOption::REVISION_DESCRIPTION + [ "Multiple revisions can be specified." ]

Constants inherited from RevisionRegexpOption

RevisionRegexpOption::TAG_RE

Instance Attribute Summary

Attributes inherited from RevisionOption

#fromdate, #todate

Instance Method Summary collapse

Methods inherited from RevisionRegexpOption

#initialize

Methods inherited from RevisionOption

#initialize, #to_svn_revision_date, #value

Methods inherited from BaseRevisionOption

#entry, #head?, #relative_to_absolute, #run_log_command

Constructor Details

This class inherits a constructor from PVN::RevisionRegexpOption

Instance Method Details

#descriptionObject



20
21
22
# File 'lib/pvn/revision/multiple_revisions_option.rb', line 20

def description
  REVISION_DESCRIPTION
end

#resolve_value(optset, unprocessed) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/pvn/revision/multiple_revisions_option.rb', line 24

def resolve_value optset, unprocessed
  newvalues = Array.new
  currvalues = value

  currvalues.each do |currval|
    md = TAG_RE.match currval
    if md
      convval = md[2] ? md[3] : relative_to_absolute(currval, unprocessed[0])
      newvalues << convval
    else
      newvalues << currval
    end
  end

  @value = newvalues
end

#set_value(val) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pvn/revision/multiple_revisions_option.rb', line 11

def set_value val
  currval = value
  if currval
    super [ currval, val ].flatten
  else
    super [ val ]
  end
end