fixture_generator 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +6 -6
- data/Rakefile +2 -0
- data/lib/fixture_generator/version.rb +2 -2
- metadata +2 -2
data/README.md
CHANGED
@@ -11,14 +11,14 @@ Installation
|
|
11
11
|
Usage
|
12
12
|
-----
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
class MyFixtureGenerator < FixtureGenerator
|
15
|
+
def populate
|
16
|
+
# Create your records here and add them to the fixture set by calling
|
17
|
+
# 'add_record(record_name, record_object)'. That's it!
|
18
|
+
end
|
18
19
|
end
|
19
|
-
end
|
20
20
|
|
21
|
-
|
21
|
+
rake fixtures:generate GENERATOR="MyFixtureGenerator"
|
22
22
|
|
23
23
|
Author
|
24
24
|
------
|
data/Rakefile
CHANGED
@@ -6,6 +6,8 @@ namespace :fixtures do
|
|
6
6
|
# Work with test db.
|
7
7
|
RAILS_ENV = ENV['RAILS_ENV'] = "test"
|
8
8
|
|
9
|
+
require Rails.root + "/lib/" + ENV['GENERATOR'].underscore
|
10
|
+
|
9
11
|
# Clean the database first.
|
10
12
|
puts "*** FixturePopulator :: Cleaning the database"
|
11
13
|
Rake::Task["cleandbtest"].invoke
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
VERSION = "0.0.
|
1
|
+
class FixtureGenerator
|
2
|
+
VERSION = "0.0.2"
|
3
3
|
end
|