class YARD::CLI::Server

def add_gems_from_gemfile(gemfile = nil)

def add_gems_from_gemfile(gemfile = nil)
  require 'bundler'
  gemfile ||= "Gemfile"
  if File.exist?("#{gemfile}.lock")
    Bundler::LockfileParser.new(File.read("#{gemfile}.lock")).specs.each do |spec|
      libraries[spec.name] ||= []
      libraries[spec.name] |= [YARD::Server::LibraryVersion.new(spec.name,
                                                                spec.version.to_s, nil, :gem)]
    end
  else
    log.warn "Cannot find #{gemfile}.lock, ignoring --gemfile option"
  end
rescue LoadError
  log.error "Bundler not available, ignoring --gemfile option"
end