Module: StillActive::BundlerHelper
Instance Method Summary collapse
Instance Method Details
#gemfile_dependencies(gemfile_path: StillActive.config.gemfile_path) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/helpers/bundler_helper.rb', line 7 def gemfile_dependencies(gemfile_path: StillActive.config.gemfile_path) ::Bundler::SharedHelpers.set_env("BUNDLE_GEMFILE", File.(gemfile_path)) gemfile_gems = ::Bundler.definition.dependencies.map(&:name) Bundler .definition .locked_gems .specs .select { |spec| gemfile_gems.include?(spec.name) } .each_with_object([]) { |spec, array| array << { name: spec.name, version: spec.version.version } } end |