summaryrefslogtreecommitdiff
path: root/exe
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-07-06 11:03:35 -0600
committermo khan <mo.khan@gmail.com>2020-07-10 08:53:37 -0600
commit36cdb0040abda394264455a1fdf3d6782af95ceb (patch)
tree54093c956c0f4dcf4c2ad352847017aee9a88edc /exe
parentc7385965b4166fb6ab2db3387c67cd54aef1b8df (diff)
Isolate license_management ruby from project
* Target ruby version 2.7.1 * Add spec to fetch gems from a custom source * Add proxy to rubygems.org config * Specify default env vars to support offline environment * Cleanup custom certificates after spec * Inline docker-test script * Do not install license_finder with each installed ruby * Increase gem log verbosity and include backtrace * Extract test fixtures for the different ruby scenarios * Find *.gemspec files in gems dir * Use RUBYLIB to hijack src path * Run scan from project path dir
Diffstat (limited to 'exe')
-rwxr-xr-xexe/scan_bundler24
1 files changed, 24 insertions, 0 deletions
diff --git a/exe/scan_bundler b/exe/scan_bundler
new file mode 100755
index 0000000..a5b792e
--- /dev/null
+++ b/exe/scan_bundler
@@ -0,0 +1,24 @@
+#!/opt/asdf/shims/ruby
+# frozen_string_literal: true
+
+require 'json'
+require 'bundler'
+require 'pathname'
+
+gemfile = ARGV[0]
+lockfile = ARGV[1]
+
+Gem.clear_paths
+Bundler.reset!
+Bundler.configure
+Bundler::Definition.build(gemfile, lockfile, nil).specs.each do |gem|
+ puts JSON.generate({
+ name: gem.name,
+ version: gem.version.to_s,
+ description: gem.description,
+ homepage: gem.homepage,
+ full_gem_path: gem.full_gem_path,
+ licenses: gem.licenses,
+ summary: gem.summary
+ })
+end