Sha256: c5a73b40396afc40b832a23a1d158500aab420a61bfc1bb697f9b607f03d8815

Contents?: true

Size: 832 Bytes

Versions: 3

Compression:

Stored size: 832 Bytes

Contents

require_relative 'arg_loader'

module Squib
  # @api private
  module Args
    class SprueFile
      include ArgLoader

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

      def self.parameters
        {
          sprue: nil
        }
      end

      def self.expanding_parameters
        []
      end

      def self.params_with_units
        [] # none of them
      end

      def validate_template_file(arg)
        return nil if arg.nil?

        thefile = File.exist?(arg) ? arg : builtin(arg)
        raise "File #{File.expand_path(arg)} does not exist!" unless
          File.exist? thefile

        File.expand_path(thefile)
      end

      private

      def builtin(file)
        "#{File.dirname(__FILE__)}/../builtin/sprues/#{file}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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