##// END OF EJS Templates
scm: Ruby 1.9 compatibility in getting scm version (#4273)....
Toshi MARUYAMA -
r4800:11e4c5c1ea1f
parent child
Show More
@@ -44,6 +44,9 module Redmine
44 44
45 45 def scm_command_version
46 46 scm_version = scm_version_from_command_line
47 if scm_version.respond_to?(:force_encoding)
48 scm_version.force_encoding('ASCII-8BIT')
49 end
47 50 if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)})
48 51 m[2].scan(%r{\d+}).collect(&:to_i)
49 52 end
@@ -44,6 +44,9 module Redmine
44 44
45 45 def scm_command_version
46 46 scm_version = scm_version_from_command_line
47 if scm_version.respond_to?(:force_encoding)
48 scm_version.force_encoding('ASCII-8BIT')
49 end
47 50 if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)}m)
48 51 m[2].scan(%r{\d+}).collect(&:to_i)
49 52 end
@@ -44,6 +44,9 module Redmine
44 44
45 45 def darcs_binary_version
46 46 darcsversion = darcs_binary_version_from_command_line
47 if darcsversion.respond_to?(:force_encoding)
48 darcsversion.force_encoding('ASCII-8BIT')
49 end
47 50 if m = darcsversion.match(%r{\A(.*?)((\d+\.)+\d+)})
48 51 m[2].scan(%r{\d+}).collect(&:to_i)
49 52 end
@@ -46,6 +46,9 module Redmine
46 46
47 47 def scm_command_version
48 48 scm_version = scm_version_from_command_line
49 if scm_version.respond_to?(:force_encoding)
50 scm_version.force_encoding('ASCII-8BIT')
51 end
49 52 if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)})
50 53 m[2].scan(%r{\d+}).collect(&:to_i)
51 54 end
@@ -55,6 +55,9 module Redmine
55 55 # release number (eg 0.9.5 or 1.0) or as a revision
56 56 # id composed of 12 hexa characters.
57 57 theversion = hgversion_from_command_line
58 if theversion.respond_to?(:force_encoding)
59 theversion.force_encoding('ASCII-8BIT')
60 end
58 61 if m = theversion.match(%r{\A(.*?)((\d+\.)+\d+)})
59 62 m[2].scan(%r{\d+}).collect(&:to_i)
60 63 end
@@ -45,6 +45,9 module Redmine
45 45
46 46 def svn_binary_version
47 47 scm_version = scm_version_from_command_line
48 if scm_version.respond_to?(:force_encoding)
49 scm_version.force_encoding('ASCII-8BIT')
50 end
48 51 if m = scm_version.match(%r{\A(.*?)((\d+\.)+\d+)})
49 52 m[2].scan(%r{\d+}).collect(&:to_i)
50 53 end
General Comments 0
You need to be logged in to leave comments. Login now