mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/ftp.rb: use frozen_string_literal: true.
* test/net/ftp/test_buffered_socket.rb: ditto. * test/net/ftp/test_ftp.rb: ditto. * test/net/ftp/test_mlsx_entry.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d8d51b6708
commit
ae6555aa25
5 changed files with 28 additions and 7 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Fri Oct 9 15:52:28 2015 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/net/ftp.rb: use frozen_string_literal: true.
|
||||||
|
|
||||||
|
* test/net/ftp/test_buffered_socket.rb: ditto.
|
||||||
|
|
||||||
|
* test/net/ftp/test_ftp.rb: ditto.
|
||||||
|
|
||||||
|
* test/net/ftp/test_mlsx_entry.rb: ditto.
|
||||||
|
|
||||||
Fri Oct 9 14:12:35 2015 Shota Fukumori (sora_h) <her@sorah.jp>
|
Fri Oct 9 14:12:35 2015 Shota Fukumori (sora_h) <her@sorah.jp>
|
||||||
|
|
||||||
* ext/openssl/lib/openssl/ssl.rb: Revert r52082 because it was
|
* ext/openssl/lib/openssl/ssl.rb: Revert r52082 because it was
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#
|
#
|
||||||
|
# -*- frozen_string_literal: true -*-
|
||||||
|
#
|
||||||
# = net/ftp.rb - FTP Client Library
|
# = net/ftp.rb - FTP Client Library
|
||||||
#
|
#
|
||||||
# Written by Shugo Maeda <shugo@ruby-lang.org>.
|
# Written by Shugo Maeda <shugo@ruby-lang.org>.
|
||||||
|
@ -610,7 +612,7 @@ module Net
|
||||||
f = open(localfile, "w")
|
f = open(localfile, "w")
|
||||||
end
|
end
|
||||||
elsif !block_given?
|
elsif !block_given?
|
||||||
result = ""
|
result = String.new
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
f.binmode if localfile
|
f.binmode if localfile
|
||||||
|
@ -637,7 +639,7 @@ module Net
|
||||||
if localfile
|
if localfile
|
||||||
f = open(localfile, "w")
|
f = open(localfile, "w")
|
||||||
elsif !block_given?
|
elsif !block_given?
|
||||||
result = ""
|
result = String.new
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
retrlines("RETR #{remotefile}") do |line, newline|
|
retrlines("RETR #{remotefile}") do |line, newline|
|
||||||
|
@ -1287,11 +1289,11 @@ module Net
|
||||||
|
|
||||||
def read(len = nil)
|
def read(len = nil)
|
||||||
if len
|
if len
|
||||||
s = super(len, "", true)
|
s = super(len, String.new, true)
|
||||||
return s.empty? ? nil : s
|
return s.empty? ? nil : s
|
||||||
else
|
else
|
||||||
result = ""
|
result = ""
|
||||||
while s = super(DEFAULT_BLOCKSIZE, "", true)
|
while s = super(DEFAULT_BLOCKSIZE, String.new, true)
|
||||||
break if s.empty?
|
break if s.empty?
|
||||||
result << s
|
result << s
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
#
|
||||||
|
# -*- frozen_string_literal: true -*-
|
||||||
|
|
||||||
require "net/ftp"
|
require "net/ftp"
|
||||||
require "test/unit"
|
require "test/unit"
|
||||||
require "ostruct"
|
require "ostruct"
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
#
|
||||||
|
# -*- frozen_string_literal: true -*-
|
||||||
|
|
||||||
require "net/ftp"
|
require "net/ftp"
|
||||||
require "test/unit"
|
require "test/unit"
|
||||||
require "ostruct"
|
require "ostruct"
|
||||||
|
@ -545,7 +548,7 @@ class FTPTest < Test::Unit::TestCase
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
assert_match(/\APASS /, commands.shift)
|
assert_match(/\APASS /, commands.shift)
|
||||||
assert_equal("TYPE I\r\n", commands.shift)
|
assert_equal("TYPE I\r\n", commands.shift)
|
||||||
buf = ""
|
buf = String.new
|
||||||
assert_raise(Net::ReadTimeout) do
|
assert_raise(Net::ReadTimeout) do
|
||||||
ftp.retrbinary("RETR foo", 1024) do |s|
|
ftp.retrbinary("RETR foo", 1024) do |s|
|
||||||
buf << s
|
buf << s
|
||||||
|
@ -602,7 +605,7 @@ class FTPTest < Test::Unit::TestCase
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
assert_match(/\APASS /, commands.shift)
|
assert_match(/\APASS /, commands.shift)
|
||||||
assert_equal("TYPE I\r\n", commands.shift)
|
assert_equal("TYPE I\r\n", commands.shift)
|
||||||
buf = ""
|
buf = String.new
|
||||||
ftp.retrbinary("RETR foo", 1024) do |s|
|
ftp.retrbinary("RETR foo", 1024) do |s|
|
||||||
buf << s
|
buf << s
|
||||||
end
|
end
|
||||||
|
@ -785,7 +788,7 @@ EOF
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
assert_match(/\APASS /, commands.shift)
|
assert_match(/\APASS /, commands.shift)
|
||||||
assert_equal("TYPE I\r\n", commands.shift)
|
assert_equal("TYPE I\r\n", commands.shift)
|
||||||
buf = ""
|
buf = String.new
|
||||||
ftp.retrlines("RETR foo") do |line|
|
ftp.retrlines("RETR foo") do |line|
|
||||||
buf << line + "\r\n"
|
buf << line + "\r\n"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
#
|
||||||
|
# -*- frozen_string_literal: true -*-
|
||||||
|
|
||||||
require "net/ftp"
|
require "net/ftp"
|
||||||
require "test/unit"
|
require "test/unit"
|
||||||
require "ostruct"
|
require "ostruct"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue