cbaoth 0.0.4 → 0.0.5
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 +4 -4
- data/lib/base_files/base_rakefile +12 -8
- data/lib/cbaoth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 832ebc9abaff77a7c407f7e69fe99e8f107f02e2
|
4
|
+
data.tar.gz: 25c0cee227502d23c4d94bbf3a74df4d5a8c2d1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c61f8e2d343243f7c3e78a43703575299c115e6f34d3569fd4dd6db93a17303e1e9819dfc890ce6aa2e8ee4ad774469fe09697eedd45d243d6d62147f7b5a26
|
7
|
+
data.tar.gz: 3fe271d34076eadee2bf0c4097e333ca05be8d0cb5fb6222c7dd1f439b118f85e4514346285498216bac9e9935b13467586b298dc201f20e9b7fec301c9a04ef
|
@@ -14,25 +14,29 @@ namespace :db do
|
|
14
14
|
|
15
15
|
task :drop => :environment do
|
16
16
|
puts "----- Drop DB -----"
|
17
|
-
ActiveRecord::Base.
|
17
|
+
ActiveRecord::Base.establish_connection CONFIG["production"]
|
18
|
+
ActiveRecord::Base.connection.tables.each do |table|
|
19
|
+
ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS #{table}")
|
20
|
+
puts "Dropped #{table}"
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
task :create do
|
21
25
|
puts "----- Create DB -----"
|
22
26
|
config = YAML::load(File.open('config/database.yml'))
|
23
|
-
config['production']
|
24
|
-
|
25
|
-
ActiveRecord::Base.
|
27
|
+
base = config['production'].dup
|
28
|
+
base['database'] = 'postgres'
|
29
|
+
db = ActiveRecord::Base.establish_connection base
|
30
|
+
db.connection.create_database CONFIG["production"]["database"]
|
31
|
+
db.disconnect! if db.connected?
|
26
32
|
|
27
|
-
ActiveRecord::Base.establish_connection CONFIG["production"]
|
33
|
+
ActiveRecord::Base.establish_connection CONFIG["production"]
|
28
34
|
end
|
29
35
|
|
30
36
|
task :reset => :environment do
|
31
37
|
puts "----- Reset DB -----"
|
32
38
|
Rake::Task["db:drop"].invoke
|
33
|
-
Rake::Task["db:create"].invoke
|
34
39
|
Rake::Task["db:migrate"].invoke
|
35
|
-
Rake::Task["db:seed"].invoke
|
36
40
|
end
|
37
41
|
|
38
42
|
desc "Truncate all existing data"
|
@@ -60,7 +64,7 @@ namespace :db do
|
|
60
64
|
ActiveRecord::Base.establish_connection config['test']
|
61
65
|
ActiveRecord::Base.connection.create_database CONFIG["test"]["database"]
|
62
66
|
|
63
|
-
ActiveRecord::Base.establish_connection CONFIG["test"]
|
67
|
+
ActiveRecord::Base.establish_connection CONFIG["test"]
|
64
68
|
end
|
65
69
|
end
|
66
70
|
|
data/lib/cbaoth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbaoth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Curtis Ovard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|