(cls, location, package_only=False)
| 207 | |
| 208 | @classmethod |
| 209 | def parse(cls, location, package_only=False): |
| 210 | with io.open(location, encoding='utf-8') as loc: |
| 211 | file_contents = loc.read() |
| 212 | |
| 213 | # we use a Pygments formatter for parsing lexed Ruby code |
| 214 | formatted_file_contents = highlight( |
| 215 | file_contents, |
| 216 | RubyLexer(), |
| 217 | ChefMetadataFormatter() |
| 218 | ) |
| 219 | package_data = json.loads(formatted_file_contents) |
| 220 | yield build_package( |
| 221 | package_data=package_data, |
| 222 | datasource_id=cls.datasource_id, |
| 223 | package_only=package_only, |
| 224 | ) |
| 225 | |
| 226 | |
| 227 | def build_package(package_data, datasource_id, package_only=False): |
nothing calls this directly
no test coverage detected