Class: RspecProfiling::VCS::GitSvn

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_profiling/vcs/git_svn.rb

Instance Method Summary collapse

Instance Method Details

#branchObject



12
13
14
# File 'lib/rspec_profiling/vcs/git_svn.rb', line 12

def branch
  nil
end

#shaObject



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

def sha
  if version_control.nil?
    `git svn info | grep "Revision" | cut -f2 -d' '`
  else
    `svn info -r 'HEAD' | grep "Revision" | cut -f2 -d' '`
  end
end

#timeObject



24
25
26
27
28
29
30
# File 'lib/rspec_profiling/vcs/git_svn.rb', line 24

def time
  if version_control.nil?
    Time.parse `git svn info | grep "Last Changed Date" | cut -f4,5,6 -d' '`
  else
    Time.parse `svn info -r 'HEAD' | grep "Last Changed Date" | cut -f4,5,6 -d' '`
  end
end

#version_controlObject

returns nil if using ‘git svn`



7
8
9
10
# File 'lib/rspec_profiling/vcs/git_svn.rb', line 7

def version_control
  `[ -d .git/svn  ] && [ x != x"$(ls -A .git/svn/)" ]`
  RspecProfiling::VCS::Svn unless $CHILD_STATUS.success?
end