Sha256: 64b737e47cc7c4663fb9f79f0cec7b84b7dfab50483b09baba2c5f2c33d8c66e
Contents?: true
Size: 1020 Bytes
Versions: 19
Compression:
Stored size: 1020 Bytes
Contents
require 'deliver/deliverfile/dsl' module Deliver module Deliverfile # Deliverfile represents a Deliverfile created by a user of this library class Deliverfile FILE_NAME = "Deliverfile" include Deliver::Deliverfile::Deliverfile::DSL # The path to the used Deliverfile. attr_accessor :path # Loads the Deliverfile from the given path # @param deliver_data (Deliver::Deliverer) The deliverer which handles the # results of running this deliverfile # @param (String) path (optional) to the file itself. This must also include the # filename itself. def initialize(deliver_data, path = nil) path ||= "./#{FILE_NAME}" raise "#{FILE_NAME} not found at path '#{path}'".red unless File.exists?(path.to_s) self.path = path @deliver_data = deliver_data content = File.read(path) eval(content) # this is okay in this case @deliver_data.finished_executing_deliver_file end end end end
Version data entries
19 entries across 19 versions & 1 rubygems