Skip to content
krainboltgreene edited this page Jul 21, 2011 · 2 revisions

Like any gem, you can install Forgery two ways depending on it's use.

For normal Ruby development, you need simply use:

$ gem install forgery

This will add it to your gem library, just like any normal gem. You can then use it like any normal gem library. See examples for more.

Rails 3.x

If you're using Rails 3.x you need to do a few extra things (that are probably rote). First step is to add it to your Rails.root/Gemfile, we also suggest specifying the latest version (found on rubygems):

group [:development, :test] do
  gem 'forgery', '0.3.12'
end

Then you'll need to run bundle install to install and lock in your new gem. Next you'll want to run the special Rails 3 generator:

$ [bundle exec] rails generate forgery

Rails 2.x

For Rails 2.x you'll need to do something a little different, by first editing your Rails.root/config/environment.rb and adding this to the configuration block:

config.gem 'forgery'

Then you'll need to run this in your command line:

$ script/generate forgery

Generators

This Rails generators will make these directories in your Rails.root directory:

- Rails.root/lib/forgery
- Rails.root/lib/forgery/dictionaries
- Rails.root/lib/forgery/extensions
- Rails.root/lib/forgery/forgeries
- Rails.root/lib/forgery/formats

You can then use these directories to write your own dictionaries, class extensions, forgeries, and formats.

Clone this wiki locally