wcc-base 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b315171b9971db51111de42a8765ea911c174554
4
- data.tar.gz: 4e01c9bc609bbda1536c50e8f694081174c37893
3
+ metadata.gz: e5ffcb2f194975822128b22d2974798fa6f55c2b
4
+ data.tar.gz: c48c096a7543d02f4cfe0a5db226a13ef60fd4aa
5
5
  SHA512:
6
- metadata.gz: 50c8c8805c6ed40b0df94c01f9de2da3d67e463790bc0aeabe13f8cbeb0c10825ed5267cee161db076875d49fea0ed5c660c52fb1a47ac5a8abbeb6b5608576f
7
- data.tar.gz: 2b9c223e56fb34ca0b42da8cabb2efd825bcfc34a76549571d3a219c4c2b3b10ed9b487461041117e9534dc946d87dbbdbf27fd52f8a5d6e88640e92af291ea5
6
+ metadata.gz: a40deac1be76edbaa952ba2477c091afaaf74a3eade3a2e09091f10d15f3fad30ec0c494e5c0ac6375fab7c6c15e8b31702b5eaac52e79c534bb11d47b2713b4
7
+ data.tar.gz: 2d113be9c9dce854322ac690f52b14e87f511fc20902b8c1a3394dd878af0ef379a05b4c070645ae003428c1605bbb33652429ec28cb9583b92f0ec3c08716f7
data/lib/tasks/db.rake CHANGED
@@ -2,7 +2,7 @@ module WCC
2
2
  module RakeHelpers
3
3
 
4
4
  def self.db_config
5
- @config ||= db_config_file_data[ENV['RAILS_ENV'] || 'development'] || {}
5
+ db_config_file_data[ENV['RAILS_ENV'] || 'development'] || {}
6
6
  end
7
7
 
8
8
  def self.db_cmd_with_password(cmd, pw)
@@ -22,10 +22,10 @@ module WCC
22
22
  end
23
23
 
24
24
  def self.db_config_file_data
25
- if defined?(ActiveRecord::Base)
25
+ if defined?(ActiveRecord::Base) && ActiveRecord::Base.configurations.present?
26
26
  ActiveRecord::Base.configurations
27
27
  else
28
- YAML.load_file("config/database.yml")
28
+ @yaml_file ||= YAML.load_file("config/database.yml")
29
29
  end
30
30
  rescue SystemCallError
31
31
  {}
@@ -15,7 +15,7 @@ namespace :db do
15
15
  Rake::Task['db:drop'].enhance ['db:drop_pg_connections']
16
16
 
17
17
  desc 'Dump the pg database to the specified file'
18
- task :dump, :file do |t, args|
18
+ task :dump, [:file] => :environment do |t, args|
19
19
  raise "file argument required" unless args[:file]
20
20
  db_config = WCC::RakeHelpers.db_config
21
21
  command = [
@@ -29,7 +29,7 @@ namespace :db do
29
29
  end
30
30
 
31
31
  desc 'Restore the pg datbase from the specified file'
32
- task :restore, :file do |t, args|
32
+ task :restore, [:file] => :environment do |t, args|
33
33
  raise "file argument required" unless File.exists?(args[:file])
34
34
  db_config = WCC::RakeHelpers.db_config
35
35
  case File.extname(args[:file])
data/lib/wcc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module WCC
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Community Church
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-16 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler