prun-ops 0.2.11 → 0.2.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67423974106f368510f030fb614ffc9f724b8c1a
4
- data.tar.gz: 78509c073e43ad0955b477eefa23ce9b48775f9c
3
+ metadata.gz: b0c70f48df92a5ea2b107e1c49ed0d0c89c559b6
4
+ data.tar.gz: cb93d27eb4c5482f178e1ae06f0104281ae94977
5
5
  SHA512:
6
- metadata.gz: 0a4fee7ea259e60f0614782bf9ead313d612bf23a659da5cfeace428d082b30df8873713a97c30c2aff91bd849c5addc9ed67423360b287a6e42e39895d870d0
7
- data.tar.gz: a8b06a123a9b9cacfbbc4c06596bd91e08afe2833520e3c0333b9bc947785ee5a20daaec661cf63eb48e7c1657e65a5dabe91eef6e291b879faec275028073d8
6
+ metadata.gz: 4b42a9bcdb1164efb44fb2261cf5420964fe89d387e0fcac7067e6c9c21d4c0fb8b7f8b7bbcaa053bb4857f7e3b14bb2ff120647ac9c9cf661502f02eae4e288
7
+ data.tar.gz: 4b173a839fda781e8d02f4c9006473ecc6fd5d93b7dd9330b060d7dcca257dc4ffe2ca52092345a089e5102da2f584c61298e7c311629ba9c6ef0ce580c54555
@@ -60,11 +60,20 @@ task :rake, :remote_task do |task, args|
60
60
  end
61
61
  end
62
62
 
63
- desc 'Uploads a file to /tmp folder. i.e.: cap staging scp[tmp/db.sql]'
64
- task :scp, :file_path do |task, args|
63
+ desc 'Uploads a file to /tmp folder. i.e.: cap staging upload[tmp/db.sql]'
64
+ task :upload, :file_path do |task, args|
65
65
  on roles(:app) do |host|
66
66
  run_locally do
67
- scp host, args[:file_path]
67
+ upload_scp host, args[:file_path]
68
+ end
69
+ end
70
+ end
71
+
72
+ desc 'Downloads a file. i.e.: cap staging download[/tmp/db.sql]'
73
+ task :download, :file_path do |task, args|
74
+ on roles(:app) do |host|
75
+ run_locally do
76
+ download_scp host, args[:file_path]
68
77
  end
69
78
  end
70
79
  end
@@ -83,7 +92,7 @@ def run_in(host, remote_cmd)
83
92
  exec command
84
93
  end
85
94
 
86
- def scp(host, file_path)
95
+ def upload_scp(host, file_path)
87
96
  cmd = %w[scp]
88
97
  opts = fetch(:ssh_options)
89
98
  cmd << "-oProxyCommand='#{opts[:proxy].command_line_template}'" if opts
@@ -95,3 +104,15 @@ def scp(host, file_path)
95
104
  exec command
96
105
  end
97
106
 
107
+ def download_scp(host, file_path)
108
+ cmd = %w[scp]
109
+ opts = fetch(:ssh_options)
110
+ cmd << "-oProxyCommand='#{opts[:proxy].command_line_template}'" if opts
111
+ cmd << "#{host.user}@#{host.hostname}:#{file_path}"
112
+ cmd << '.'
113
+
114
+ command = cmd.join(' ')
115
+ Rails.logger.info command
116
+ exec command
117
+ end
118
+
@@ -1,3 +1,3 @@
1
1
  module PrunOps
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prun-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Lebrijo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-21 00:00:00.000000000 Z
11
+ date: 2018-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler