fun_sftp 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/fun_sftp.rb +8 -4
- data/lib/fun_sftp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f542665943daf0252b5c909c866daeaa3b2e4ef8
|
4
|
+
data.tar.gz: d5a17ecb648aa1f190cfe00ee574017f305751e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc0f0059a666a57f1801e574cb72d3dc4dee43b1ef8a037a488e7fa2facf483a2eb6a7ca91a472c234d6393a82675c1664212a2d583739ddf4248b09cb7b6d58
|
7
|
+
data.tar.gz: 4d4a4d1ac18f020de9b111d3415460dfdbecb29440a0b349d9bdbb5d942c60a2c47ab3bc6326f6cb518b6bda7704d1a184cdabc463f9325ace97d9bf5f4aa581
|
data/README.md
CHANGED
@@ -24,6 +24,8 @@ Setup the connection and specify a `source` directory if desired:
|
|
24
24
|
```ruby
|
25
25
|
include FunSftp
|
26
26
|
conn = SFTPClient.new(server, username, password)
|
27
|
+
# For authentication via keys
|
28
|
+
conn = SFTPClient.new(server, username, password, keys: [/path/to/key], host_key: 'ssh-rsa')
|
27
29
|
conn.source = 'projects/awesome_project' #optional
|
28
30
|
```
|
29
31
|
|
@@ -186,7 +188,7 @@ Contribute
|
|
186
188
|
License
|
187
189
|
-------
|
188
190
|
|
189
|
-
Copyright (c)
|
191
|
+
Copyright (c) 2016 George Diaz
|
190
192
|
|
191
193
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
192
194
|
|
data/lib/fun_sftp.rb
CHANGED
@@ -16,18 +16,22 @@ module FunSftp
|
|
16
16
|
|
17
17
|
attr_accessor :source
|
18
18
|
|
19
|
-
attr_reader :server, :user, :password, :client
|
19
|
+
attr_reader :server, :user, :password, :client, :options
|
20
20
|
|
21
21
|
alias_method :pwd, :source
|
22
22
|
|
23
|
-
def initialize(server, user, password)
|
24
|
-
@server, @user, @password = server, user, password
|
23
|
+
def initialize(server, user, password, options = {})
|
24
|
+
@server, @user, @password, @options= server, user, password, options
|
25
25
|
self.source = '.'
|
26
26
|
@client = setup_login
|
27
27
|
end
|
28
28
|
|
29
29
|
def setup_login
|
30
|
-
|
30
|
+
unless options.none?
|
31
|
+
Net::SFTP.start(server, user, options)
|
32
|
+
else
|
33
|
+
Net::SFTP.start(server, user, password: password)
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
def upload!(src, target) #send to remote
|
data/lib/fun_sftp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fun_sftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Diaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-sftp
|