Class: ConfigEditor
- Inherits:
-
Object
- Object
- ConfigEditor
- Defined in:
- lib/dvdprofiler2xbmc/views/config_editor.rb
Overview
Synopsis
This is a command line config editor
Usage
editor = ConfigEditor.new editor.execute
Instance Method Summary collapse
-
#execute ⇒ Object
Synopsis main execution loop for the config editor.
-
#initialize ⇒ ConfigEditor
constructor
Synopsis.
Constructor Details
#initialize ⇒ ConfigEditor
Synopsis
42 43 |
# File 'lib/dvdprofiler2xbmc/views/config_editor.rb', line 42 def initialize end |
Instance Method Details
#execute ⇒ Object
Synopsis
main execution loop for the config editor
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/dvdprofiler2xbmc/views/config_editor.rb', line 47 def execute report_invalid_config_items begin AppConfig[:logger].info('Configuration Editor') # get the list of config fields fields = AppConfig..collect do |page| page.values.flatten.select do|field| AppConfig.data_type[field] end end.flatten.uniq.compact # edit the fields while(field = ('field', fields)) begin edit_field(field) rescue end end # save changes? if agree("Save? yes/no") {|q| q.default = 'yes'} AppConfig.save end rescue end end |