Commit 764ab0f3 authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

scm: Ruby 1.9 compatibility in getting scm version (#4273).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4920 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ae8386b3
......@@ -44,6 +44,9 @@ module Redmine
def scm_command_version
scm_version = scm_version_from_command_line
if scm_version.respond_to?(:force_encoding)
scm_version.force_encoding('ASCII-8BIT')
end
if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)})
m[2].scan(%r{\d+}).collect(&:to_i)
end
......
......@@ -44,6 +44,9 @@ module Redmine
def scm_command_version
scm_version = scm_version_from_command_line
if scm_version.respond_to?(:force_encoding)
scm_version.force_encoding('ASCII-8BIT')
end
if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)}m)
m[2].scan(%r{\d+}).collect(&:to_i)
end
......
......@@ -44,6 +44,9 @@ module Redmine
def darcs_binary_version
darcsversion = darcs_binary_version_from_command_line
if darcsversion.respond_to?(:force_encoding)
darcsversion.force_encoding('ASCII-8BIT')
end
if m = darcsversion.match(%r{\A(.*?)((\d+\.)+\d+)})
m[2].scan(%r{\d+}).collect(&:to_i)
end
......
......@@ -46,6 +46,9 @@ module Redmine
def scm_command_version
scm_version = scm_version_from_command_line
if scm_version.respond_to?(:force_encoding)
scm_version.force_encoding('ASCII-8BIT')
end
if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)})
m[2].scan(%r{\d+}).collect(&:to_i)
end
......
......@@ -55,6 +55,9 @@ module Redmine
# release number (eg 0.9.5 or 1.0) or as a revision
# id composed of 12 hexa characters.
theversion = hgversion_from_command_line
if theversion.respond_to?(:force_encoding)
theversion.force_encoding('ASCII-8BIT')
end
if m = theversion.match(%r{\A(.*?)((\d+\.)+\d+)})
m[2].scan(%r{\d+}).collect(&:to_i)
end
......
......@@ -45,6 +45,9 @@ module Redmine
def svn_binary_version
scm_version = scm_version_from_command_line
if scm_version.respond_to?(:force_encoding)
scm_version.force_encoding('ASCII-8BIT')
end
if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)})
m[2].scan(%r{\d+}).collect(&:to_i)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment