Automatically include all `.hbs` files from plugins

This commit is contained in:
Robin Ward 2014-12-09 12:16:47 -05:00
parent 72efcc8e86
commit cebb47134f
2 changed files with 9 additions and 2 deletions

View File

@ -25,13 +25,20 @@ class Plugin::Instance
@assets = []
@color_schemes = []
# Automatically include all ES6 JS files
if @path
# Automatically include all ES6 JS files
dir = File.dirname(@path)
Dir.glob("#{dir}/assets/javascripts/**/*.js.es6") do |f|
relative = f.sub("#{dir}/assets/", "")
register_asset(relative)
end
# Automatically include all hbs files
Dir.glob("#{dir}/assets/javascripts/**/*.hbs") do |f|
relative = f.sub("#{dir}/assets/", "")
register_asset(relative)
end
end
end

View File

@ -24,7 +24,7 @@ class TrustLevel
end
def valid?(level)
valid_range === level
valid_range === level
end
def valid_range