root/tools/capistrano/lib/capistrano/version.rb
| Revision 8939, 0.7 kB (checked in by minam, 9 months ago) |
|---|
| Line | |
|---|---|
| 1 | module Capistrano |
| 2 | module Version #:nodoc: |
| 3 | # A method for comparing versions of required modules. It expects two |
| 4 | # arrays of integers as parameters, the first being the minimum version |
| 5 | # required, and the second being the actual version available. It returns |
| 6 | # true if the actual version is at least equal to the required version. |
| 7 | def self.check(required, actual) #:nodoc: |
| 8 | required = required.map { |v| "%06d" % v }.join(".") |
| 9 | actual = actual.map { |v| "%06d" % v }.join(".") |
| 10 | return actual >= required |
| 11 | end |
| 12 | |
| 13 | MAJOR = 2 |
| 14 | MINOR = 2 |
| 15 | TINY = 0 |
| 16 | |
| 17 | STRING = [MAJOR, MINOR, TINY].join(".") |
| 18 | |
| 19 | SSH_REQUIRED = [1,0,10] |
| 20 | SFTP_REQUIRED = [1,1,0] |
| 21 | end |
| 22 | end |
Note: See TracBrowser for help on using the browser.