ftpd 0.14.0 → 0.15.0
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/Changelog.md +8 -0
- data/VERSION +1 -1
- data/ftpd.gemspec +5 -6
- data/lib/ftpd/server.rb +4 -1
- metadata +3 -4
- data/examples/foo.rb +0 -114
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aa59afb98dd26875b646c6f8a3550d337505ab80
|
|
4
|
+
data.tar.gz: d29d3bc6c44189ee226694d613621c5e2febbd63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 344986d4b6cee9e0f6880f3a101c6ff56029e3a165ac70bfc302ac7eedfc5068a32f23055d960f42a4ca8504b9dec3014697fb668fc1233abcbb888a53c5e398
|
|
7
|
+
data.tar.gz: d9e739f8960d52383b39351b3f72f510dc05e85b14504f8aaccb45732b6d9683dab7cb5c3c06f7e76e99d6842099d2ede7fc7c6fade379f9270dd8cc4f81da94
|
data/Changelog.md
CHANGED
|
@@ -2,6 +2,14 @@ This is the change log for the main branch of ftpd, which supports
|
|
|
2
2
|
Ruby 1.9 and greater. For ruby 1.8.7, please use the latest version
|
|
3
3
|
before 0.8.0.
|
|
4
4
|
|
|
5
|
+
Bug fixes
|
|
6
|
+
|
|
7
|
+
* Ignore Errno::ENOTCONN on socket shutdown (issue #24)
|
|
8
|
+
|
|
9
|
+
Administration
|
|
10
|
+
|
|
11
|
+
* Remove examples/foo.rb (accidental commit)
|
|
12
|
+
|
|
5
13
|
### 0.14.0
|
|
6
14
|
|
|
7
15
|
Administration
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.15.0
|
data/ftpd.gemspec
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: ftpd 0.
|
|
5
|
+
# stub: ftpd 0.15.0 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "ftpd"
|
|
9
|
-
s.version = "0.
|
|
9
|
+
s.version = "0.15.0"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
|
-
s.require_paths = ["lib"]
|
|
13
12
|
s.authors = ["Wayne Conrad"]
|
|
14
|
-
s.date = "2014-05-
|
|
13
|
+
s.date = "2014-05-14"
|
|
15
14
|
s.description = "ftpd is a pure Ruby FTP server library. It supports implicit and explicit TLS, IPV6, passive and active mode, and is unconditionally compliant per RFC-1123. It can be used as part of a test fixture or embedded in a program."
|
|
16
15
|
s.email = "wconrad@yagni.com"
|
|
17
16
|
s.extra_rdoc_files = [
|
|
@@ -33,7 +32,6 @@ Gem::Specification.new do |s|
|
|
|
33
32
|
"doc/rfc-compliance.md",
|
|
34
33
|
"examples/example.rb",
|
|
35
34
|
"examples/example_spec.rb",
|
|
36
|
-
"examples/foo.rb",
|
|
37
35
|
"examples/hello_world.rb",
|
|
38
36
|
"features/example/eplf.feature",
|
|
39
37
|
"features/example/example.feature",
|
|
@@ -239,7 +237,8 @@ Gem::Specification.new do |s|
|
|
|
239
237
|
]
|
|
240
238
|
s.homepage = "http://github.com/wconrad/ftpd"
|
|
241
239
|
s.licenses = ["MIT"]
|
|
242
|
-
s.
|
|
240
|
+
s.require_paths = ["lib"]
|
|
241
|
+
s.rubygems_version = "2.1.11"
|
|
243
242
|
s.summary = "Pure Ruby FTP server library"
|
|
244
243
|
|
|
245
244
|
if s.respond_to? :specification_version then
|
data/lib/ftpd/server.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ftpd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wayne Conrad
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-05-
|
|
11
|
+
date: 2014-05-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: memoizer
|
|
@@ -160,7 +160,6 @@ files:
|
|
|
160
160
|
- doc/rfc-compliance.md
|
|
161
161
|
- examples/example.rb
|
|
162
162
|
- examples/example_spec.rb
|
|
163
|
-
- examples/foo.rb
|
|
164
163
|
- examples/hello_world.rb
|
|
165
164
|
- features/example/eplf.feature
|
|
166
165
|
- features/example/example.feature
|
|
@@ -383,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
383
382
|
version: '0'
|
|
384
383
|
requirements: []
|
|
385
384
|
rubyforge_project:
|
|
386
|
-
rubygems_version: 2.
|
|
385
|
+
rubygems_version: 2.1.11
|
|
387
386
|
signing_key:
|
|
388
387
|
specification_version: 4
|
|
389
388
|
summary: Pure Ruby FTP server library
|
data/examples/foo.rb
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
unless $:.include?(File.dirname(__FILE__) + '/../lib')
|
|
4
|
-
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
require 'socket'
|
|
8
|
-
require 'thread'
|
|
9
|
-
require 'tmpdir'
|
|
10
|
-
|
|
11
|
-
def show(s)
|
|
12
|
-
return
|
|
13
|
-
print s + "\n"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
class Server
|
|
17
|
-
|
|
18
|
-
attr_accessor :port
|
|
19
|
-
|
|
20
|
-
def initialize
|
|
21
|
-
@interface = '127.0.0.1'
|
|
22
|
-
@port = 0
|
|
23
|
-
@stopping = false
|
|
24
|
-
@start_queue = Queue.new
|
|
25
|
-
@stop_queue = Queue.new
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def start
|
|
29
|
-
show 's #start'
|
|
30
|
-
@server_socket = make_server_socket
|
|
31
|
-
@server_thread = make_server_thread
|
|
32
|
-
show 's waiting for start'
|
|
33
|
-
show "s #{@start_queue.deq}"
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def stop
|
|
37
|
-
show 's #stop'
|
|
38
|
-
@stopping = true
|
|
39
|
-
@server_socket.shutdown
|
|
40
|
-
# @server_socket.close
|
|
41
|
-
show 's joining on thread'
|
|
42
|
-
# @thread.join
|
|
43
|
-
# show 's waiting for stop'
|
|
44
|
-
# show "s #{@stop_queue.deq}"
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
def make_server_socket
|
|
50
|
-
return TCPServer.new(@interface, @port)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def make_server_thread
|
|
54
|
-
@thread = Thread.new do
|
|
55
|
-
show 't started'
|
|
56
|
-
Thread.abort_on_exception = false
|
|
57
|
-
begin
|
|
58
|
-
@start_queue.enq 'started'
|
|
59
|
-
server_thread
|
|
60
|
-
rescue Exception
|
|
61
|
-
show 't exception'
|
|
62
|
-
@stop_queue.enq 'stopping'
|
|
63
|
-
raise
|
|
64
|
-
else
|
|
65
|
-
show 't no exception'
|
|
66
|
-
@stop_queue.enq 'stopping'
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def server_thread
|
|
72
|
-
loop do
|
|
73
|
-
begin
|
|
74
|
-
begin
|
|
75
|
-
show 't waiting for bind'
|
|
76
|
-
@server_socket.accept
|
|
77
|
-
show 't bound'
|
|
78
|
-
rescue Errno::EBADF, Errno::EINVAL => e
|
|
79
|
-
show "t #{e}"
|
|
80
|
-
raise unless @stopping
|
|
81
|
-
break
|
|
82
|
-
end
|
|
83
|
-
rescue IOError
|
|
84
|
-
show 't IOError'
|
|
85
|
-
break
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
show 't done'
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
def accept
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
Dir.mktmpdir do |temp_dir|
|
|
97
|
-
i = 0
|
|
98
|
-
loop do
|
|
99
|
-
i += 1
|
|
100
|
-
begin
|
|
101
|
-
if i % 1000 == 0
|
|
102
|
-
print '.'
|
|
103
|
-
$stdout.flush
|
|
104
|
-
end
|
|
105
|
-
server = Server.new
|
|
106
|
-
server.port = 10000
|
|
107
|
-
server.start
|
|
108
|
-
server.stop
|
|
109
|
-
rescue Errno::EADDRINUSE
|
|
110
|
-
puts i
|
|
111
|
-
raise
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
end
|