Class: PVN::RevisionRegexpOption

Inherits:
RevisionOption show all
Defined in:
lib/pvn/revision/revision_regexp_option.rb

Overview

A revision that is also set by -N and +N.

Direct Known Subclasses

MultipleRevisionsRegexpOption

Constant Summary collapse

TAG_RE =
Regexp.new '^(?:([\-\+]\d+)|(-r(.+)))$'

Constants inherited from BaseRevisionOption

BaseRevisionOption::REVISION_DESCRIPTION

Instance Attribute Summary

Attributes inherited from RevisionOption

#fromdate, #todate

Instance Method Summary collapse

Methods inherited from RevisionOption

#description, #to_svn_revision_date, #value

Methods inherited from BaseRevisionOption

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

Constructor Details

#initialize(revargs = Hash.new) ⇒ RevisionRegexpOption

Returns a new instance of RevisionRegexpOption.



11
12
13
14
# File 'lib/pvn/revision/revision_regexp_option.rb', line 11

def initialize revargs = Hash.new
  revargs[:regexp] = TAG_RE
  super
end

Instance Method Details

#resolve_value(optset, unprocessed) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/pvn/revision/revision_regexp_option.rb', line 16

def resolve_value optset, unprocessed
  val = value
  md  = TAG_RE.match val

  if md && md[3]
    @value = md[3]
  end
  
  super
end