Sha256: 32c8e77eeb5275242f38dcc65468f66a2795cb2ac3f532c8b0366edd1b0a4206
Contents?: true
Size: 775 Bytes
Versions: 25
Compression:
Stored size: 775 Bytes
Contents
module Spree module Sample def self.load_sample(file) # If file exists within application it takes precedence. path = if File.exist?(File.join(Rails.root, 'db', 'samples', "#{file}.rb")) File.expand_path(File.join(Rails.root, 'db', 'samples', "#{file}.rb")) else # Otherwise we will use this gems default file. File.expand_path(samples_path + "#{file}.rb") end # Check to see if the specified file has been loaded before unless $LOADED_FEATURES.include?(path) require path puts "Loaded #{file.titleize} samples" end end def self.samples_path Pathname.new(File.join(File.dirname(__FILE__), '..', '..', 'db', 'samples')) end end end
Version data entries
25 entries across 25 versions & 1 rubygems