lib/slim-grunt-helpers/models/usemin.rb in slim-grunt-helpers-0.2.1 vs lib/slim-grunt-helpers/models/usemin.rb in slim-grunt-helpers-0.3.0

- old
+ new

@@ -20,37 +20,36 @@ def require(path, options={}) self.include(path, options) unless file_already_included? path end - def each - @links.each { |link| yield(transform_link(link)) } + def each(options={}) + @links.each { |link| yield(transform_link(link, options)) } end def base_options BASE_OPTIONS end - def require_tree(root_path, pattern, relative=false, options={}) + def require_tree(root_path, pattern, options={}) unless root_path.respond_to? :join root_path = Pathname.new(root_path.to_s) end Dir[root_path.join(pattern).to_s].reject do |file| File.directory? file end.each do |file| - file_name = file.to_s - real_root_path = root_path.to_s - real_root_path += '/' if relative + file_name = file.to_s + real_root_path = "#{ root_path }/" file_name[real_root_path] = '' self.require file_name, options end end protected - def transform_link(link) + def transform_link(link, options={}) raise NotImplementedError, 'This method must be implemented in child classes' end private \ No newline at end of file