Sha256: 98529cf9696915fda98f3fc7e2795ae4ccf09c5906afd2e19e83627b5cdcb7ec

Contents?: true

Size: 1.21 KB

Versions: 50

Compression:

Stored size: 1.21 KB

Contents

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

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
flydata-0.3.5 lib/flydata/command/conf.rb
flydata-0.3.4 lib/flydata/command/conf.rb
flydata-0.3.3 lib/flydata/command/conf.rb
flydata-0.3.2 lib/flydata/command/conf.rb
flydata-0.3.1 lib/flydata/command/conf.rb
flydata-0.3.0 lib/flydata/command/conf.rb
flydata-0.2.30 lib/flydata/command/conf.rb
flydata-0.2.29 lib/flydata/command/conf.rb
flydata-0.2.28 lib/flydata/command/conf.rb
flydata-0.2.27 lib/flydata/command/conf.rb
flydata-0.2.26 lib/flydata/command/conf.rb
flydata-0.2.25 lib/flydata/command/conf.rb
flydata-0.2.24 lib/flydata/command/conf.rb
flydata-0.2.23 lib/flydata/command/conf.rb
flydata-0.2.22 lib/flydata/command/conf.rb
flydata-0.2.21 lib/flydata/command/conf.rb
flydata-0.2.20 lib/flydata/command/conf.rb
flydata-0.2.19 lib/flydata/command/conf.rb
flydata-0.2.18 lib/flydata/command/conf.rb
flydata-0.2.17 lib/flydata/command/conf.rb