testftpd 0.1.1 → 0.1.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.
@@ -76,6 +76,16 @@ module TestFtpd
76
76
  end
77
77
  true
78
78
  end
79
+
80
+ def self.format_list_entry(file_system_provider)
81
+ raw = (file_system_provider.directory?) ? 'd': '-'
82
+ raw += 'rw-rw-rw- 1 ftp ftp '
83
+ raw += file_system_provider.ftp_size.to_s + ' '
84
+ raw += file_system_provider.ftp_date.strftime('%b %d %H:%M') + ' '
85
+ raw += file_system_provider.ftp_name
86
+ raw += "\r\n"
87
+ raw
88
+ end
79
89
  end
80
90
 
81
91
  end
@@ -1,3 +1,3 @@
1
1
  module TestFtpd
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -262,7 +262,7 @@ class DynFTPServer
262
262
  def cmd_list(file_spec)
263
263
  data_connection do |data_socket|
264
264
  list = thread[:cwd].ftp_list(file_spec)
265
- list.each {|file| data_socket.puts(((file.directory?) ? 'd': '-') + 'rw-rw-rw- 1 ftp ftp ' + file.ftp_size.to_s + ' ' + file.ftp_date.strftime('%b %d %H:%M') + ' ' + file.ftp_name + "\r\n") }
265
+ list.each {|file| data_socket.puts(file.class.format_list_entry(file)) }
266
266
  end
267
267
  thread[:data_socket].close if thread[:data_socket]
268
268
  thread[:data_socket] = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testftpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: