pave 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pave +9 -0
- data/lib/pave/database.rb +6 -0
- data/lib/pave/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: 0cc3ce562a85f80a29df6d8359eca010a44ace1a
|
4
|
+
data.tar.gz: b9f6ac25a2b4c927616b8acb3ebfc62b8a63e3be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5488fc7ddf18e1033e34e4eaa4d1f346bc4d8edbba15945f3ac6c7cb0232738b1987abc029249e9ac16ab18f7570753c08df41b007900b271afcbaa8f9315cd1
|
7
|
+
data.tar.gz: 795986496c1b2f1e2a95549379f98b1dec48bfb5acfc95802832f7c1795da6fd0b86c1f83d6f6ef791f38be0cf084c5cd06d9c975cb4627260bd76aa5d133a18
|
data/bin/pave
CHANGED
@@ -122,6 +122,15 @@ command :"db:create" do |c|
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
+
command :"db:drop" do |c|
|
126
|
+
c.syntax = "pave db:drop DATABASE"
|
127
|
+
c.description = "Destroy the Concrete5 project's database."
|
128
|
+
c.action do |args|
|
129
|
+
name = args.first || "#{File.basename(Dir.pwd)}"
|
130
|
+
Pave::Database.new(name).drop
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
125
134
|
command :"db:dump" do |c|
|
126
135
|
c.syntax = "pave db:dump DATABASE"
|
127
136
|
c.description = "Create SQL dump of the project's database."
|
data/lib/pave/database.rb
CHANGED
@@ -19,6 +19,11 @@ module Pave
|
|
19
19
|
sh "mysql -uroot -e 'CREATE DATABASE #{name}'"
|
20
20
|
end
|
21
21
|
|
22
|
+
def drop
|
23
|
+
destroy = agree("Are you sure you want to drop #{name}? All data will be lost.")
|
24
|
+
sh "mysql -uroot -e 'DROP DATABASE #{name}'" if destroy
|
25
|
+
end
|
26
|
+
|
22
27
|
def remote_db
|
23
28
|
require 'json'
|
24
29
|
live_domain = shell("php -r \"error_reporting(0);require('./config/site.php');echo LIVE_DOMAIN;\"").output
|
@@ -68,6 +73,7 @@ module Pave
|
|
68
73
|
def execute_remote(remote="live")
|
69
74
|
server = Pave::Remote.server(remote)
|
70
75
|
directory = Pave::Remote.directory(remote)
|
76
|
+
db = remote_db
|
71
77
|
say "Remotely executing #{dump_file} on live #{db['name']}"
|
72
78
|
sh "ssh #{server} \"cd #{directory}/db; gzip -dc #{dump_file} | mysql -u#{db['user']} -p#{db['pass']} #{db['name']}\""
|
73
79
|
end
|
data/lib/pave/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|