This is close, but can still cause errors... `lock` will be nil if the file doesn't exist, and calling `LockfileParser.new(nil)` raises an error:

```

>> Bundler::LockfileParser.new(nil)
NoMethodError: undefined method `match' for nil:NilClass
        from /Users/andre/src/bundler/bundler/lib/bundler/lockfile_parser.rb:32:in `initialize'
```

I think the fix for this is to do something like:

```ruby
def locked_gems
  return @locked_gems if defined?(@locked_gems)
  @locked_gems = begin
  [... etc ...]
```