Class: SVN::FileStat

Inherits:
Object
  • Object
show all
Defined in:
lib/svn_file_stat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ FileStat

Returns a new instance of FileStat.



16
17
18
19
20
21
22
# File 'lib/svn_file_stat.rb', line 16

def initialize line
  @file_flag = SVN::FLAGS[line[0,1]]
  @meta_flag = SVN::FLAGS[line[1,1]]
  @lock_flag = SVN::FLAGS[line[2,1]] == 'L'
  @history_flag = SVN::FLAGS[line[3,1]] == '+'
  @path = line[4..-1]
end

Instance Attribute Details

#file_flagObject (readonly)

Returns the value of attribute file_flag.



14
15
16
# File 'lib/svn_file_stat.rb', line 14

def file_flag
  @file_flag
end

#history_flagObject (readonly)

Returns the value of attribute history_flag.



14
15
16
# File 'lib/svn_file_stat.rb', line 14

def history_flag
  @history_flag
end

#lock_flagObject (readonly)

Returns the value of attribute lock_flag.



14
15
16
# File 'lib/svn_file_stat.rb', line 14

def lock_flag
  @lock_flag
end

#meta_flagObject (readonly)

Returns the value of attribute meta_flag.



14
15
16
# File 'lib/svn_file_stat.rb', line 14

def meta_flag
  @meta_flag
end

#pathObject (readonly)

Returns the value of attribute path.



14
15
16
# File 'lib/svn_file_stat.rb', line 14

def path
  @path
end

Instance Method Details

#modified?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/svn_file_stat.rb', line 28

def modified?
  [:merged, :updated, :modified, :replaced].find{|a| a == @file_flag}
end

#to_sObject



24
25
26
# File 'lib/svn_file_stat.rb', line 24

def to_s
  @path
end