Class: SVNx::LogCommandArgs

Inherits:
CommandArgs show all
Includes:
Logue::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) ⇒ LogCommandArgs

Returns a new instance of LogCommandArgs.



34
35
36
37
38
39
40
# File 'lib/svnx/log/command.rb', line 34

def initialize args
  @limit = args[:limit]
  @verbose = args[:verbose]
  @use_cache = args.key?(:use_cache) ? args[:use_cache] : false
  @revision = args[:revision]
  super
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



29
30
31
# File 'lib/svnx/log/command.rb', line 29

def limit
  @limit
end

#revisionObject (readonly)

Returns the value of attribute revision.



31
32
33
# File 'lib/svnx/log/command.rb', line 31

def revision
  @revision
end

#use_cacheObject (readonly)

Returns the value of attribute use_cache.



32
33
34
# File 'lib/svnx/log/command.rb', line 32

def use_cache
  @use_cache
end

#verboseObject (readonly)

Returns the value of attribute verbose.



30
31
32
# File 'lib/svnx/log/command.rb', line 30

def verbose
  @verbose
end

Instance Method Details

#to_aObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/svnx/log/command.rb', line 42

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

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

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