Class: RspecProfiling::VCS::GitSvn
- Inherits:
-
Object
- Object
- RspecProfiling::VCS::GitSvn
- Defined in:
- lib/rspec_profiling/vcs/git_svn.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #sha ⇒ Object
- #time ⇒ Object
-
#version_control ⇒ Object
returns nil if using ‘git svn`.
Instance Method Details
#branch ⇒ Object
12 13 14 |
# File 'lib/rspec_profiling/vcs/git_svn.rb', line 12 def branch nil end |
#sha ⇒ Object
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 |
#time ⇒ Object
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_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 |