summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2021-12-12 17:59:24 -0700
committermo khan <mo@mokhan.ca>2021-12-12 17:59:24 -0700
commita57a38c96980b6b88fb9d4635eb38ad89547e739 (patch)
treea818f3ed88012091c006fc0db54cc1a1d320d46a /lib
parentb47f94f0bfad59cb40f97ee7f518729804285c64 (diff)
feat: experiment with dependency updatesdependency-update
Diffstat (limited to 'lib')
-rw-r--r--lib/spandx/core/update_plugin.rb20
1 files changed, 20 insertions, 0 deletions
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