Class: PVN::RevisionOption

Inherits:
BaseRevisionOption show all
Defined in:
lib/pvn/revision/revision_option.rb

Direct Known Subclasses

RevisionRegexpOption

Constant Summary

Constants inherited from BaseRevisionOption

BaseRevisionOption::REVISION_DESCRIPTION

Constants inherited from BaseOption

BaseOption::NO_CMDLINE_OPTION

Instance Attribute Summary collapse

Attributes inherited from BaseOption

#default, #description, #name, #negate, #regexp, #tag

Instance Method Summary collapse

Methods inherited from BaseRevisionOption

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

Methods inherited from BaseOption

#exact_match?, #negative_match?, #next_argument, #post_process, #process, #regexp_match?, #resolve_value, #set_value, #takes_value?, #to_command_line, #to_doc, #to_s, #unset

Constructor Details

#initialize(revargs = Hash.new) ⇒ RevisionOption

Returns a new instance of RevisionOption.



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

def initialize revargs = Hash.new
  @fromdate = nil
  @todate = nil
  super :revision, '-r', REVISION_DESCRIPTION, nil, revargs
end

Instance Attribute Details

#fromdateObject

Returns the value of attribute fromdate.



8
9
10
# File 'lib/pvn/revision/revision_option.rb', line 8

def fromdate
  @fromdate
end

#todateObject

Returns the value of attribute todate.



9
10
11
# File 'lib/pvn/revision/revision_option.rb', line 9

def todate
  @todate
end

Instance Method Details

#to_svn_revision_date(date) ⇒ Object



17
18
19
# File 'lib/pvn/revision/revision_option.rb', line 17

def to_svn_revision_date date
  '{' + date.to_s + '}'
end

#valueObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/pvn/revision/revision_option.rb', line 21

def value
  val = nil
  if @fromdate
    val = to_svn_revision_date @fromdate
  end

  if @todate
    val = val ? val + ':' : ''
    val += to_svn_revision_date @todate
  end

  if val
    val
  else
    super
  end
end