Class: Svn::Log::ChangedPathStruct

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/svn/logs.rb

Overview

description of a changed path

Instance Method Summary collapse

Instance Method Details

#actionObject

returns a character that represents the type of the change: :added, :deleted, :replaced, :modified



20
21
22
# File 'lib/svn/logs.rb', line 20

def action
  Actions[ self[:action] ]
end

#copied_fromObject

if the node was copied from another path/rev, returns the [path, rev] pair or nil otherwise



36
37
38
# File 'lib/svn/logs.rb', line 36

def copied_from
  [ self[:copyfrom_path], self[:copyfrom_rev] ] if copyfrom_known?
end

#copyfrom_known?Boolean

returns whether the “copied from” values are known

Returns:

  • (Boolean)


30
31
32
# File 'lib/svn/logs.rb', line 30

def copyfrom_known?
  ( self[:copyfrom_rev] >= 0 )
end

#kindObject

returns the path’s node type (:none, :file, :dir, :unknown)



25
26
27
# File 'lib/svn/logs.rb', line 25

def kind
  self[:node_kind]
end

#to_hObject



40
41
42
43
44
# File 'lib/svn/logs.rb', line 40

def to_h
  h = { :action => action, :kind => kind }
  h[:copied_from] = copied_from if copyfrom_known?
  h
end