wormholio 0.0.2.1 → 0.0.2.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 +8 -8
- data/lib/wormholio.rb +12 -3
- data/lib/wormholio/ftps.rb +52 -0
- data/lib/wormholio/version.rb +1 -1
- data/wormholio.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Mjg1YzU0NzNlMTAzM2M3ZjFiZWQxMTRhNDJjY2YxMmM2MWI4YjBkZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Yzk4ZGFiOWQzM2MwMWYzZDM3MWU0OTliOGQ5NDNlMTFlMDFmY2E3ZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDAzMTUyMDY3NzVhMjI4ZDg1MzUzMzIzYTdlMzY0NDRhMzlhMGM0Yzk1ZGMw
|
10
|
+
YjRkMGI0MmMwYTc0YmMzZTQ5YmMwNzUwOGQ0N2YzZTdiNzZkZGM1ZjgwMGY2
|
11
|
+
NmEyZDY0NTI4OTM4YjZmYmY0ZjNjNmFhYWFlYWNjNjcyNGZlNWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njk5Zjg1ZWY4NzQ3Y2I5ZDQzYWY4NDk1MjllN2NiYjRjZDgxYTIyZTE1NzYx
|
14
|
+
MWQ3NTA0ZDhiZDUyMDU4NTIwNjQyYzk1Zjg5NWIxMzMzNjcyZGI3YTUxZTU5
|
15
|
+
YjQyM2EyYzA2NmRlNThiYzZkMDFkYmVkMTk4MTAzMGUwYjcwNzk=
|
data/lib/wormholio.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "wormholio/version"
|
2
2
|
require "wormholio/ftp"
|
3
|
+
require "wormholio/ftps"
|
3
4
|
|
4
5
|
module Wormholio
|
5
6
|
|
@@ -9,14 +10,22 @@ module Wormholio
|
|
9
10
|
Ftp.upload(credentials,file,options)
|
10
11
|
end
|
11
12
|
|
12
|
-
def self.download(
|
13
|
-
Ftp.download(credentials,
|
13
|
+
def self.download(credentials,local_path,filename,options={})
|
14
|
+
Ftp.download(credentials,local_path,filename,options)
|
14
15
|
end
|
15
16
|
|
16
17
|
end
|
17
18
|
|
18
19
|
module FTPS
|
19
|
-
|
20
|
+
|
21
|
+
def self.upload(credentials,file,options={})
|
22
|
+
Ftps.upload(credentials,file,options)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.download(credentials,local_path,filename,options={})
|
26
|
+
Ftps.download(credentials,local_path,filename,options)
|
27
|
+
end
|
28
|
+
|
20
29
|
end
|
21
30
|
|
22
31
|
module SFTP
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "double_bag_ftps"
|
2
|
+
|
3
|
+
class Ftps
|
4
|
+
|
5
|
+
def self.upload(creds,file,options={})
|
6
|
+
p 'FTPS UPLOAD'
|
7
|
+
connect(creds,options)
|
8
|
+
@wormholio_ftps.chdir("#{creds['dir_path']}")
|
9
|
+
@wormholio_ftps.putbinaryfile(file)
|
10
|
+
close_connection()
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.download(creds,local_path,filename,options={})
|
14
|
+
p 'FTPS DOWNLOAD'
|
15
|
+
connect(creds,options)
|
16
|
+
@wormholio_ftps.chdir("#{creds['dir_path']}")
|
17
|
+
@wormholio_ftps.getbinaryfile(filename,"#{local_path}#{filename}")
|
18
|
+
close_connection()
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
def self.connect(creds,options)
|
23
|
+
p 'ESTABLISH FTPS CONNECTION'
|
24
|
+
host = creds["host"] # Host to connect too
|
25
|
+
port = (creds["port"]) ? creds["port"] : 21 # Default to port 21 unless port is given
|
26
|
+
username = creds["username"] # Username to connect with
|
27
|
+
password = creds["password"] # Password for username
|
28
|
+
verify_mode = OpenSSL::SSL::VERIFY_NONE # Do not verify host's certificate
|
29
|
+
|
30
|
+
# Connect to a host using explicit FTPS
|
31
|
+
@wormholio_ftps = DoubleBagFTPS.new
|
32
|
+
@wormholio_ftps.ssl_context = DoubleBagFTPS.create_ssl_context(:verify_mode => verify_mode)
|
33
|
+
if options["debug"]
|
34
|
+
p 'Debug Mode'
|
35
|
+
p options["debug"]
|
36
|
+
@wormholio_ftps.debug_mode = options["debug"] # Debug mode
|
37
|
+
end
|
38
|
+
if options["passive"]
|
39
|
+
p 'Passive'
|
40
|
+
p options["passive"]
|
41
|
+
@wormholio_ftps.passive = options["passive"] # Passive connection
|
42
|
+
end
|
43
|
+
@wormholio_ftps.connect(host, port)
|
44
|
+
@wormholio_ftps.login(username, password)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.close_connection
|
48
|
+
p 'CLOSE FTPS CONNECTION'
|
49
|
+
@wormholio_ftps.close
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
data/lib/wormholio/version.rb
CHANGED
data/wormholio.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Christopher Reynolds"]
|
10
10
|
spec.email = ["reynolds87chris@gmail.com"]
|
11
11
|
spec.summary = %q{Currently under development... First gem.}
|
12
|
-
spec.description = %q{Currently under development... First gem. If you want one gem that can utilize all file transfer methods, use Wormholio. Currently supported transfer method: FTP; soon to be supported:
|
12
|
+
spec.description = %q{Currently under development... First gem. If you want one gem that can utilize all file transfer methods, use Wormholio. Currently supported transfer method: FTP, FTPS; soon to be supported: SFTP, SCP & S3.}
|
13
13
|
spec.homepage = "https://github.com/skplunkerin/wormholio"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wormholio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2.
|
4
|
+
version: 0.0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Reynolds
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
version: '10.0'
|
97
97
|
description: ! 'Currently under development... First gem. If you want one gem that
|
98
98
|
can utilize all file transfer methods, use Wormholio. Currently supported transfer
|
99
|
-
method: FTP; soon to be supported:
|
99
|
+
method: FTP, FTPS; soon to be supported: SFTP, SCP & S3.'
|
100
100
|
email:
|
101
101
|
- reynolds87chris@gmail.com
|
102
102
|
executables: []
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- Rakefile
|
111
111
|
- lib/wormholio.rb
|
112
112
|
- lib/wormholio/ftp.rb
|
113
|
+
- lib/wormholio/ftps.rb
|
113
114
|
- lib/wormholio/version.rb
|
114
115
|
- wormholio.gemspec
|
115
116
|
homepage: https://github.com/skplunkerin/wormholio
|