Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Init version vars as nil; use existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Lance committed Mar 20, 2015
1 parent eb99167 commit d926226
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/bundler/definition.rb
Expand Up @@ -260,15 +260,15 @@ def lock(file)
# Gemfile.lock. Used in #to_lock.
def lock_version
lockfile = @lockfile_contents
lock_ver = ""
curr_ver = ""
lock_ver = nil
curr_ver = nil

if !lockfile.empty? and lockfile.match(/^ \[(.*)\]$/)
if lockfile and lockfile.match(/^ \[(.*)\]$/)
lock_ver = $1
curr_ver = Bundler::VERSION
end

if !lock_ver.empty? and !curr_ver.empty?
if lock_ver and curr_ver
if Gem::Version.new(curr_ver) >= Gem::Version.new(lock_ver)
ver = curr_ver
else
Expand Down

0 comments on commit d926226

Please sign in to comment.