Parent

GemInstaller::EnhancedStreamUI

Attributes

outs[W]
errs[W]
gem_interaction_handler[W]

Public Class Methods

new() click to toggle source
   # File lib/geminstaller/enhanced_stream_ui.rb, line 6
6:     def initialize()
7:       # override default constructor to have no args
8:     end

Public Instance Methods

alert_error(statement, question=nil) click to toggle source
    # File lib/geminstaller/enhanced_stream_ui.rb, line 51
51:     def alert_error(statement, question=nil)
52:       # if alert_error got called due to a GemInstaller::UnexpectedPromptError, re-throw it
53:       last_exception = $!
54:       if last_exception.class == GemInstaller::UnauthorizedDependencyPromptError || last_exception.class == GemInstaller::RubyGemsExit
55:         raise last_exception
56:       end
57:       # otherwise let alert_error continue normally...
58:       super(statement, question)
59:     end
ask(question) click to toggle source
    # File lib/geminstaller/enhanced_stream_ui.rb, line 24
24:     def ask(question)
25:       raise_unexpected_prompt_error(question)
26:     end
ask_yes_no(question, default=nil) click to toggle source
    # File lib/geminstaller/enhanced_stream_ui.rb, line 10
10:     def ask_yes_no(question, default=nil)
11:       if GemInstaller::RubyGemsVersionChecker.matches?('<=0.9.4')
12:         # Using defaults, we expect no interactive prompts RubyGems >= 0.9.5
13:         begin
14:           @gem_interaction_handler.handle_ask_yes_no(question)
15:         rescue Exception => e
16:           @outs.print(question)
17:           @outs.flush
18:           raise e
19:         end
20:       end
21:       raise_unexpected_prompt_error(question)
22:     end
choose_from_list(question, list) click to toggle source
    # File lib/geminstaller/enhanced_stream_ui.rb, line 28
28:     def choose_from_list(question, list)
29:       if GemInstaller::RubyGemsVersionChecker.matches?('<=0.9.4')
30:         # Using defaults, we expect no interactive prompts RubyGems >= 0.9.5
31:         @gem_interaction_handler.handle_choose_from_list(question, list)
32:       else
33:         list_string = list.join("\n")
34:         question_and_list = "#{question}\n#{list_string}"
35:         raise_unexpected_prompt_error(question_and_list)
36:       end
37:     end
terminate_interaction(status=0) click to toggle source
    # File lib/geminstaller/enhanced_stream_ui.rb, line 45
45:     def terminate_interaction(status=0)
46:       raise_error(status) unless status == 0
47:       raise GemInstaller::RubyGemsExit.new(status)
48:     end
terminate_interaction!(status=-1) click to toggle source

explicit exit in terminate_interation was removed after 1.0.1

    # File lib/geminstaller/enhanced_stream_ui.rb, line 41
41:     def terminate_interaction!(status=1)
42:       raise_error(status)
43:     end

Protected Instance Methods

raise_error(status) click to toggle source
    # File lib/geminstaller/enhanced_stream_ui.rb, line 62
62:     def raise_error(status)
63:       raise GemInstaller::GemInstallerError.new("RubyGems exited abnormally.  Status: #{status}\n")
64:     end
raise_unexpected_prompt_error(question) click to toggle source
    # File lib/geminstaller/enhanced_stream_ui.rb, line 66
66:     def raise_unexpected_prompt_error(question)
67:       raise GemInstaller::UnexpectedPromptError.new("GemInstaller Internal Error - Unexpected prompt received from RubyGems: '#{question}'.")
68:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.