@@ -109,6 +109,7 @@ def logger_debug(*args):
109109SVN = 'SVN'
110110GEM = 'GEM'
111111PLATFORMS = 'PLATFORMS'
112+ BUNDLED = 'BUNDLED WITH'
112113DEPENDENCIES = 'DEPENDENCIES'
113114SPECS = ' specs:'
114115
@@ -340,6 +341,7 @@ def get_option(s):
340341 '$' % locals ()).match
341342
342343PLATS = re .compile ('^ (?P<platform>.*)$' ).match
344+ BUNDLED_WITH = re .compile ('^\s+(?P<version>(?:\d+.)+\d+)\s*$' ).match
343345
344346
345347class GemfileLockParser :
@@ -358,6 +360,7 @@ def __init__(self, lockfile):
358360 self .STATES = {
359361 DEPENDENCIES : self .parse_dependency ,
360362 PLATFORMS : self .parse_platform ,
363+ BUNDLED : self .parse_bundler_version ,
361364 GIT : self .parse_options ,
362365 PATH : self .parse_options ,
363366 SVN : self .parse_options ,
@@ -376,6 +379,8 @@ def __init__(self, lockfile):
376379
377380 self .platforms = []
378381
382+ self .bundled_with = None
383+
379384 # init parsing state
380385 self .reset_state ()
381386
@@ -536,6 +541,16 @@ def parse_platform(self, line):
536541 plat = plat .group ('platform' )
537542 self .platforms .append (plat .strip ())
538543
544+ def parse_bundler_version (self , line ):
545+ version = BUNDLED_WITH (line )
546+ if not version :
547+ if TRACE :
548+ logger_debug ('ERROR: parse_bundler_version: '
549+ 'line not matched: %(line)r' % locals ())
550+ return
551+ version = version .group ('version' )
552+ self .bundled_with = version
553+
539554 def flatten (self ):
540555 """
541556 Return the Gems dependency_tree as a sorted list of unique
0 commit comments