Skip to content

Instantly share code, notes, and snippets.

@knewter
Created March 1, 2012 03:07
Show Gist options
  • Save knewter/1946938 to your computer and use it in GitHub Desktop.
Save knewter/1946938 to your computer and use it in GitHub Desktop.
I N C E P T I O N . . .
nested_vendored_plugins = Dir["./vendor/plugins/mapto/vendor/plugins/**"]
nested_vendored_plugins = Dir["./vendor/plugins/mapto/vendor/cms/vendor/plugins/**"] + nested_vendored_plugins
# THIS DOES NEAT STUFF DON'T REMOVE
inject_nested_plugin = Proc.new do |plugin|
eval <<-EOF
config.plugin_locators.unshift(
Class.new(Rails::Plugin::Locator) do
def plugins
[Rails::Plugin.new(File.expand_path("#{plugin}"))]
end
end
)
EOF
end
# Just take paperclip plugins from mapto, rather than both mapto and cms. Was causing problems.
Dir["./vendor/plugins/mapto/vendor/plugins/paperclip*"].each do |nested_plugin|
inject_nested_plugin.call(nested_plugin)
end
nested_vendored_plugins.each do |nested_plugin|
next if nested_plugin =~ /paperclip/
inject_nested_plugin.call(nested_plugin)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment