capistrano-shortcuts 0.9.0 → 0.9.1

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: a3fae278f97b55bda4394af772825bd5bbfcfcfa
4
- data.tar.gz: 43742a39b2a9ff4df251928f605b4ac60469dd2c
3
+ metadata.gz: 7147b3f1f74ab1073ac26bdc5b4cfc40bc176511
4
+ data.tar.gz: a5f708356edefaa78a2900562db497a23a55a6c7
5
5
  SHA512:
6
- metadata.gz: 9f572416f1b29dc6cf588f512dc80da277d098df256c0bcb710f3f44c89f7463ee0d326b2b568a2596d19d80a04f7a2b104f5035a19608bad931d290f5c8aac1
7
- data.tar.gz: d3babfae15c8dbfeb50e632543d42538a2c0e1874f3e28d5edf3031e802c35e2d87d421f0c8dac49171fc00c4c4fbfe468de3c6e3a13c242c8cf12d8cc3e1a3a
6
+ metadata.gz: b35c2ec51cf2efb4a1d37d88a205fb58ac5566cb4d5dac3869983944bffef99f73f794d68a82ad09dabc982bd43a66c9b607a5262d41cec4e6310108a67644b6
7
+ data.tar.gz: 092d51d377a2b8e712e4df1f108919b198de7aea47d3412d5a860dc1c1ff3c5470318500ec46319e5aca998ef44682d56653f6efd3718be28c001a8ee7adad7f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-shortcuts (0.9.0)
4
+ capistrano-shortcuts (0.9.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,7 +2,7 @@ namespace :db do
2
2
 
3
3
  db_config = YAML::load_file('config/database.yml')
4
4
  local_rails_env = 'development'
5
- dump_file = "capistrano-dump-#{Time.now.to_i}.sql"
5
+ dump_file = "capistrano-shortcuts-dump-#{Time.now.to_i}.sql"
6
6
 
7
7
  task pull: [:dump_remote_db, :pull_db, :load_local_db]
8
8
  task push: [:dump_local_db, :push_db, :load_remote_db]
@@ -29,22 +29,19 @@ namespace :db do
29
29
  execute(command)
30
30
  end
31
31
  execute("rm #{dump_file}.gz")
32
- run_locally do
33
- execute("gunzip -f #{dump_file}.gz")
34
- end
35
32
  end
36
33
  end
37
34
 
38
35
  task :load_local_db do
39
36
  run_locally do
40
- load_db(db_config[local_rails_env], dump_file)
41
- execute("rm #{dump_file}")
37
+ load_db(db_config[local_rails_env], "#{dump_file}.gz")
38
+ execute("rm #{dump_file}.gz")
42
39
  end
43
40
  end
44
41
 
45
42
  task :dump_local_db do
46
43
  run_locally do
47
- dump_db(db_config[local_rails_env], dump_file)
44
+ dump_db(db_config[local_rails_env], "#{dump_file}")
48
45
  end
49
46
  end
50
47
 
@@ -73,9 +70,6 @@ namespace :db do
73
70
  execute(command)
74
71
  execute("rm #{dump_file}.gz")
75
72
  end
76
- on roles(:db) do
77
- execute("gunzip -f #{dump_file}.gz")
78
- end
79
73
  end
80
74
 
81
75
  task :load_remote_db do
@@ -85,7 +79,7 @@ namespace :db do
85
79
  end
86
80
  on roles(:db) do
87
81
  load_db(db_config[fetch(:rails_env)], "~/#{dump_file}")
88
- execute("rm #{dump_file}")
82
+ execute("rm #{dump_file}.gz")
89
83
  end
90
84
  end
91
85
 
@@ -103,16 +97,14 @@ namespace :db do
103
97
  end
104
98
 
105
99
  def load_db(config, input_file)
106
- command = "MYSQL_PWD=#{config['password']} " +
100
+ command = "gunzip -c #{input_file} | " +
101
+ "MYSQL_PWD=#{config['password']} " +
107
102
  "mysql " +
108
103
  "-u #{config['username']} "
109
-
110
104
  if config['db_host']
111
105
  command += "-h #{config['db_host']} "
112
106
  end
113
-
114
- command += "#{config['database']} " +
115
- "< #{input_file}"
107
+ command += "#{config['database']}"
116
108
  execute(command)
117
109
  end
118
110
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Shortcuts
3
- VERSION = "0.9.0"
3
+ VERSION = "0.9.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-shortcuts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Gehman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-14 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler