Class: SafeUpdate::Updater
- Inherits:
-
Object
- Object
- SafeUpdate::Updater
- Defined in:
- lib/safe_update/updater.rb
Instance Method Summary collapse
Instance Method Details
#run(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/safe_update/updater.rb', line 3 def run( = {}) [:push] = [:push].to_i if [:push] check_for_staged_changes check_for_gemfile_lock_changes output_array = bundle_outdated_parseable.split(/\n+/) output_array.to_enum.with_index(1) do |line, index| update_gem(line) `git push` if [:push] && index % [:push] == 0 end # run it once at the very end, so the final commit can be tested in CI `git push` if [:push] puts '-------------' puts '-------------' puts 'FINISHED' end |