A GemfileParser that works from a text lines rather than re-reading a file. Done to avoid reading a file twice.
| 210 | |
| 211 | |
| 212 | class 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 | |
| 237 | def pre_process(line): |
no outgoing calls
no test coverage detected