photocopier 1.3.1 → 1.3.2

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: '085c7869289f7443bb01eb0a291dd0803fe2384d'
4
- data.tar.gz: df261e02593759ad019f81b4ef72c148b4c9b4f2
3
+ metadata.gz: 68bd362bf88075bbf9f6b0a1f8f990e15ce60f67
4
+ data.tar.gz: beca79ad74c3e55ea769430e8b3f6b6a768d9b7a
5
5
  SHA512:
6
- metadata.gz: c87d862023c0dba8dbc1653e4d6af89bbfca4e9ba8e35fb7df22cc44ec62fcd2685f462c3c2ec5331fbcead235ea40f394235a8f74a0ff41e359b679f9353174
7
- data.tar.gz: 6b0ba476ca5131d4305d2da3409566b394f7fbf318228509bd710931529041571ab80a7c0e954417c9087cee83c2f1b69741704339182f47344e92e94f119e14
6
+ metadata.gz: 14d6c7a7dd34d614c1319cd01c276eb390c7fac0efc448174ae889c156d486be2014e003583c727555dcc15c623c34fdf6f2510a8d0ebe3bc0a54fc5521d065d
7
+ data.tar.gz: f2e27ec8624708d4cf5bdee1e2b92f1561ae912de94ddd0178696358c1c9e90edcd8dabd730351ad29a07fd7824b016448676fdfec07c7f5bc590916ae21045b
@@ -4,22 +4,23 @@ module Photocopier
4
4
  def initialize(options)
5
5
  @scheme = options[:scheme]
6
6
 
7
- if sftp?
8
- @session = Net::SFTP.start(
9
- options[:host],
10
- options[:user],
11
- password: options[:password],
12
- port: options[:port] || 22
13
- )
14
- else
15
- @session = Net::FTP.open(
16
- options[:host],
17
- username: options[:user],
18
- password: options[:password],
19
- port: options[:port] || 21,
20
- passive: options[:passive] || false
21
- )
22
- end
7
+ @session = if sftp?
8
+ Net::SFTP.start(
9
+ options[:host],
10
+ options[:user],
11
+ password: options[:password],
12
+ port: options[:port] || 22
13
+ )
14
+ else
15
+ Net::FTP.open(
16
+ options[:host],
17
+ username: options[:user],
18
+ password: options[:password],
19
+ port: options[:port] || 21,
20
+ passive: options[:passive] || false,
21
+ ssl: @scheme == 'ftps' && true || false
22
+ )
23
+ end
23
24
  end
24
25
 
25
26
  def get(remote, local)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_litterla: true
2
2
 
3
3
  module Photocopier
4
- VERSION = "1.3.1".freeze
4
+ VERSION = "1.3.2".freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photocopier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna