File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def binary?(file)
96
96
return false unless bytes
97
97
bytes = 4096 if bytes > 4096
98
98
s = ( File . read ( file , bytes ) || "" )
99
- s = s . encode ( "US-ASCII" , undef : :replace ) . split ( "" )
99
+ s = s . encode ( "US-ASCII" , undef : :replace ) . chars
100
100
( ( s . size - s . grep ( " " .."~" ) . size ) / s . size . to_f ) > 0.30
101
101
end
102
102
end
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class ClientTest < TinyTds::TestCase
47
47
assert_equal encoding , client . charset
48
48
assert_equal Encoding . find ( encoding ) , client . encoding
49
49
ensure
50
- client . close if client
50
+ client & .close
51
51
end
52
52
end
53
53
@@ -58,7 +58,7 @@ class ClientTest < TinyTds::TestCase
58
58
begin
59
59
client = new_connection dataserver : nil , host : host , port : port
60
60
ensure
61
- client . close if client
61
+ client & .close
62
62
end
63
63
end
64
64
end
You can’t perform that action at this time.
0 commit comments