lib/cliutils/prefs.rb in cliutils-1.3.1 vs lib/cliutils/prefs.rb in cliutils-1.4.0
- old
+ new
@@ -71,28 +71,18 @@
# question (taking into account any options).
# @param [Hash] p The prompt
# @return [void]
def _deliver_prompt(p)
default = p.default
-
unless @configurator.nil?
section_sym = p.config_section.to_sym
unless @configurator.data[section_sym].nil?
config_val = @configurator.data[section_sym][p.config_key.to_sym]
default = config_val unless config_val.nil?
end
end
- valid_option_chosen = false
- until valid_option_chosen
- response = prompt(p.prompt, default)
- if p.validate(response)
- valid_option_chosen = true
- p.answer = p.evaluate_behaviors(response)
- else
- messenger.error(p.last_error_message)
- end
- end
+ p.deliver(default)
end
# Generates an Array of Prefs based on passed
# in data.
# @param [Hash] pref_data_hash Loaded pref data