Sha256: f860798c6b65fe38a148af7679845409ce024466391c2a8a294b1c24204234b2

Contents?: true

Size: 681 Bytes

Versions: 3

Compression:

Stored size: 681 Bytes

Contents

require_relative 'arg_loader'

module Squib
  # @api private
  module Args

    class InputFile
      include ArgLoader

      def initialize(dsl_method_default = {})
        @dsl_method_default = dsl_method_default
      end

      def self.parameters
        { file: nil,
          sheet: 0,
        }
      end

      def self.expanding_parameters
        parameters.keys # all of them
      end

      def self.params_with_units
        [] # none of them
      end

      def validate_file(arg, _i)
        return nil if arg.nil?
        raise "File #{File.expand_path(arg)} does not exist!" unless File.exists?(arg)
        File.expand_path(arg)
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
squib-0.15.2 lib/squib/args/input_file.rb
squib-0.15.1 lib/squib/args/input_file.rb
squib-0.14.2 lib/squib/args/input_file.rb