Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/gemdiff/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class CLI < Thor
CHECKING_FOR_OUTDATED = "Checking for outdated gems in your bundle..."
NOTHING_TO_UPDATE = "Nothing to update."
WORKING_DIRECTORY_IS_NOT_CLEAN = "Your working directory is not clean. Please commit or stash before updating."
RESPONSES_ALL = %w[s A].freeze
RESPONSES_COMPARE = %w[y A].freeze

desc "find <gem>", "Find the github repository URL for a gem"
def find(gem_name)
Expand Down Expand Up @@ -64,12 +66,12 @@ def each
puts CHECKING_FOR_OUTDATED
inspector = BundleInspector.new
puts inspector.outdated
open_all = false
all_action = false
inspector.list.each do |outdated_gem|
puts outdated_gem.compare_message
response = open_all || ask("Open? (y to open, x to exit, A to open all, s to show all to stdout, else skip)")
open_all = response if %w[s A].include?(response)
outdated_gem.compare if %w[y A].include?(response)
response = all_action || ask("Open? (y to open, x to exit, A to open all, s to show all to stdout, else skip)")
all_action = response if RESPONSES_ALL.include?(response)
outdated_gem.compare if RESPONSES_COMPARE.include?(response)
puts outdated_gem.compare_url if response == "s"
break if response == "x"
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "gemdiff"

begin
require "debug"
require "debug" unless ENV["CI"]
rescue LoadError
# ok
end
Loading