Skip to content

Commit

Permalink
add fallback option on each bundler command failure
Browse files Browse the repository at this point in the history
  • Loading branch information
microsoftly committed Sep 10, 2018
1 parent c864b74 commit 560691d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion analyzers/ruby/ruby.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ func (a *Analyzer) Analyze() (graph.Deps, error) {

gems, err := a.Bundler.List()
if err != nil {
return graph.Deps{}, err
if !shouldFallback {
return graph.Deps{}, err
}

return a.lockfileAnalyzerStrategy(lockfilePath, shouldFallback)
}

imports, deps := FilteredLockfile(gems, lockfile)
Expand Down
4 changes: 1 addition & 3 deletions analyzers/ruby/ruby_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ func TestFallbackOnMissingBundler(t *testing.T) {
"gemfile-lock-path": filepath.Join("testdata", "Gemfile.lock"),
}

useBundlerWithLockfilePathOptions := map[string]interface{}{
"strategy": "list",
}
useBundlerWithLockfilePathOptions := map[string]interface{}{}

gemModuleUsingLockfile := module.Module{
Name: "test",
Expand Down

0 comments on commit 560691d

Please sign in to comment.