Class: Shellplay::Config
- Inherits:
-
ConfigStruct
- Object
- ConfigStruct
- Shellplay::Config
- Includes:
- Cliprompt
- Defined in:
- lib/shellplay/config.rb
Instance Method Summary collapse
-
#initialize(options = nil, input = STDIN, output = STDOUT) ⇒ Config
constructor
A new instance of Config.
- #set_defaults ⇒ Object
- #setup ⇒ Object
Constructor Details
#initialize(options = nil, input = STDIN, output = STDOUT) ⇒ Config
Returns a new instance of Config.
10 11 12 |
# File 'lib/shellplay/config.rb', line 10 def initialize( = nil, input = STDIN, output = STDOUT) super( = nil, input = STDIN, output = STDOUT) end |
Instance Method Details
#set_defaults ⇒ Object
14 15 16 17 |
# File 'lib/shellplay/config.rb', line 14 def set_defaults default :basedir, File.join(ENV['HOME'], '.shellplay') super end |
#setup ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/shellplay/config.rb', line 19 def setup values = {} output.puts Paint['Create a new shellplay configuration:', :blue] values['editor'] = guess 'EDITOR', 'What is the path to launch your text editor?', 'vim' values['prompt'] = ask 'What is the default prompt you want to use?', "\e[36m #{ENV['USER']} > \e[0m" values['timeformat'] = ask 'What is the time format you want to display?', '%.1f' write values end |