summaryrefslogtreecommitdiff
path: root/lib/rubygems/user_interaction.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2020-09-23 21:02:56 +0900
committerHiroshi SHIBATA <[email protected]>2020-09-23 21:02:56 +0900
commit31a6eaabc165d8a222e176f2c809d90622d88ec2 (patch)
treeb5333db2c13888ede5062ccd8ecca649ea261b4c /lib/rubygems/user_interaction.rb
parentf56fc720ee8cd4b79824a1c3843058b662a302bd (diff)
Manually merged from https://github.com/rubygems/rubygems/pull/2636
Enable Style/EmptyLinesAroundClassBody rubocop cop.
Diffstat (limited to 'lib/rubygems/user_interaction.rb')
-rw-r--r--lib/rubygems/user_interaction.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rubygems/user_interaction.rb b/lib/rubygems/user_interaction.rb
index 27a9957117..fe55c56999 100644
--- a/lib/rubygems/user_interaction.rb
+++ b/lib/rubygems/user_interaction.rb
@@ -172,6 +172,7 @@ end
# Gem::StreamUI implements a simple stream based user interface.
class Gem::StreamUI
+
extend Gem::Deprecate
##
@@ -386,6 +387,7 @@ class Gem::StreamUI
# An absolutely silent progress reporter.
class SilentProgressReporter
+
##
# The count of items is never updated for the silent progress reporter.
@@ -410,12 +412,14 @@ class Gem::StreamUI
def done
end
+
end
##
# A basic dotted progress reporter.
class SimpleProgressReporter
+
include Gem::DefaultUserInteraction
##
@@ -453,12 +457,14 @@ class Gem::StreamUI
def done
@out.puts "\n#{@terminal_message}"
end
+
end
##
# A progress reporter that prints out messages about the current progress.
class VerboseProgressReporter
+
include Gem::DefaultUserInteraction
##
@@ -495,6 +501,7 @@ class Gem::StreamUI
def done
@out.puts @terminal_message
end
+
end
##
@@ -512,6 +519,7 @@ class Gem::StreamUI
# An absolutely silent download reporter.
class SilentDownloadReporter
+
##
# The silent download reporter ignores all arguments
@@ -537,12 +545,14 @@ class Gem::StreamUI
def done
end
+
end
##
# A progress reporter that behaves nicely with threaded downloading.
class ThreadedDownloadReporter
+
MUTEX = Mutex.new
##
@@ -591,7 +601,9 @@ class Gem::StreamUI
@out.puts message
end
end
+
end
+
end
##
@@ -599,6 +611,7 @@ end
# STDOUT, and STDERR.
class Gem::ConsoleUI < Gem::StreamUI
+
##
# The Console UI has no arguments as it defaults to reading input from
# stdin, output to stdout and warnings or errors to stderr.
@@ -606,12 +619,14 @@ class Gem::ConsoleUI < Gem::StreamUI
def initialize
super STDIN, STDOUT, STDERR, true
end
+
end
##
# SilentUI is a UI choice that is absolutely silent.
class Gem::SilentUI < Gem::StreamUI
+
##
# The SilentUI has no arguments as it does not use any stream.
@@ -637,4 +652,5 @@ class Gem::SilentUI < Gem::StreamUI
def progress_reporter(*args) # :nodoc:
SilentProgressReporter.new(@outs, *args)
end
+
end