mirror of
https://github.com/anchore/syft.git
synced 2026-02-14 19:46:42 +01:00
Add sections of interest for Gemfile.lock cataloger (#1749)
- Updated tests to reflect the new sections being added to show they function properly. Closes #1660 Signed-off-by: Shane Dell <shanedell100@gmail.com>
This commit is contained in:
parent
55a90a2ee0
commit
98a6c6efbe
@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
var _ generic.Parser = parseGemFileLockEntries
|
var _ generic.Parser = parseGemFileLockEntries
|
||||||
|
|
||||||
var sectionsOfInterest = internal.NewStringSet("GEM")
|
var sectionsOfInterest = internal.NewStringSet("GEM", "GIT", "PATH", "PLUGIN SOURCE")
|
||||||
|
|
||||||
// parseGemFileLockEntries is a parser function for Gemfile.lock contents, returning all Gems discovered.
|
// parseGemFileLockEntries is a parser function for Gemfile.lock contents, returning all Gems discovered.
|
||||||
func parseGemFileLockEntries(_ source.FileResolver, _ *generic.Environment, reader source.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
|
func parseGemFileLockEntries(_ source.FileResolver, _ *generic.Environment, reader source.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
|
||||||
|
|||||||
@ -26,6 +26,7 @@ func TestParseGemfileLockEntries(t *testing.T) {
|
|||||||
{Name: "coffee-script-source", Version: "1.7.0", PURL: "pkg:gem/coffee-script-source@1.7.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "coffee-script-source", Version: "1.7.0", PURL: "pkg:gem/coffee-script-source@1.7.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "erubis", Version: "2.7.0", PURL: "pkg:gem/erubis@2.7.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "erubis", Version: "2.7.0", PURL: "pkg:gem/erubis@2.7.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "execjs", Version: "2.0.2", PURL: "pkg:gem/execjs@2.0.2", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "execjs", Version: "2.0.2", PURL: "pkg:gem/execjs@2.0.2", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
|
{Name: "google-cloud-errors", Version: "1.3.0", PURL: "pkg:gem/google-cloud-errors@1.3.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "hike", Version: "1.2.3", PURL: "pkg:gem/hike@1.2.3", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "hike", Version: "1.2.3", PURL: "pkg:gem/hike@1.2.3", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "i18n", Version: "0.6.9", PURL: "pkg:gem/i18n@0.6.9", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "i18n", Version: "0.6.9", PURL: "pkg:gem/i18n@0.6.9", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "jbuilder", Version: "2.0.7", PURL: "pkg:gem/jbuilder@2.0.7", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "jbuilder", Version: "2.0.7", PURL: "pkg:gem/jbuilder@2.0.7", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
@ -59,7 +60,7 @@ func TestParseGemfileLockEntries(t *testing.T) {
|
|||||||
{Name: "thread_safe", Version: "0.3.3", PURL: "pkg:gem/thread_safe@0.3.3", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "thread_safe", Version: "0.3.3", PURL: "pkg:gem/thread_safe@0.3.3", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "tilt", Version: "1.4.1", PURL: "pkg:gem/tilt@1.4.1", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "tilt", Version: "1.4.1", PURL: "pkg:gem/tilt@1.4.1", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "treetop", Version: "1.4.15", PURL: "pkg:gem/treetop@1.4.15", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "treetop", Version: "1.4.15", PURL: "pkg:gem/treetop@1.4.15", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "turbolinks", Version: "2.2.2", PURL: "pkg:gem/turbolinks@2.2.2", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "turbolinks", Version: "3.0.0", PURL: "pkg:gem/turbolinks@3.0.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "tzinfo", Version: "1.2.0", PURL: "pkg:gem/tzinfo@1.2.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "tzinfo", Version: "1.2.0", PURL: "pkg:gem/tzinfo@1.2.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "uglifier", Version: "2.5.0", PURL: "pkg:gem/uglifier@2.5.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "uglifier", Version: "2.5.0", PURL: "pkg:gem/uglifier@2.5.0", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
{Name: "unicorn", Version: "4.8.3", PURL: "pkg:gem/unicorn@4.8.3", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
{Name: "unicorn", Version: "4.8.3", PURL: "pkg:gem/unicorn@4.8.3", Locations: locations, Language: pkg.Ruby, Type: pkg.GemPkg},
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
PATH
|
||||||
|
remote: ../google-cloud-errors
|
||||||
|
specs:
|
||||||
|
google-cloud-errors (1.3.0)
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/rails/turbolinks.git
|
||||||
|
revision: 80216ce9d89920bf073709405e3fce6d0a3ccd9a
|
||||||
|
specs:
|
||||||
|
turbolinks (3.0.0)
|
||||||
|
coffee-rails
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
@ -111,8 +123,6 @@ GEM
|
|||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
turbolinks (2.2.2)
|
|
||||||
coffee-rails
|
|
||||||
tzinfo (1.2.0)
|
tzinfo (1.2.0)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (2.5.0)
|
uglifier (2.5.0)
|
||||||
@ -135,6 +145,7 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bootstrap-sass
|
bootstrap-sass
|
||||||
coffee-rails (~> 4.0.0)
|
coffee-rails (~> 4.0.0)
|
||||||
|
google-cloud-errors!
|
||||||
jbuilder (~> 2.0)
|
jbuilder (~> 2.0)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
mysql2 (~> 0.3.16)
|
mysql2 (~> 0.3.16)
|
||||||
@ -144,6 +155,6 @@ DEPENDENCIES
|
|||||||
spring
|
spring
|
||||||
sqlite3
|
sqlite3
|
||||||
therubyracer
|
therubyracer
|
||||||
turbolinks
|
turbolinks!
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
unicorn
|
unicorn
|
||||||
@ -105,6 +105,7 @@ var dirOnlyTestCases = []testCase{
|
|||||||
"coffee-script-source": "1.7.0",
|
"coffee-script-source": "1.7.0",
|
||||||
"erubis": "2.7.0",
|
"erubis": "2.7.0",
|
||||||
"execjs": "2.0.2",
|
"execjs": "2.0.2",
|
||||||
|
"google-cloud-errors": "1.3.0",
|
||||||
"hike": "1.2.3",
|
"hike": "1.2.3",
|
||||||
"i18n": "0.6.9",
|
"i18n": "0.6.9",
|
||||||
"jbuilder": "2.0.7",
|
"jbuilder": "2.0.7",
|
||||||
@ -138,7 +139,7 @@ var dirOnlyTestCases = []testCase{
|
|||||||
"thread_safe": "0.3.3",
|
"thread_safe": "0.3.3",
|
||||||
"tilt": "1.4.1",
|
"tilt": "1.4.1",
|
||||||
"treetop": "1.4.15",
|
"treetop": "1.4.15",
|
||||||
"turbolinks": "2.2.2",
|
"turbolinks": "3.0.0",
|
||||||
"tzinfo": "1.2.0",
|
"tzinfo": "1.2.0",
|
||||||
"uglifier": "2.5.0",
|
"uglifier": "2.5.0",
|
||||||
"unicorn": "4.8.3",
|
"unicorn": "4.8.3",
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
PATH
|
||||||
|
remote: ../google-cloud-errors
|
||||||
|
specs:
|
||||||
|
google-cloud-errors (1.3.0)
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/rails/turbolinks.git
|
||||||
|
revision: 80216ce9d89920bf073709405e3fce6d0a3ccd9a
|
||||||
|
specs:
|
||||||
|
turbolinks (3.0.0)
|
||||||
|
coffee-rails
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
@ -111,8 +123,6 @@ GEM
|
|||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
turbolinks (2.2.2)
|
|
||||||
coffee-rails
|
|
||||||
tzinfo (1.2.0)
|
tzinfo (1.2.0)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (2.5.0)
|
uglifier (2.5.0)
|
||||||
@ -135,6 +145,7 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bootstrap-sass
|
bootstrap-sass
|
||||||
coffee-rails (~> 4.0.0)
|
coffee-rails (~> 4.0.0)
|
||||||
|
google-cloud-errors!
|
||||||
jbuilder (~> 2.0)
|
jbuilder (~> 2.0)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
mysql2 (~> 0.3.16)
|
mysql2 (~> 0.3.16)
|
||||||
@ -144,6 +155,6 @@ DEPENDENCIES
|
|||||||
spring
|
spring
|
||||||
sqlite3
|
sqlite3
|
||||||
therubyracer
|
therubyracer
|
||||||
turbolinks
|
turbolinks!
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
unicorn
|
unicorn
|
||||||
Loading…
x
Reference in New Issue
Block a user