class Bundler::CLI::Inject

def last_version_number

def last_version_number
  definition = Bundler.definition(true)
  definition.resolve_remotely!
  specs = definition.index[name].sort_by(&:version)
  unless options[:pre]
    specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
  end
  spec = specs.last
  spec.version.to_s
end