lib/teaspoon/suite.rb in teaspoon-0.7.7 vs lib/teaspoon/suite.rb in teaspoon-0.7.8
- old
+ new
@@ -91,10 +91,16 @@
paths = glob.select { |path| path.include?(file) }
return paths unless paths.empty?
false
end
+ def run_hooks(group = :default)
+ config.hooks[group.to_s].each do |hook|
+ hook.call
+ end
+ end
+
protected
def specs
files = specs_from_file
return files unless files.empty?
@@ -118,10 +124,11 @@
end
def asset_from_file(original)
filename = original
Rails.application.config.assets.paths.each do |path|
- filename = filename.gsub(%r(^#{path}[\/|\\]), "")
+ path = path.to_s
+ filename = filename.gsub(%r(^#{Regexp.escape(path)}[\/|\\]), "")
end
raise Teaspoon::AssetNotServable, "#{filename} is not within an asset path" if filename == original
filename.gsub(/(\.js\.coffee|\.coffee)$/, ".js")
end
end