Class: RspecProfiling::VCS::GitSvn
- Inherits:
-
Object
- Object
- RspecProfiling::VCS::GitSvn
- Defined in:
- lib/rspec_profiling/vcs/git_svn.rb
Instance Method Summary collapse
- #sha ⇒ Object
- #time ⇒ Object
-
#version_control ⇒ Object
returns nil if using ‘git svn`.
Instance Method Details
#sha ⇒ Object
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 |
#time ⇒ Object
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_control ⇒ Object
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 |