Skip to content

Instantly share code, notes, and snippets.

@netshade
Created May 21, 2009 20:10
Show Gist options
  • Save netshade/115692 to your computer and use it in GitHub Desktop.
Save netshade/115692 to your computer and use it in GitHub Desktop.
# For merbists that want to use Rails (or more appropriately, ActiveRecord) plugins that haven't yet
# been turned into gems
# Presumes that there exists a directory in your application root called "plugins"
def emulate_rails_plugins!
Merb.push_path(:plugins, Merb.root / "plugins", "*/lib/**/*.rb")
Dir[Merb.root / "plugins" / "*"].each do |entry|
$: << (entry / "lib")
if File.exists?(entry / "init.rb")
require(entry / "init.rb")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment