Sha256: 1a20bb01c4bb1fc6ebd2c6d5f85a9b2e483080bfc8003985ea418a6322452ebd
Contents?: true
Size: 1.82 KB
Versions: 19
Compression:
Stored size: 1.82 KB
Contents
require 'sprockets' module Ultimate module Extensions module DirectiveProcessor extend ActiveSupport::Concern def process_require_all_directive(path) raise ArgumentError, "require_all argument must be a relative path" unless relative?(path) context.environment.paths.each do |root_path| root = Pathname.new(root_path).join(path).expand_path if root.exist? && root.directory? context.depend_on(root) #Dir["#{root}/*"].sort.each do |filename| entries(root).each do |pathname| filename = root.join(pathname) if filename == self.file next elsif context.asset_requirable?(filename) context.require_asset(filename) end end end end end # `require_first` requires all the files # inside a first counter single directory. # # //= require_first "./ultimate/underscore" # def process_require_first_directive(path) raise ArgumentError, "require_first argument must be a relative path" unless relative?(path) context.environment.paths.each do |root_path| root = Pathname.new(root_path).join(path).expand_path if root.exist? && root.directory? context.depend_on(root) Rails.logger.info('----------') Rails.logger.info(root) Dir["#{root}/*"].sort.each do |filename| if filename == self.file next elsif context.asset_requirable?(filename) context.require_asset(filename) end end break end end end end end end Sprockets::DirectiveProcessor.send :include, Ultimate::Extensions::DirectiveProcessor
Version data entries
19 entries across 19 versions & 1 rubygems