lib/puffer/extensions/directive_processor.rb in puffer-0.1.0 vs lib/puffer/extensions/directive_processor.rb in puffer-0.1.1

- old
+ new

@@ -3,33 +3,28 @@ module Puffer module Extensions module DirectiveProcessor extend ActiveSupport::Concern - module InstanceMethods + def process_require_all_directive(path) + raise ArgumentError, "require_all argument must be relative" unless relative?(path) - def process_require_all_directive(path) - raise ArgumentError, "require_all argument must be relative" unless relative?(path) + context.environment.paths.each do |root_path| + root = Pathname.new(root_path).join(path).expand_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) - if root.exist? && root.directory? - context.depend_on(root) - - Dir["#{root}/*"].sort.each do |filename| - if filename == self.file - next - elsif context.asset_requirable?(filename) - context.require_asset(filename) - end + Dir["#{root}/*"].sort.each do |filename| + if filename == self.file + next + elsif context.asset_requirable?(filename) + context.require_asset(filename) end end end end - end - end end end Sprockets::DirectiveProcessor.send :include, Puffer::Extensions::DirectiveProcessor \ No newline at end of file