Created
October 17, 2013 11:05
-
-
Save edgahan/7023047 to your computer and use it in GitHub Desktop.
Allows angular templates to reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sprockets::DirectiveProcessor | |
# This is basically copied from https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/directive_processor.rb#L289 | |
def process_depend_on_tree_directive(path = ".") | |
if relative?(path) | |
root = pathname.dirname.join(path).expand_path | |
unless (stats = stat(root)) && stats.directory? | |
raise ArgumentError, "depend_on_tree argument must be a directory" | |
end | |
context.depend_on(root) | |
each_entry(root) do |pathname| | |
context.depend_on(pathname) | |
end | |
else | |
# The path must be relative and start with a `./`. | |
raise ArgumentError, "depend_on_tree argument must be a relative path" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment