lib/bunch.rb in bunch-0.1.0 vs lib/bunch.rb in bunch-0.2.0
- old
+ new
@@ -20,10 +20,11 @@
require 'bunch/directory_node'
require 'bunch/file_node'
require 'bunch/coffee_node'
require 'bunch/sass_node'
require 'bunch/null_node'
+require 'bunch/ejs_node'
module Bunch
class CompileError < StandardError
def initialize(exception, filename)
@exception = exception
@@ -45,12 +46,12 @@
IGNORED_PATTERNS.concat File.readlines(fn).map { |f| Regexp.new(f.chomp) }
IGNORED_PATTERNS.uniq!
end
end
- def content_for(path)
- tree_for(normalized_path(path), {}).content
+ def content_for(path, options = {})
+ tree_for(normalized_path(path), options).content
end
def tree_for(path, options)
node = case
when IGNORED_PATTERNS.any? { |p| File.basename(path) =~ p }
@@ -59,9 +60,11 @@
Bunch::DirectoryNode.new(path)
when path =~ /\.coffee$/
Bunch::CoffeeNode.new(path)
when path =~ /\.s(a|c)ss$/
Bunch::SassNode.new(path)
+ when path =~ /\.ejs$/
+ Bunch::EJSNode.new(path)
else
Bunch::FileNode.new(path)
end
node.options = options
node