MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / LinesBasedGemfileParser

Class LinesBasedGemfileParser

src/packagedcode/spec.py:212–234  ·  view source on GitHub ↗

A GemfileParser that works from a text lines rather than re-reading a file. Done to avoid reading a file twice.

Source from the content-addressed store, hash-verified

210
211
212class LinesBasedGemfileParser(GemfileParser):
213 """
214 A GemfileParser that works from a text lines rather than re-reading a file.
215 Done to avoid reading a file twice.
216 """
217
218 def __init__(self, lines, filepath, appname=''):
219 self.filepath = filepath
220
221 self.current_group = 'runtime'
222
223 self.appname = appname
224 self.dependencies = {
225 'development': [],
226 'runtime': [],
227 'dependency': [],
228 'test': [],
229 'production': [],
230 'metrics': [],
231 }
232 self.contents = lines
233
234 self.gemspec = filepath.endswith(('.gemspec', '.podspec'))
235
236
237def pre_process(line):

Callers 1

get_dependent_packagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected