Class: BundleUpdateInteractive::Latest::Updater

Inherits:
Updater
  • Object
show all
Defined in:
lib/bundle_update_interactive/latest/updater.rb

Instance Method Summary collapse

Methods inherited from Updater

#generate_report

Constructor Details

#initialize(editor: GemfileEditor.new, **kwargs) ⇒ Updater

Returns a new instance of Updater.



9
10
11
12
13
# File 'lib/bundle_update_interactive/latest/updater.rb', line 9

def initialize(editor: GemfileEditor.new, **kwargs)
  super(**kwargs)
  @modified_gemfile = false
  @editor = editor
end

Instance Method Details

#apply_updatesObject



15
16
17
18
19
20
# File 'lib/bundle_update_interactive/latest/updater.rb', line 15

def apply_updates(*, **)
  result = editor.with_relaxed_gemfile { super }
  @modified_gemfile = editor.shift_gemfile
  BundlerCommands.lock
  result
end

#modified_gemfile?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/bundle_update_interactive/latest/updater.rb', line 22

def modified_gemfile?
  @modified_gemfile
end