Skip to content

Commit

Permalink
Decreasing code complexity of meets_required_version?
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodecurnex committed Jan 15, 2014
1 parent 74896f6 commit 5d5d7d4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -676,17 +676,11 @@ def current_command_version
end

def required_command_version
[1, 6, 0, 0]
[1, 6]
end

def meets_required_version?
current_version = self.current_command_version
required_version = self.required_command_version

return current_version[0] >= required_version[0] &&
current_version[1] >= required_version[1] &&
(current_version[2] ? current_version[2] >= required_version[2] : true) &&
(current_version[3] ? current_version[3] >= required_version[3] : true)
(self.current_command_version <=> self.required_command_version) >= 0
end


Expand Down

0 comments on commit 5d5d7d4

Please sign in to comment.