Skip to content

Commit fb93891

Browse files
committed
Adopt new handler design for Rubygems packages
We now have these data file handlers: * GemArchiveHandler * GemMetadataArchiveExtractedHandler * GemspecHandler * GemspecInExtractedGemHandler * GemspecInInstalledVendorBundleSpecificationsHandler * GemfileHandler * GemfileInExtractedGemHandler * GemfileLockHandler * GemfileLockInExtractedGemHandler And we assemble these in Packages correctly Also improve minimally gemspec parsing Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent b131074 commit fb93891

File tree

76 files changed

+6396
-969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+6396
-969
lines changed

src/packagedcode/rubygems.py

Lines changed: 332 additions & 372 deletions
Large diffs are not rendered by default.

src/packagedcode/spec.py

Lines changed: 257 additions & 140 deletions
Large diffs are not rendered by default.

tests/packagedcode/data/rubygems/gem/a_okay-0.1.0.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
"license_expression": null,
3434
"declared_license": [],
3535
"notice_text": null,
36-
"contains_source_code": null,
3736
"source_packages": [],
37+
"file_references": [],
3838
"extra_data": {},
3939
"dependencies": [],
40-
"purl": "pkg:gem/[email protected]",
4140
"repository_homepage_url": "https://rubygems.org/gems/a_okay/versions/0.1.0",
4241
"repository_download_url": "https://rubygems.org/downloads/a_okay-0.1.0.gem",
43-
"api_data_url": "https://rubygems.org/api/v2/rubygems/a_okay/versions/0.1.0.json"
42+
"api_data_url": "https://rubygems.org/api/v2/rubygems/a_okay/versions/0.1.0.json",
43+
"datasource_id": "gem_archive",
44+
"purl": "pkg:gem/[email protected]"
4445
}
4546
]

tests/packagedcode/data/rubygems/gem/action_tracker-1.0.2.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"MIT"
4343
],
4444
"notice_text": null,
45-
"contains_source_code": null,
4645
"source_packages": [],
46+
"file_references": [],
4747
"extra_data": {},
4848
"dependencies": [
4949
{
@@ -137,9 +137,10 @@
137137
"resolved_package": {}
138138
}
139139
],
140-
"purl": "pkg:gem/[email protected]",
141140
"repository_homepage_url": "https://rubygems.org/gems/action_tracker/versions/1.0.2",
142141
"repository_download_url": "https://rubygems.org/downloads/action_tracker-1.0.2.gem",
143-
"api_data_url": "https://rubygems.org/api/v2/rubygems/action_tracker/versions/1.0.2.json"
142+
"api_data_url": "https://rubygems.org/api/v2/rubygems/action_tracker/versions/1.0.2.json",
143+
"datasource_id": "gem_archive",
144+
"purl": "pkg:gem/[email protected]"
144145
}
145146
]

tests/packagedcode/data/rubygems/gem/archive-tar-minitar-0.5.2.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
"license_expression": null,
3434
"declared_license": [],
3535
"notice_text": null,
36-
"contains_source_code": null,
3736
"source_packages": [],
37+
"file_references": [],
3838
"extra_data": {},
3939
"dependencies": [],
40-
"purl": "pkg:gem/[email protected]",
4140
"repository_homepage_url": "https://rubygems.org/gems/archive-tar-minitar/versions/0.5.2",
4241
"repository_download_url": "https://rubygems.org/downloads/archive-tar-minitar-0.5.2.gem",
43-
"api_data_url": "https://rubygems.org/api/v2/rubygems/archive-tar-minitar/versions/0.5.2.json"
42+
"api_data_url": "https://rubygems.org/api/v2/rubygems/archive-tar-minitar/versions/0.5.2.json",
43+
"datasource_id": "gem_archive",
44+
"purl": "pkg:gem/[email protected]"
4445
}
4546
]

tests/packagedcode/data/rubygems/gem/blankslate-3.1.3.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"license_expression": null,
4848
"declared_license": [],
4949
"notice_text": null,
50-
"contains_source_code": null,
5150
"source_packages": [],
51+
"file_references": [],
5252
"extra_data": {},
5353
"dependencies": [
5454
{
@@ -70,9 +70,10 @@
7070
"resolved_package": {}
7171
}
7272
],
73-
"purl": "pkg:gem/[email protected]",
7473
"repository_homepage_url": "https://rubygems.org/gems/blankslate/versions/3.1.3",
7574
"repository_download_url": "https://rubygems.org/downloads/blankslate-3.1.3.gem",
76-
"api_data_url": "https://rubygems.org/api/v2/rubygems/blankslate/versions/3.1.3.json"
75+
"api_data_url": "https://rubygems.org/api/v2/rubygems/blankslate/versions/3.1.3.json",
76+
"datasource_id": "gem_archive",
77+
"purl": "pkg:gem/[email protected]"
7778
}
7879
]

tests/packagedcode/data/rubygems/gem/m2r-2.1.0.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"MIT"
5757
],
5858
"notice_text": null,
59-
"contains_source_code": null,
6059
"source_packages": [],
60+
"file_references": [],
6161
"extra_data": {},
6262
"dependencies": [
6363
{
@@ -178,9 +178,10 @@
178178
"resolved_package": {}
179179
}
180180
],
181-
"purl": "pkg:gem/[email protected]",
182181
"repository_homepage_url": "https://rubygems.org/gems/m2r/versions/2.1.0",
183182
"repository_download_url": "https://rubygems.org/downloads/m2r-2.1.0.gem",
184-
"api_data_url": "https://rubygems.org/api/v2/rubygems/m2r/versions/2.1.0.json"
183+
"api_data_url": "https://rubygems.org/api/v2/rubygems/m2r/versions/2.1.0.json",
184+
"datasource_id": "gem_archive",
185+
"purl": "pkg:gem/[email protected]"
185186
}
186187
]

tests/packagedcode/data/rubygems/gem/mysmallidea-address_standardization-0.4.1.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"license_expression": null,
3434
"declared_license": [],
3535
"notice_text": null,
36-
"contains_source_code": null,
3736
"source_packages": [],
37+
"file_references": [],
3838
"extra_data": {},
3939
"dependencies": [
4040
{
@@ -65,9 +65,10 @@
6565
"resolved_package": {}
6666
}
6767
],
68-
"purl": "pkg:gem/[email protected]",
6968
"repository_homepage_url": "https://rubygems.org/gems/mysmallidea-address_standardization/versions/0.4.1",
7069
"repository_download_url": "https://rubygems.org/downloads/mysmallidea-address_standardization-0.4.1.gem",
71-
"api_data_url": "https://rubygems.org/api/v2/rubygems/mysmallidea-address_standardization/versions/0.4.1.json"
70+
"api_data_url": "https://rubygems.org/api/v2/rubygems/mysmallidea-address_standardization/versions/0.4.1.json",
71+
"datasource_id": "gem_archive",
72+
"purl": "pkg:gem/[email protected]"
7273
}
7374
]

tests/packagedcode/data/rubygems/gem/mysmallidea-mad_mimi_mailer-0.0.9.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
"license_expression": null,
3434
"declared_license": [],
3535
"notice_text": null,
36-
"contains_source_code": null,
3736
"source_packages": [],
37+
"file_references": [],
3838
"extra_data": {},
3939
"dependencies": [],
40-
"purl": "pkg:gem/[email protected]",
4140
"repository_homepage_url": "https://rubygems.org/gems/mysmallidea-mad_mimi_mailer/versions/0.0.9",
4241
"repository_download_url": "https://rubygems.org/downloads/mysmallidea-mad_mimi_mailer-0.0.9.gem",
43-
"api_data_url": "https://rubygems.org/api/v2/rubygems/mysmallidea-mad_mimi_mailer/versions/0.0.9.json"
42+
"api_data_url": "https://rubygems.org/api/v2/rubygems/mysmallidea-mad_mimi_mailer/versions/0.0.9.json",
43+
"datasource_id": "gem_archive",
44+
"purl": "pkg:gem/[email protected]"
4445
}
4546
]

tests/packagedcode/data/rubygems/gem/new/dependabot-omnibus-0.87.15.gem.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"Nonstandard"
3636
],
3737
"notice_text": null,
38-
"contains_source_code": null,
3938
"source_packages": [],
39+
"file_references": [],
4040
"extra_data": {},
4141
"dependencies": [
4242
{
@@ -139,9 +139,10 @@
139139
"resolved_package": {}
140140
}
141141
],
142-
"purl": "pkg:gem/[email protected]",
143142
"repository_homepage_url": "https://rubygems.org/gems/dependabot-omnibus/versions/0.87.15",
144143
"repository_download_url": "https://rubygems.org/downloads/dependabot-omnibus-0.87.15.gem",
145-
"api_data_url": "https://rubygems.org/api/v2/rubygems/dependabot-omnibus/versions/0.87.15.json"
144+
"api_data_url": "https://rubygems.org/api/v2/rubygems/dependabot-omnibus/versions/0.87.15.json",
145+
"datasource_id": "gem_archive",
146+
"purl": "pkg:gem/[email protected]"
146147
}
147148
]

0 commit comments

Comments
 (0)