bard-rake 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.9.0
data/bard-rake.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bard-rake"
8
- s.version = "0.8.0"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Micah Geisel"]
12
- s.date = "2013-03-07"
12
+ s.date = "2013-03-15"
13
13
  s.description = "Rake tasks for all bard projects.\n* Bootstrap projects\n* Database backup"
14
14
  s.email = "micah@botandrose.com"
15
15
  s.extra_rdoc_files = [
@@ -6,10 +6,38 @@ end
6
6
  desc "Bootstrap project"
7
7
  task :bootstrap => "bootstrap:files" do
8
8
  invoke_task_if_exists "db:create"
9
- invoke_task_if_exists "db:migrate"
9
+ Rake::Task["db:migrate:all"].invoke if Rake::Task.task_defined?("db:migrate")
10
10
  Rake::Task["restart"].invoke
11
11
  end
12
12
 
13
+ namespace :db do
14
+ namespace :migrate do
15
+ task :all => [:load_config, :rails_env] do
16
+ configs_for_environment.each do |config|
17
+ ActiveRecord::Base.establish_connection(config)
18
+ ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
19
+ ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
20
+ ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
21
+ end
22
+ end
23
+
24
+ Rake::Task["db:_dump"].invoke
25
+ end
26
+ end
27
+
28
+ namespace :rollback do
29
+ task :all => [:load_config, :rails_env] do
30
+ configs_for_environment.each do |config|
31
+ ActiveRecord::Base.establish_connection(config)
32
+ step = ENV['STEP'] ? ENV['STEP'].to_i : 1
33
+ ActiveRecord::Migrator.rollback(ActiveRecord::Migrator.migrations_paths, step)
34
+ end
35
+
36
+ Rake::Task["db:_dump"].invoke
37
+ end
38
+ end
39
+ end
40
+
13
41
  namespace :bootstrap do
14
42
  desc "Bootstrap project to run in production"
15
43
  task :production => "bootstrap:files" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-rake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 8
8
+ - 9
9
9
  - 0
10
- version: 0.8.0
10
+ version: 0.9.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Micah Geisel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-03-07 00:00:00 Z
18
+ date: 2013-03-15 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  requirement: &id001 !ruby/object:Gem::Requirement