Browse files

Updated README.rdoc

  • Loading branch information...
1 parent a15cfca commit 2ce6208c240d3bf1331d39d5922d97d7ba3dda9d @soveran soveran committed Dec 13, 2008
Showing with 21 additions and 2 deletions.
  1. +21 −2 README.rdoc
View
23 README.rdoc
@@ -5,13 +5,34 @@ I use Faker to generate random data, but you can use any method.
== Usage
+With ActiveRecord:
+
class User < ActiveRecord::Base
spawner do |user|
user.name = Faker::Name.name
user.email = Faker::Internet.email
end
end
+With Sequel:
+
+ class User < Sequel::Model
+ extend Spawner
+
+ spawner do |user|
+ user.name = Faker::Name.name
+ user.email = Faker::Internet.email
+ end
+ end
+
+If you don't want to pollute your class definition, you
+can of course use it from outside:
+
+ User.spawner do |user|
+ user.name = Faker::Name.name
+ user.email = Faker::Internet.email
+ end
+
Then, in your test or in any other place:
@user = User.spawn
@@ -28,8 +49,6 @@ Or even this:
== Installation
-You can install it as a Rails plugin or as a gem:
-
$ gem sources -a http://gems.github.com (you only have to do this once)
$ sudo gem install soveran-spawner

0 comments on commit 2ce6208

Please sign in to comment.