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

#shaObject



12
13
14
15
16
17
18
# File 'lib/rspec_profiling/vcs/git_svn.rb', line 12

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



20
21
22
23
24
25
26
# File 'lib/rspec_profiling/vcs/git_svn.rb', line 20

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