Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a post_install_message and bumped the version.
- Loading branch information
Showing
6 changed files
with
67 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
module Seedbank | ||
module DSL | ||
|
||
def override_task(*args, &block) | ||
name, params, deps = Rake.application.resolve_args(args.dup) | ||
fq_name = Rake.application.instance_variable_get(:@scope).dup.push(name).join(':') | ||
new_name = "#{fq_name}:original" | ||
Rake::Task.rename_task(fq_name, new_name) | ||
Rake::Task.define_task(*args, &block) | ||
end | ||
# Creates a task namespaced in @seeds_path | ||
|
||
# Creates a task namespaced in @seeds_path | ||
def define_seed_task(seed_file) | ||
relative_root = seed_file.sub(seeds_root + '/', '') | ||
scopes = File.dirname(relative_root).gsub(/^\./, '').split('/').unshift('seed') | ||
fq_name = scopes.push(File.basename(seed_file, '.seeds.rb')).join(':') | ||
|
||
args = { fq_name => 'db:abort_if_pending_migrations' } | ||
task = Rake::Task.define_task(args) { load(seed_file) if File.exist?(seed_file) } | ||
task = Rake::Task.define_task(args) { load(seed_file) if File.exist?(seed_file) } | ||
task.add_description "Load the seed data from #{seed_file}" | ||
fq_name | ||
end | ||
|
||
def seeds_root | ||
Seedbank.seeds_root | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,6 @@ class Railtie < Rails::Railtie | |
rake_tasks do | ||
Seedbank.load_tasks | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,51 @@ | ||
Gem::Specification.new do |s| | ||
s.name = %q{seedbank} | ||
s.version = "0.0.6" | ||
s.version = "0.0.7" | ||
s.date = %q{2011-03-20} | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">=1.2.0") if s.respond_to?(:required_rubygems_version=) | ||
s.rubygems_version = %q{1.3.5} | ||
|
||
s.authors = ["James McCarthy"] | ||
s.date = %q{2011-03-20} | ||
s.email = %q{james2mccarthy@gmail.com} | ||
s.homepage = %q{http://github.com/james2m/seedbank} | ||
s.summary = %q{ | ||
Extends Rails seeds to split out complex seeds into their own file | ||
and have different seeds for each environment. | ||
} | ||
s.description = %q{ | ||
Extends Rails seeds to split out complex seeds into multiple | ||
Extends Rails seeds to split out complex seeds into multiple | ||
files and lets each environment have it's own seeds. | ||
} | ||
s.email = %q{james2mccarthy@gmail.com} | ||
|
||
s.files = Dir.glob('**/*') - Dir.glob('seedbank*.gem') | ||
s.require_paths = ["lib"] | ||
|
||
s.rdoc_options = ["--charset=UTF-8"] | ||
s.extra_rdoc_files = [ | ||
"MIT-LICENSE", | ||
"README.md" | ||
] | ||
s.files = Dir.glob('**/*') - Dir.glob('seedbank*.gem') | ||
s.homepage = %q{http://github.com/james2m/seedbank} | ||
s.rdoc_options = ["--charset=UTF-8"] | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.3.5} | ||
s.summary = %q{ | ||
Extends Rails seeds to split out complex seeds into their own file | ||
and have different seeds for each environment. | ||
} | ||
s.test_files = Dir.glob('test/**/*') | ||
|
||
s.test_files = Dir.glob('test/**/*') | ||
s.add_development_dependency('test-unit') | ||
|
||
s.post_install_message = %q{ | ||
================================================================================ | ||
Rails 2.x | ||
--------- | ||
If you are using Seedbank with Rails 2.x you will need to place the following at | ||
the end of your Rakefile so Rubygems can load the seedbank tasks; | ||
require 'seedbank' | ||
Seedbank.load_tasks if defined?(Seedbank) | ||
Rails 3.x | ||
--------- | ||
Your work here is done! | ||
================================================================================ | ||
} | ||
end | ||
|