Class: SVNx::LogCommandArgs

Inherits:
CommandArgs show all
Includes:
Loggable
Defined in:
lib/svnx/log/command.rb

Instance Attribute Summary collapse

Attributes inherited from CommandArgs

#path

Instance Method Summary collapse

Constructor Details

#initialize(args = Hash.new) ⇒ LogCommandArgs

Returns a new instance of LogCommandArgs.



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/svnx/log/command.rb', line 41

def initialize args = Hash.new
  @limit = args[:limit]
  @verbose = args[:verbose]
  @use_cache = args[:use_cache].nil? || args[:use_cache]
  @revision = args[:revision]
  info "args      : #{args}"
  info "@limit    : #{@limit}"
  info "@verbose  : #{@verbose}"
  info "@use_cache: #{@use_cache}"
  info "@revision : #{@revision}"
  super
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



36
37
38
# File 'lib/svnx/log/command.rb', line 36

def limit
  @limit
end

#revisionObject (readonly)

Returns the value of attribute revision.



38
39
40
# File 'lib/svnx/log/command.rb', line 38

def revision
  @revision
end

#use_cacheObject (readonly)

Returns the value of attribute use_cache.



39
40
41
# File 'lib/svnx/log/command.rb', line 39

def use_cache
  @use_cache
end

#verboseObject (readonly)

Returns the value of attribute verbose.



37
38
39
# File 'lib/svnx/log/command.rb', line 37

def verbose
  @verbose
end

Instance Method Details

#to_aObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/svnx/log/command.rb', line 54

def to_a
  ary = Array.new
  if @limit
    ary << '--limit' << @limit
  end
  if @verbose
    ary << '-v'
  end

  if @revision
    @revision.each do |rev|
      ary << "-r#{rev}"
    end
  end

  if @path
    ary << @path
  end
  
  ary.compact
end