[Extensions] Don't force an extension to register itself just because it has ruby code.
This commit is contained in:
parent
3dd2a90dec
commit
925938cd5e
@ -27,11 +27,20 @@ module Compass
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def detect_registration
|
||||||
|
@registered = nil
|
||||||
|
yield
|
||||||
|
@registered
|
||||||
|
ensure
|
||||||
|
@registered = nil
|
||||||
|
end
|
||||||
|
|
||||||
def register(name, *arguments)
|
def register(name, *arguments)
|
||||||
|
@registered = Framework.new(name, *arguments)
|
||||||
if idx = ALL.index(self[name])
|
if idx = ALL.index(self[name])
|
||||||
ALL[idx] = Framework.new(name, *arguments)
|
ALL[idx] = @registered
|
||||||
else
|
else
|
||||||
ALL << Framework.new(name, *arguments)
|
ALL << @registered
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,9 +63,10 @@ module Compass
|
|||||||
File.join(directory, File.basename(directory)+".rb")
|
File.join(directory, File.basename(directory)+".rb")
|
||||||
]
|
]
|
||||||
loader = loaders.detect{|l| File.exists?(l)}
|
loader = loaders.detect{|l| File.exists?(l)}
|
||||||
if loader
|
registered_framework = detect_registration do
|
||||||
require loader
|
require loader if loader
|
||||||
else
|
end
|
||||||
|
unless registered_framework
|
||||||
register File.basename(directory), directory
|
register File.basename(directory), directory
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user