Class: BundleUpdateInteractive::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/bundle_update_interactive/reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(groups: []) ⇒ Reporter

Returns a new instance of Reporter.



5
6
7
8
9
# File 'lib/bundle_update_interactive/reporter.rb', line 5

def initialize(groups: [])
  @gemfile = Gemfile.parse
  @current_lockfile = Lockfile.parse
  @candidate_gems = current_lockfile.gems_exclusively_installed_by(gemfile: gemfile, groups: groups) if groups.any?
end

Instance Method Details

#generate_reportObject



11
12
13
14
15
16
# File 'lib/bundle_update_interactive/reporter.rb', line 11

def generate_report
  updatable_gems = find_updatable_gems
  withheld_gems = find_withheld_gems(exclude: updatable_gems.keys)

  Report.new(current_lockfile: current_lockfile, updatable_gems: updatable_gems, withheld_gems: withheld_gems)
end