seedbank 0.0.3 → 0.0.4
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/lib/tasks/seed.rake +18 -10
- data/seedbank.gemspec +3 -3
- metadata +3 -3
data/lib/tasks/seed.rake
CHANGED
@@ -2,20 +2,18 @@ namespace :db do
|
|
2
2
|
|
3
3
|
include Seedbank::DSL
|
4
4
|
|
5
|
-
base_dependencies = ['db:seed:original']
|
5
|
+
base_dependencies = ['db:seed:original']
|
6
|
+
override_dependency = []
|
6
7
|
|
8
|
+
common_dependencies = []
|
7
9
|
# Create seed tasks for all the seeds in seeds_path and add them to the dependency
|
8
10
|
# list along with the original db/seeds.rb.
|
9
11
|
Dir.glob(File.join(seeds_root, '*.seeds.rb')).each do |seed_file|
|
10
|
-
|
12
|
+
common_dependencies << define_seed_task(seed_file)
|
11
13
|
end
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
Loads the original seeds in db/seeds.rb followed by db/seeds/*.seeds.rb then
|
16
|
-
db/seeds/environment/*.seeds.rb
|
17
|
-
EOT
|
18
|
-
override_task :seed => base_dependencies + ["db:seed:#{Rails.env}"]
|
14
|
+
|
15
|
+
desc "Loads db/seeds.rb, db/seeds/*.seeds.rb."
|
16
|
+
task ['seed', 'common'] => base_dependencies + common_dependencies
|
19
17
|
|
20
18
|
# Glob through the directories under seeds_path assuming they are all environments
|
21
19
|
# and create a task for each and add it to the dependency list. Then create a task
|
@@ -29,6 +27,16 @@ namespace :db do
|
|
29
27
|
end
|
30
28
|
|
31
29
|
desc "Loads db/seeds.rb, db/seeds/*.seeds.rb and any seeds in db/seeds/#{environment}/*.seeds.rb."
|
32
|
-
task ['seed', environment] =>
|
30
|
+
task ['seed', environment] => ['db:seed:common'] + environment_dependencies
|
31
|
+
|
32
|
+
override_dependency << "db:seed:#{environment}" if Rails.env == environment
|
33
33
|
end
|
34
|
+
|
35
|
+
# Change db:seed task to run all the base seeds tasks defined above.
|
36
|
+
desc <<-EOT
|
37
|
+
Loads the original seeds in db/seeds.rb followed by db/seeds/*.seeds.rb then
|
38
|
+
db/seeds/environment/*.seeds.rb
|
39
|
+
EOT
|
40
|
+
override_task :seed => ['db:seed:common'] + override_dependency
|
41
|
+
|
34
42
|
end
|
data/seedbank.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{seedbank}
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.4"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">=1.2.0") if s.respond_to?(:required_rubygems_version=)
|
6
6
|
s.authors = ["James McCarthy"]
|
7
7
|
s.date = %q{2011-03-20}
|
8
8
|
s.description = %q{
|
9
9
|
Extends Rails seeds to split out complex seeds into multiple
|
10
|
-
|
10
|
+
files and lets each environment have it's own seeds.
|
11
11
|
}
|
12
12
|
s.email = %q{james2mccarthy@gmail.com}
|
13
13
|
s.extra_rdoc_files = [
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.rubygems_version = %q{1.3.5}
|
22
22
|
s.summary = %q{
|
23
23
|
Extends Rails seeds to split out complex seeds into their own file
|
24
|
-
and have different seeds
|
24
|
+
and have different seeds for each environment.
|
25
25
|
}
|
26
26
|
s.test_files = Dir.glob('test/**/*')
|
27
27
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: seedbank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James McCarthy
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version: "0"
|
25
25
|
type: :development
|
26
26
|
version_requirements: *id001
|
27
|
-
description: "\n Extends Rails seeds to split out complex seeds into multiple \n
|
27
|
+
description: "\n Extends Rails seeds to split out complex seeds into multiple \n files and lets each environment have it's own seeds.\n "
|
28
28
|
email: james2mccarthy@gmail.com
|
29
29
|
executables: []
|
30
30
|
|
@@ -76,7 +76,7 @@ rubyforge_project:
|
|
76
76
|
rubygems_version: 1.5.0
|
77
77
|
signing_key:
|
78
78
|
specification_version: 3
|
79
|
-
summary: Extends Rails seeds to split out complex seeds into their own file and have different seeds
|
79
|
+
summary: Extends Rails seeds to split out complex seeds into their own file and have different seeds for each environment.
|
80
80
|
test_files:
|
81
81
|
- test/seedbank_test.rb
|
82
82
|
- test/test_helper.rb
|