diff options
| author | mo khan <mo@mokhan.ca> | 2021-12-12 17:59:24 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-12-12 17:59:24 -0700 |
| commit | a57a38c96980b6b88fb9d4635eb38ad89547e739 (patch) | |
| tree | a818f3ed88012091c006fc0db54cc1a1d320d46a | |
| parent | b47f94f0bfad59cb40f97ee7f518729804285c64 (diff) | |
feat: experiment with dependency updatesdependency-update
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | lib/spandx/core/update_plugin.rb | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 0b38d10..f453d93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -161,4 +161,4 @@ DEPENDENCIES webmock (~> 3.7) BUNDLED WITH - 2.2.19 + 2.2.33 diff --git a/lib/spandx/core/update_plugin.rb b/lib/spandx/core/update_plugin.rb new file mode 100644 index 0000000..3901cf8 --- /dev/null +++ b/lib/spandx/core/update_plugin.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Spandx + module Core + class UpdatePlugin < Spandx::Core::Plugin + def enhance(dependency) + if dependency.package_manager == :rubygems + Dir.chdir(dependency.path.parent) do + Bundler.with_unbundled_env do + puts "Updating... #{dependency.name}" + system "bundle update #{dependency.name} --conservative" + system "git diff" + system "git checkout ." + end + end + end + end + end + end +end |
