module MyPlugin def self.included(base) base.extend ClassMethods base.send :include, InstanceMethods end module InstanceMethods ... end module ClassMethods ... end end |
class ActiveRecord::Base include MyPlugin end |
# In config/environment.rb: config.gem "aws-s3", :lib => 'aws/s3', :version => "0.5.1" config.gem "money", :version => "1.7.1" config.gem "fastercsv", :version => "1.4.0" config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# Install declared gem dependencies on the system (sudo gem install <gem-name>) rake gems:install # To avoid external libarary dependencies: # 1. Copy declared gems to under RAILS_ROOT/vendor/gems rake gems:unpack # 2. Copy Rails itself to RAILS_ROOT/vendor/rails rake rails:freeze:gems # The Rails version is given by RAILS_GEM_VERSION in config/environment.rb.