bard-rake 0.12.3 → 0.13.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32611588bf3bc23fc61216574e170f7c39208187
4
- data.tar.gz: 950850115aed015443dd26ed64eae06aba4388cf
3
+ metadata.gz: 3061f15b0f70e8ce75f26e4cf9fdc1c317406ff8
4
+ data.tar.gz: 0903e133b708d01116136d6f48e59bd0641c3eb4
5
5
  SHA512:
6
- metadata.gz: dbfdc9184559354c70cdbf24cdd7dba58bd45663e10ff2b8149f22209b40217ca757877a0a03b988fa05c6aa51b0725834eab7bcb1123e0b1affc06e14c8eef4
7
- data.tar.gz: 4c7ff4cd725220359042c0d43077a1ebc44f6a1af827c2ea12d796da129f1ec44f08e286c94db0ab0352dfeec9f5e6b21b91d8d4db7b9e72155da6c2f0f83987
6
+ metadata.gz: c82bac001d53ced81b8d5b09e39a51228ba72e428ed59d4a3e60ce34de7947038d734d6b4f89cc16ff89087bd593823be5a70d5aea72c26a9fc34f86b0f05556
7
+ data.tar.gz: bf2b63ac5aa68d3d786e2d4303982f050b8ebf8fd142aa0212b37caa4637ef288f0e566a0b702fe4110e17bf1b3cc75e4689ad37b67cf3b1ef2d9eca32ee6fbe
@@ -1,31 +1,16 @@
1
1
  task :restart do
2
2
  system "touch tmp/restart.txt"
3
+ system "if which passenger-config >/dev/null; then passenger-config restart-app `pwd`; fi"
3
4
  end
4
5
 
5
6
  desc "Bootstrap project"
6
- task :bootstrap => "bootstrap:files" do
7
- invoke_task_if_exists "db:create:all"
8
- invoke_task_if_exists "db:migrate:all"
9
- Rake::Task["restart"].invoke
10
- end
11
-
12
- namespace :bootstrap do
13
- desc "Bootstrap project to run in production"
14
- task :production => "bootstrap:files" do
15
- invoke_task_if_exists "db:create"
16
- invoke_task_if_exists "db:migrate"
17
-
7
+ task :bootstrap do
8
+ system "cp config/database.sample.yml config/database.yml" unless File.exist?('config/database.yml') or !File.exist?('config/database.sample.yml')
9
+ invoke_task_if_exists "db:create"
10
+ invoke_task_if_exists "db:migrate"
11
+ if ENV["RAILS_ENV"] == "production"
18
12
  invoke_task_if_exists "assets:precompile"
19
- invoke_task_if_exists "bootstrap:production:post"
20
- Rake::Task["restart"].invoke
21
- end
22
-
23
- namespace :production do
24
- task :post do
25
- end
26
- end
27
-
28
- task :files do
29
- system "cp config/database.sample.yml config/database.yml" unless File.exist?('config/database.yml') or !File.exist?('config/database.sample.yml')
30
13
  end
14
+ Rake::Task["restart"].invoke
31
15
  end
16
+
@@ -1,60 +1,28 @@
1
1
  if defined?(ActiveRecord)
2
2
  namespace :db do
3
- namespace :migrate do
4
- task :all => [:load_config] do
5
- invoke_task_if_exists :rails_env
6
- run_in_all_environments do |config|
7
- ActiveRecord::Base.establish_connection(config)
8
- ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
9
- ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
10
- ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
11
- end
12
- end
13
-
14
- Rake::Task["db:_dump"].invoke
15
- end
3
+ def production?
4
+ ENV["RAILS_ENV"] == "production"
16
5
  end
17
6
 
18
- namespace :rollback do
19
- task :all => [:load_config] do
20
- invoke_task_if_exists :rails_env
21
- run_in_all_environments do |config|
22
- ActiveRecord::Base.establish_connection(config)
23
- step = ENV['STEP'] ? ENV['STEP'].to_i : 1
24
- ActiveRecord::Migrator.rollback(ActiveRecord::Migrator.migrations_paths, step)
25
- end
26
-
27
- Rake::Task["db:_dump"].invoke
28
- end
7
+ def parallel?
8
+ !!ENV["TEST_ENV_NUMBER"]
29
9
  end
30
10
 
31
- def run_in_all_environments &block
32
- if defined?(ActiveRecord::Tasks::DatabaseTasks)
33
- ActiveRecord::Tasks::DatabaseTasks.send :each_local_configuration, &block
34
- else
35
- configs_for_environment.each &block
11
+ task :create do
12
+ unless production? or parallel?
13
+ invoke_task_if_exists "parallel:create"
36
14
  end
37
15
  end
38
16
 
39
- namespace :drop do
40
- task :current => [:load_config] do
41
- if defined?(ActiveRecord::Tasks::DatabaseTasks)
42
- config = ActiveRecord::Tasks::DatabaseTasks.current_config
43
- ActiveRecord::Tasks::DatabaseTasks.drop config
44
- else
45
- drop_database current_config
46
- end
17
+ task :migrate do
18
+ unless production? or parallel?
19
+ invoke_task_if_exists "parallel:migrate"
47
20
  end
48
21
  end
49
22
 
50
- namespace :create do
51
- task :current => [:load_config] do
52
- if defined?(ActiveRecord::Tasks::DatabaseTasks)
53
- config = ActiveRecord::Tasks::DatabaseTasks.current_config
54
- ActiveRecord::Tasks::DatabaseTasks.create config
55
- else
56
- create_database current_config
57
- end
23
+ task :rollback do
24
+ unless production? or parallel?
25
+ invoke_task_if_exists "parallel:rollback"
58
26
  end
59
27
  end
60
28
  end
@@ -1,6 +1,6 @@
1
1
  module Bard
2
2
  module Rake
3
- VERSION = "0.12.3"
3
+ VERSION = "0.13.0"
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-18 00:00:00.000000000 Z
11
+ date: 2017-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.4.6
102
+ rubygems_version: 2.6.8
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Rake tasks for all bard projects.