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

Commit

Permalink
Initialize version variables as nil, not ""
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Lance committed Mar 20, 2015
1 parent 1f5404d commit f7a02ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/bundler/definition.rb
Original file line number Diff line number Diff line change
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.any? and lockfile.match(/^ \[(.*)\]$/)
lock_ver = $1
curr_ver = Bundler::VERSION
end

if lock_ver.any? and curr_ver.any?
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 f7a02ef

Please sign in to comment.