Class: SVN::Stat

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository_path, revision_number = nil) ⇒ Stat

Returns a new instance of Stat.



7
8
9
10
11
12
13
# File 'lib/svn_stat.rb', line 7

def initialize repository_path, revision_number = nil
  @revision = revision_number || svnlook(youngest)
  @repository_path = repository_path
  @event = SVN_EVENT
  
  @svnlook_path = `which svnlook`.chomp
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



5
6
7
# File 'lib/svn_stat.rb', line 5

def event
  @event
end

#repository_pathObject (readonly)

Returns the value of attribute repository_path.



5
6
7
# File 'lib/svn_stat.rb', line 5

def repository_path
  @repository_path
end

#revisionObject (readonly)

Returns the value of attribute revision.



5
6
7
# File 'lib/svn_stat.rb', line 5

def revision
  @revision
end

Instance Method Details

#authorObject



15
16
17
# File 'lib/svn_stat.rb', line 15

def author
  @author ||= svnlook "author"
end

#dateObject



23
24
25
# File 'lib/svn_stat.rb', line 23

def date
  @date ||= Date.parse(svnlook("date"))
end

#filesObject



27
28
29
30
31
32
33
34
# File 'lib/svn_stat.rb', line 27

def files
  unless @files
    @files = []
    svnlook('changed').each_line{|l| @files << SVN::FileStat.new(l)}
  end
  
  @files
end

#messageObject



19
20
21
# File 'lib/svn_stat.rb', line 19

def message
  @message ||= svnlook "log"
end