require 'flydata/command/base' require 'flydata/preference/data_entry_preference' module Flydata module Command class Conf < Base def run data_entries = retrieve_data_entries copy_conf_tmpl(data_entries) usage(data_entries) end def copy_templates copy_conf_tmpl(retrieve_data_entries) end def help usage(retrieve_data_entries) end private def copy_conf_tmpl(data_entries) data_entries.each { |de| Flydata::Preference::DataEntryPreference.copy_template(de) } end def usage(data_entries) puts "Data Entry Configuration" puts "=" * 64 cnt = 0 data_entries.each do |de| name = "#{de['display_name']}" || de['name'] file = if Flydata::Preference::DataEntryPreference.configurable?(de) cnt += 1 Flydata::Preference::DataEntryPreference.conf_path(de) else "(not supported)" end puts "#{name.ljust(24)} -> #{file}" end puts "=" * 64 puts if cnt < 1 puts "There are no configurable data entries." else puts "Edit above files to change the configuration." end end end end end