bfs-ftp 0.6.1 → 0.6.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 +4 -4
- data/lib/bfs/bucket/ftp.rb +9 -14
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e46d16067aed45ba5b08ed78f8aef03c9a5bba71e1d3907a889342ce1f4947ca
|
4
|
+
data.tar.gz: a877150fc240a0b79060d3c15295f734965b0d8ad04f09aac2ad565bddfc6c34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cba1489d833132157c36c56259eb7bc3f7be852549a2915d72b9506606b966d9be3528d264023515b63ce74ce9b7bdd361e20d1a2d7666434750befa03f0cd16
|
7
|
+
data.tar.gz: f152b36ca6a2548c8a4aee5a6c6f18e373bb5ddb65226ab9a7e4b0693b1d25557158df0ad9dee6515e549eb053aa8db871e0632d999f6c9effaf14b72d3024a1
|
data/lib/bfs/bucket/ftp.rb
CHANGED
@@ -15,15 +15,9 @@ module BFS
|
|
15
15
|
# @option opts [String] :password password for login.
|
16
16
|
# @option opts [String] :passive connect in passive mode. Default: true.
|
17
17
|
# @option opts [String] :prefix optional prefix.
|
18
|
-
def initialize(host, **opts)
|
19
|
-
opts = opts.dup
|
20
|
-
opts.keys.each do |key|
|
21
|
-
val = opts.delete(key)
|
22
|
-
opts[key.to_sym] = val unless val.nil?
|
23
|
-
end
|
18
|
+
def initialize(host, prefix: nil, **opts)
|
24
19
|
super(**opts)
|
25
20
|
|
26
|
-
prefix = opts.delete(:prefix)
|
27
21
|
@client = Net::FTP.new(host, **opts)
|
28
22
|
@client.binary = true
|
29
23
|
|
@@ -49,16 +43,17 @@ module BFS
|
|
49
43
|
# Info returns the object info
|
50
44
|
def info(path, **_opts)
|
51
45
|
path = norm_path(path)
|
52
|
-
BFS::FileInfo.new(path, @client.size(path), @client.mtime(path))
|
46
|
+
BFS::FileInfo.new(path: path, size: @client.size(path), mtime: @client.mtime(path))
|
53
47
|
rescue Net::FTPPermError
|
54
48
|
raise BFS::FileNotFound, path
|
55
49
|
end
|
56
50
|
|
57
51
|
# Creates a new file and opens it for writing
|
58
|
-
def create(path, **
|
52
|
+
def create(path, encoding: nil, perm: nil, **_opts, &block)
|
59
53
|
path = norm_path(path)
|
60
|
-
|
61
|
-
|
54
|
+
|
55
|
+
enc = encoding || @encoding
|
56
|
+
temp = BFS::TempWriter.new(path, encoding: enc, perm: perm) do |t|
|
62
57
|
mkdir_p File.dirname(path)
|
63
58
|
@client.put(t, path)
|
64
59
|
end
|
@@ -72,10 +67,10 @@ module BFS
|
|
72
67
|
end
|
73
68
|
|
74
69
|
# Opens an existing file for reading
|
75
|
-
def open(path, **
|
70
|
+
def open(path, encoding: nil, tempdir: nil, **_opts, &block)
|
76
71
|
path = norm_path(path)
|
77
|
-
enc =
|
78
|
-
temp = Tempfile.new(File.basename(path), encoding: enc)
|
72
|
+
enc = encoding || @encoding
|
73
|
+
temp = Tempfile.new(File.basename(path), tempdir, encoding: enc)
|
79
74
|
temp.close
|
80
75
|
|
81
76
|
@client.get(path, temp.path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bfs-ftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitrij Denissenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bfs
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.6.
|
19
|
+
version: 0.6.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.6.
|
26
|
+
version: 0.6.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: net-ftp-list
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
|
-
rubygems_version: 3.
|
70
|
+
rubygems_version: 3.0.6
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: FTP adapter for bfs
|