Class: LicenseFinder::Bundler

Inherits:
PackageManager show all
Defined in:
lib/license_finder/package_managers/bundler.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PackageManager

#active?, command_exists?, #current_packages_with_relations, #detected_package_path, installed?, #prepare, takes_priority_over

Constructor Details

#initialize(options = {}) ⇒ Bundler

Returns a new instance of Bundler.



5
6
7
8
9
# File 'lib/license_finder/package_managers/bundler.rb', line 5

def initialize(options = {})
  super
  @ignored_groups = options[:ignored_groups]
  @definition = options[:definition] # dependency injection for tests
end

Class Method Details

.package_management_commandObject



20
21
22
# File 'lib/license_finder/package_managers/bundler.rb', line 20

def self.package_management_command
  'bundle'
end

.prepare_commandObject



24
25
26
# File 'lib/license_finder/package_managers/bundler.rb', line 24

def self.prepare_command
  'bundle install'
end

Instance Method Details

#current_packagesObject



11
12
13
14
15
16
17
18
# File 'lib/license_finder/package_managers/bundler.rb', line 11

def current_packages
  logger.debug self.class, "including groups #{included_groups.inspect}"
  details.map do |gem_detail, bundle_detail|
    BundlerPackage.new(gem_detail, bundle_detail, logger: logger).tap do |package|
      log_package_dependencies package
    end
  end
end

#possible_package_pathsObject



28
29
30
# File 'lib/license_finder/package_managers/bundler.rb', line 28

def possible_package_paths
  [project_path.join('Gemfile')]
end