ftpmvc 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ftpmvc/application.rb +1 -0
- data/lib/ftpmvc/filter/base.rb +9 -0
- data/lib/ftpmvc/filter/filesystem_access.rb +2 -2
- data/lib/ftpmvc/ftpd/file_system.rb +2 -1
- data/lib/ftpmvc/ftpd/input.rb +20 -0
- data/lib/ftpmvc/ftpd.rb +1 -0
- data/lib/ftpmvc/input.rb +9 -0
- data/lib/ftpmvc/string_input.rb +14 -0
- data/lib/ftpmvc/version.rb +1 -1
- data/lib/ftpmvc.rb +1 -0
- data/spec/lib/ftpmvc/filter/filesystem_access.rb +3 -3
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99e6b62e7638ae4f505f7c91665ec8eaa095605d
|
4
|
+
data.tar.gz: dc5cef1794af707277f782d773572b20c46f16de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fd37e86b63ff1f728736f66b2190dd4387bc2765164e77c86363ea371d8e8483fa3a259695151a9bd6e5737f240a764a3d2cbbab25369dab815a992833adb05
|
7
|
+
data.tar.gz: 98b8152bcdf05e8aa4a5b8b983c8720f714ce2ffa26529210505af5fa98f67930cd8a87bde4d4f37532f8ad9dc5ea1e51c20c8540f01fa71b5b103c32238662d
|
data/lib/ftpmvc/application.rb
CHANGED
data/lib/ftpmvc/filter/base.rb
CHANGED
@@ -7,8 +7,17 @@ module FTPMVC
|
|
7
7
|
|
8
8
|
def_delegators :@chain, :index, :get, :directory?, :exists?, :put
|
9
9
|
|
10
|
+
attr_reader :options
|
11
|
+
|
10
12
|
def initialize(fs, chain, options={})
|
11
13
|
@fs, @chain, @options = fs, chain, options
|
14
|
+
setup
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
def setup
|
20
|
+
# may be implemented by children
|
12
21
|
end
|
13
22
|
end
|
14
23
|
end
|
@@ -21,8 +21,8 @@ module FTPMVC
|
|
21
21
|
not @fs.resolve(path).nil?
|
22
22
|
end
|
23
23
|
|
24
|
-
def put(path,
|
25
|
-
@fs.resolve(::File.dirname(path)).put(::File.basename(path),
|
24
|
+
def put(path, input)
|
25
|
+
@fs.resolve(::File.dirname(path)).put(::File.basename(path), input)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'ftpmvc/logger'
|
2
|
+
require 'ftpmvc/ftpd/input'
|
2
3
|
|
3
4
|
module FTPMVC
|
4
5
|
module Ftpd
|
@@ -27,7 +28,7 @@ module FTPMVC
|
|
27
28
|
|
28
29
|
def write(path, stream)
|
29
30
|
logger.debug { "FTPMVC::Ftpd::FileSystem#write(#{path}, ...)" }
|
30
|
-
@application.put(path, stream)
|
31
|
+
@application.put(path, Input.new(stream))
|
31
32
|
end
|
32
33
|
|
33
34
|
def accessible?(path)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'ftpmvc/input'
|
2
|
+
|
3
|
+
module FTPMVC
|
4
|
+
module Ftpd
|
5
|
+
class Input
|
6
|
+
|
7
|
+
include FTPMVC::Input
|
8
|
+
|
9
|
+
def initialize(stream)
|
10
|
+
@stream = stream
|
11
|
+
end
|
12
|
+
|
13
|
+
def read
|
14
|
+
while chunk = @stream.read
|
15
|
+
yield chunk
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/ftpmvc/ftpd.rb
CHANGED
data/lib/ftpmvc/input.rb
ADDED
data/lib/ftpmvc/version.rb
CHANGED
data/lib/ftpmvc.rb
CHANGED
@@ -59,12 +59,12 @@ describe FTPMVC::Filter::FilesystemAccess do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
describe '#put' do
|
62
|
-
let(:
|
62
|
+
let(:input) { double('input') }
|
63
63
|
it 'forwards to directory' do
|
64
64
|
expect_any_instance_of(MusicDirectory)
|
65
65
|
.to receive(:put)
|
66
|
-
.with 'songs.txt',
|
67
|
-
filter.put('/music/songs.txt',
|
66
|
+
.with 'songs.txt', input
|
67
|
+
filter.put('/music/songs.txt', input)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ftpmvc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Aizim Kelmanson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02
|
11
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,8 +142,11 @@ files:
|
|
142
142
|
- lib/ftpmvc/ftpd.rb
|
143
143
|
- lib/ftpmvc/ftpd/driver.rb
|
144
144
|
- lib/ftpmvc/ftpd/file_system.rb
|
145
|
+
- lib/ftpmvc/ftpd/input.rb
|
146
|
+
- lib/ftpmvc/input.rb
|
145
147
|
- lib/ftpmvc/logger.rb
|
146
148
|
- lib/ftpmvc/server.rb
|
149
|
+
- lib/ftpmvc/string_input.rb
|
147
150
|
- lib/ftpmvc/test_helpers.rb
|
148
151
|
- lib/ftpmvc/version.rb
|
149
152
|
- spec/integration/authentication_spec.rb
|