# File lib/rhc/wizard.rb, line 10 def self.has_configuration? File.exists? RHC::Config.local_config_path end
Running the setup wizard may change the contents of opts and config if the create_config_stage completes successfully.
# File lib/rhc/wizard.rb, line 36 def initialize(config=RHC::Config.new, opts=Commander::Command::Options.new) @config = config @options = opts @debug = opts.debug if opts end
Public: Runs the setup wizard to make sure ~/.openshift and ~/.ssh are correct
Examples
wizard.run() # => true
Returns nil on failure or true on success
# File lib/rhc/wizard.rb, line 50 def run stages.each do |stage| debug "Running #{stage}" if self.send(stage).nil? return nil end end true end
# File lib/rhc/wizard.rb, line 26 def stages STAGES end
# File lib/rhc/wizard.rb, line 78 def core_auth @core_auth ||= RHC::Auth::Basic.new(options) end
# File lib/rhc/wizard.rb, line 72 def new_client_for_options client_from_options({ :auth => auth, }) end
# File lib/rhc/wizard.rb, line 68 def openshift_server options.server || config['libra_server'] || "openshift.redhat.com" end
# File lib/rhc/wizard.rb, line 105 def print_dot $terminal.instance_variable_get(:@output).print('.') end
# File lib/rhc/wizard.rb, line 82 def token_auth RHC::Auth::Token.new(options, core_auth, token_store) end
# File lib/rhc/wizard.rb, line 97 def token_store @token_store ||= RHC::Auth::TokenStore.new(config.home_conf_path) end
# File lib/rhc/wizard.rb, line 101 def username auth.username if auth.respond_to?(:username) end