FIX: Plugin transpilation should work in workspaces that aren't called

`discourse`
This commit is contained in:
Robin Ward 2014-05-20 16:54:59 -04:00
parent 4d3c19f736
commit 010da29957
1 changed files with 2 additions and 1 deletions

View File

@ -92,8 +92,9 @@ module Tilt
def module_name(root_path, logical_path)
path = nil
root_base = File.basename(Rails.root)
# If the resource is a plugin, use the plugin name as a prefix
if root_path =~ /(.*\/discourse\/plugins\/[^\/]+)\//
if root_path =~ /(.*\/#{root_base}\/plugins\/[^\/]+)\//
plugin_path = "#{Regexp.last_match[1]}/plugin.rb"
plugin = Discourse.plugins.find {|p| p.path == plugin_path }