Module: SwitchTower::Version

Defined in:
lib/switchtower/version.rb

Overview

:nodoc:

Constant Summary collapse

MAJOR =
1
MINOR =
0
TINY =
1
STRING =
[MAJOR, MINOR, TINY].join(".")
SSH_REQUIRED =
[1,0,8]
SFTP_REQUIRED =
[1,1,0]

Class Method Summary collapse

Class Method Details

.check(expected, actual) ⇒ Object

A method for comparing versions of required modules. It expects two arrays as parameters, and returns true if the first is no more than the second.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/switchtower/version.rb', line 6

def self.check(expected, actual) #:nodoc:
  good = false
  if actual[0] > expected[0]
    good = true
  elsif actual[0] == expected[0]
    if actual[1] > expected[1]
      good = true
    elsif actual[1] == expected[1] && actual[2] >= expected[2]
      good = true
    end
  end

  good
end