Sha256: 5e66e4f2968ce4a364b1173628fcc73309690c00cc632a9938ef85de64f5837e

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

module HammerCLIForemanRemoteExecution
  module Options
    module Normalizers
      class KeyFileList < ::HammerCLI::Options::Normalizers::KeyValueList
        def description
          _('Comma-separated list of key=file, where file is a path to a text file to be read')
        end

        def format(val)
          Hash[super.map { |key, path| [key, ::File.read(::File.expand_path(path))] }]
        end

        def complete(value)
          Dir[value.to_s+'*'].collect do |file|
            if ::File.directory?(file)
              file+'/'
            else
              file+' '
            end
          end
        end
      end

      class CronLine < ::HammerCLI::Options::Normalizers::AbstractNormalizer
        def description
          _("Cron line format 'a b c d e', where:\n  a. is minute (range: 0-59)\n  b. is hour (range: 0-23)\n  c. is day of month (range: 1-31)\n  d. is month (range: 1-12)\n  e. is day of week (range: 0-6)")
        end

        def format(val)
          val
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hammer_cli_foreman_remote_execution-0.3.0 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.2.3 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.2.2 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.2.1 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.2.0 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.1.2 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.1.1 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.1.0 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.0.6 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.0.5 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb
hammer_cli_foreman_remote_execution-0.0.4 lib/hammer_cli_foreman_remote_execution/options/normalizers.rb