gio2 3.2.0-x64-mingw32 → 3.2.1-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2.2/gio2.so +0 -0
- data/lib/2.3/gio2.so +0 -0
- data/lib/2.4/gio2.so +0 -0
- data/lib/gio2/input-stream.rb +17 -1
- data/lib/gio2/loader.rb +14 -0
- data/test/test-input-stream.rb +28 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0020ead2243274e1308acaf43edcd976ca784302
|
4
|
+
data.tar.gz: 74198c4e33f5618b2ea91ec340ca5f3ab8e28b71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 806e0c17b88d4591d6c4cc1f8ebe17b32ca056830385fdcd65f6df3bebe1b7c379a15aec8f5c7f2e46480544ddf5a02da7aeb786709f696a524162ed8143b25f
|
7
|
+
data.tar.gz: 703c4125bb5bfec4dfc8f279abc5b14ae76139c9d9d2e07db477769ff0144d9c3df70d55212f09e8a5570978f7532c59a4122bd209226f62a46fd3412f58d623
|
data/lib/2.2/gio2.so
CHANGED
Binary file
|
data/lib/2.3/gio2.so
CHANGED
Binary file
|
data/lib/2.4/gio2.so
CHANGED
Binary file
|
data/lib/gio2/input-stream.rb
CHANGED
@@ -23,7 +23,7 @@ module Gio
|
|
23
23
|
buffer_size = 8192
|
24
24
|
buffer = " ".force_encoding("ASCII-8BIT") * buffer_size
|
25
25
|
loop do
|
26
|
-
read_bytes =
|
26
|
+
_, read_bytes = read_all_raw_compatible(buffer)
|
27
27
|
all << buffer.byteslice(0, read_bytes)
|
28
28
|
break if read_bytes != buffer_size
|
29
29
|
end
|
@@ -36,6 +36,14 @@ module Gio
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
alias_method :read_all_raw, :read_all
|
40
|
+
def read_all(size)
|
41
|
+
buffer = " " * size
|
42
|
+
_, read_bytes = read_all_raw_compatible(buffer)
|
43
|
+
buffer.replace(buffer.byteslice(0, read_bytes))
|
44
|
+
buffer
|
45
|
+
end
|
46
|
+
|
39
47
|
private
|
40
48
|
def read_raw_compatible(buffer)
|
41
49
|
if (GLib::VERSION <=> [2, 36, 0]) >= 0
|
@@ -44,5 +52,13 @@ module Gio
|
|
44
52
|
read_raw(buffer, buffer.bytesize)
|
45
53
|
end
|
46
54
|
end
|
55
|
+
|
56
|
+
def read_all_raw_compatible(buffer)
|
57
|
+
if (GLib::VERSION <=> [2, 36, 0]) >= 0
|
58
|
+
read_all_raw(buffer)
|
59
|
+
else
|
60
|
+
read_all_raw(buffer, buffer.bytesize)
|
61
|
+
end
|
62
|
+
end
|
47
63
|
end
|
48
64
|
end
|
data/lib/gio2/loader.rb
CHANGED
@@ -187,5 +187,19 @@ module Gio
|
|
187
187
|
def error_parent_class(info)
|
188
188
|
Error
|
189
189
|
end
|
190
|
+
|
191
|
+
def should_unlock_gvl?(function_info, klass)
|
192
|
+
case klass.name
|
193
|
+
when "Gio::InputStream"
|
194
|
+
case function_info.name
|
195
|
+
when "read", "read_all"
|
196
|
+
true
|
197
|
+
else
|
198
|
+
false
|
199
|
+
end
|
200
|
+
else
|
201
|
+
false
|
202
|
+
end
|
203
|
+
end
|
190
204
|
end
|
191
205
|
end
|
data/test/test-input-stream.rb
CHANGED
@@ -26,11 +26,35 @@ class TestInputStream < Test::Unit::TestCase
|
|
26
26
|
teardown_socket_client
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
sub_test_case("#read") do
|
30
|
+
def test_with_size
|
31
|
+
data = "Hello\n"
|
32
|
+
client = @server.accept
|
33
|
+
client.write(data)
|
34
|
+
client.flush
|
35
|
+
assert_equal("Hell", @stream.read(4))
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_without_size
|
39
|
+
data = "Hello\n"
|
40
|
+
client = @server.accept
|
41
|
+
client.write(data)
|
42
|
+
client.flush
|
43
|
+
client.close
|
44
|
+
assert_equal(data, @stream.read)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_read_all
|
31
49
|
client = @server.accept
|
32
|
-
client.write(
|
50
|
+
client.write("He")
|
33
51
|
client.flush
|
34
|
-
|
52
|
+
thread = Thread.new do
|
53
|
+
sleep(0.1)
|
54
|
+
client.write("llo")
|
55
|
+
client.flush
|
56
|
+
end
|
57
|
+
assert_equal("Hell", @stream.read_all(4))
|
58
|
+
thread.join
|
35
59
|
end
|
36
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gio2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME2 Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glib2
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.2.
|
19
|
+
version: 3.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.2.
|
26
|
+
version: 3.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gobject-introspection
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.2.
|
33
|
+
version: 3.2.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.2.
|
40
|
+
version: 3.2.1
|
41
41
|
description: Ruby/GIO2 is a Ruby binding of gio-2.x.
|
42
42
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
43
43
|
executables: []
|