Class: Rubbr::Scm::Subversion
Instance Attribute Summary
Attributes inherited from Base
#date, #executable, #name, #revision
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Subversion
constructor
A new instance of Subversion.
- #parse_scm_stats ⇒ Object
Methods inherited from Base
Methods included from Cli
#color?, #disable_stderr, #disable_stdinn, #disable_stdout, #error, #executable?, #notice, #valid_executable, #warning
Constructor Details
#initialize {|_self| ... } ⇒ Subversion
Returns a new instance of Subversion.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rubbr/scm/subversion.rb', line 9 def initialize super @name = 'Subversion' @executable = valid_executable :svn @revision, @date = parse_scm_stats yield self if block_given? end |
Instance Method Details
#parse_scm_stats ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/rubbr/scm/subversion.rb', line 20 def parse_scm_stats return [nil, nil] unless @executable raw_stats = `#@executable info` revision = raw_stats.scan(/^Revision: (\d+)/).first.first date = raw_stats.scan(/^Last Changed Date: (.+)/).first.first [revision, date] end |