karo 2.3.6 → 2.3.7
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.
Potentially problematic release.
This version of karo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/karo/db.rb +19 -2
- data/lib/karo/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: 368231ebc105f20e2014dbf8488c698b5b2503b0
|
4
|
+
data.tar.gz: cdff0022408ee2d4292ba7e5b0c535aa7700d544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4938739b61e6287d56d3da3c0152c41061297229c6db9e32e2ecc18003e5cdce21f0517c8fc367685929e5a29cc4cfe9f3674946412b10284b9ef120ba9f3922
|
7
|
+
data.tar.gz: ac1ccc32bbe862df547f1262aac1313e6d952df89853f82c8be5e73a547e8c24a4931d2cc653b64357006dd4a6aac8b3ff441b45db137f46924550ae30ec3379
|
data/CHANGELOG.md
CHANGED
data/lib/karo/db.rb
CHANGED
@@ -87,7 +87,17 @@ module Karo
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def drop_and_create_local_database(local_db_config)
|
90
|
-
command =
|
90
|
+
command = case local_db_config["adapter"]
|
91
|
+
when "mysql2"
|
92
|
+
"mysql -v -h #{local_db_config["host"]} -u#{local_db_config["username"]} -p#{local_db_config["password"]} -e 'DROP DATABASE IF EXISTS `#{local_db_config["database"]}`; CREATE DATABASE IF NOT EXISTS `#{local_db_config["database"]}`;'"
|
93
|
+
when "postgresql"
|
94
|
+
<<-EOS
|
95
|
+
dropdb -h #{local_db_config["host"]} -U #{local_db_config["username"]} --if-exists #{local_db_config["database"]}
|
96
|
+
createdb -h #{local_db_config["host"]} -U #{local_db_config["username"]} #{local_db_config["database"]}
|
97
|
+
EOS
|
98
|
+
else
|
99
|
+
raise Thor::Error, "Please make sure that the database adapter is either mysql2 or postgresql?"
|
100
|
+
end
|
91
101
|
|
92
102
|
run_it command, options[:verbose]
|
93
103
|
end
|
@@ -95,7 +105,14 @@ module Karo
|
|
95
105
|
def sync_server_to_local_database(server_db_config, local_db_config)
|
96
106
|
ssh = "ssh #{@configuration["user"]}@#{@configuration["host"]}"
|
97
107
|
|
98
|
-
command =
|
108
|
+
command = case server_db_config["adapter"]
|
109
|
+
when /mysql|mysql2/
|
110
|
+
"#{ssh} \"mysqldump --opt -C -h #{server_db_config["host"]} -u#{server_db_config["username"]} -p#{server_db_config["password"]} -h#{server_db_config["host"]} #{server_db_config["database"]}\" | mysql -v -h #{local_db_config["host"]} -C -u#{local_db_config["username"]} -p#{local_db_config["password"]} #{local_db_config["database"]}"
|
111
|
+
when "postgresql"
|
112
|
+
"#{ssh} \"export PGPASSWORD='#{server_db_config["password"]}'; pg_dump -Fc -U #{server_db_config["username"]} -h #{server_db_config["host"]} #{server_db_config["database"]}\" | pg_restore -h #{local_db_config["host"]} -U #{local_db_config["username"]} -d #{local_db_config["database"]}"
|
113
|
+
else
|
114
|
+
raise Thor::Error, "Please make sure that the database adapter is either mysql2 or postgresql?"
|
115
|
+
end
|
99
116
|
|
100
117
|
run_it command, options[:verbose]
|
101
118
|
end
|
data/lib/karo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rahul Trikha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|