fulmar 1.8.1 → 1.8.2

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: b3a5a9c3fcc0eac8bf2f866acb574bc6e26b3daf
4
- data.tar.gz: b37c35df4992fa35e0b98338b8306d87da6b95b2
3
+ metadata.gz: f3dabbf5104350bdb4a7bb7855ac4571dc90ba1a
4
+ data.tar.gz: 592d608e5e2fe6cfc6d73125f9731a84bf23d87c
5
5
  SHA512:
6
- metadata.gz: d1f91dc05ce99316148331c754ef94b195667f77d7a66736fdc335d13101b5b65e04c388252a85dee7065e46f4b88cb9f8180e317a660b9c5955a37f902e40df
7
- data.tar.gz: 6d02384db532a177e53890693f17e33764be59bcec4dc19d4479cbda553dcddbc1a75798110809ad72ef0e94ebf5fe5d6708a2db8014295ab13dca50c5e0aac3
6
+ metadata.gz: c85ff037e699d0b28cc6e09ac6eddc5a35f073706a1c2a861e7f36eba4f989086281cf4035d6dd557f0a6337967e2fbe5998daa2fff474dc34977f68d164c699
7
+ data.tar.gz: 2c07c922fc33f6a966ec68a635d905002709dcf8a8aef4568812d0555059b58d23466f05cfd43ad5a8b7bd3155ca621a4319b5d69f60ef6f84b309a94a3e6cbb
@@ -9,7 +9,7 @@ module Fulmar
9
9
  # @param [String] remote_host SSH hostname
10
10
  # @param [String] remote_dir remote directory
11
11
  def self.upload(shell, local_file, remote_host, remote_dir)
12
- if shell.run "scp -r #{local_file} #{remote_host}:#{remote_dir.chomp('/')}/"
12
+ if shell.run "scp -Cr #{local_file} #{remote_host}:#{remote_dir.chomp('/')}/"
13
13
  "#{remote_dir.chomp('/')}/#{File.basename(local_file)}"
14
14
  end
15
15
  end
@@ -20,7 +20,7 @@ module Fulmar
20
20
  # @param [String] remote_file remote directory
21
21
  # @param [String] local_dir local filename, should be absolute
22
22
  def self.download(shell, remote_host, remote_file, local_dir = '.')
23
- if shell.run "scp -r #{remote_host}:#{remote_file} #{local_dir.chomp('/')}/"
23
+ if shell.run "scp -Cr #{remote_host}:#{remote_file} #{local_dir.chomp('/')}/"
24
24
  "#{local_dir.chomp('/')}/#{File.basename(remote_file)}"
25
25
  end
26
26
  end
@@ -91,7 +91,7 @@ module Fulmar
91
91
  def download_dump(filename = backup_filename)
92
92
  local_path = filename[0, 1] == '/' ? filename : @config[:local_path] + '/' + filename
93
93
  remote_path = dump
94
- copy = system("scp -q #{@config.ssh_user_and_host}:#{remote_path} #{local_path}")
94
+ copy = system("scp -Cq #{@config.ssh_user_and_host}:#{remote_path} #{local_path}")
95
95
  @shell.run "rm -f \"#{remote_path}\"" # delete temporary file
96
96
  if copy
97
97
  local_path
@@ -1,4 +1,4 @@
1
-
1
+ require 'pathname'
2
2
  require 'fulmar/infrastructure/service/transfer/base'
3
3
 
4
4
  module Fulmar
@@ -38,13 +38,12 @@ module Fulmar
38
38
  # Build the rsync command from the given options
39
39
  def rsync_command
40
40
  if @config[:rsync][:direction] == 'up'
41
- from = @config[:local_path]
41
+ from = absolute_path(@config[:local_path])
42
42
  to = @config.ssh_user_and_host + ':' + @config[:remote_path]
43
43
  else
44
44
  from = @config.ssh_user_and_host + ':' + @config[:remote_path]
45
- to = @config[:local_path]
45
+ to = absolute_path(@config[:local_path])
46
46
  end
47
-
48
47
  "rsync #{rsync_command_options.join(' ')} '#{from}/' '#{to}'"
49
48
  end
50
49
 
@@ -56,6 +55,15 @@ module Fulmar
56
55
 
57
56
  protected
58
57
 
58
+ # Get the absolute path of the given path
59
+ # @param [String] path
60
+ # @return [String] absolute path
61
+ def absolute_path(path)
62
+ path = Pathname.new(path)
63
+ return Pathname.new(@config.base_path) + path unless path.absolute?
64
+ path
65
+ end
66
+
59
67
  # Assembles all rsync command line parameters from the configuration options
60
68
  def rsync_command_options
61
69
  options = ['-rl']
@@ -1,4 +1,4 @@
1
1
  # Provides a global version number
2
2
  module Fulmar
3
- VERSION = '1.8.1'
3
+ VERSION = '1.8.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fulmar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Siegl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-17 00:00:00.000000000 Z
12
+ date: 2015-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  requirements: []
203
203
  rubyforge_project:
204
- rubygems_version: 2.4.5
204
+ rubygems_version: 2.4.5.1
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: A deployment task manager.