gio2 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gio2/depend +6 -0
- data/lib/gio2/input-stream.rb +11 -2
- data/lib/gio2/loader.rb +0 -1
- data/lib/gio2/pollable-input-stream.rb +11 -2
- data/lib/gio2/pollable-output-stream.rb +0 -5
- data/test/gio2-test-utils.rb +1 -0
- data/{lib/gio2/output-stream.rb → test/gio2-test-utils/omissions.rb} +4 -5
- data/test/test-content-type.rb +3 -0
- data/test/test-file.rb +2 -0
- metadata +15 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b28792d8ada22c3b23c22e0ee4239dee5d33331
|
4
|
+
data.tar.gz: 851605208084c3406574c44e56bb7ef3782e04ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b555a9f5c08dbca58cf4598f4626ead8314c5787c17017b415f425e212397cb0bb1db6f7cdd89a0afe48796e855931ad0d33967dfbe145ffd77cf1f971668fb3
|
7
|
+
data.tar.gz: 986fd2010e21e726402b839d822efb4112d18b8d3ca231a636257d6bbda46afdb53060e2935b3245277838e11f4c6efe50b3f85551ab66b273a424ed14af2d1e
|
data/ext/gio2/depend
ADDED
data/lib/gio2/input-stream.rb
CHANGED
@@ -23,17 +23,26 @@ 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_raw_compatible(buffer)
|
27
27
|
all << buffer.byteslice(0, read_bytes)
|
28
28
|
break if read_bytes != buffer_size
|
29
29
|
end
|
30
30
|
all
|
31
31
|
else
|
32
32
|
buffer = " " * size
|
33
|
-
read_bytes =
|
33
|
+
read_bytes = read_raw_compatible(buffer)
|
34
34
|
buffer.replace(buffer.byteslice(0, read_bytes))
|
35
35
|
buffer
|
36
36
|
end
|
37
37
|
end
|
38
|
+
|
39
|
+
private
|
40
|
+
def read_raw_compatible(buffer)
|
41
|
+
if (GLib::VERSION <=> [2, 36, 0]) >= 0
|
42
|
+
read_raw(buffer)
|
43
|
+
else
|
44
|
+
read_raw(buffer, buffer.bytesize)
|
45
|
+
end
|
46
|
+
end
|
38
47
|
end
|
39
48
|
end
|
data/lib/gio2/loader.rb
CHANGED
@@ -32,7 +32,7 @@ module Gio
|
|
32
32
|
buffer = " ".force_encoding("ASCII-8BIT") * buffer_size
|
33
33
|
loop do
|
34
34
|
begin
|
35
|
-
read_bytes =
|
35
|
+
read_bytes = read_nonblocking_raw_compatible(buffer)
|
36
36
|
rescue IOError::WouldBlock
|
37
37
|
break
|
38
38
|
end
|
@@ -42,10 +42,19 @@ module Gio
|
|
42
42
|
all
|
43
43
|
else
|
44
44
|
buffer = " " * size
|
45
|
-
read_bytes =
|
45
|
+
read_bytes = read_nonblocking_raw_compatible(buffer)
|
46
46
|
buffer.replace(buffer.byteslice(0, read_bytes))
|
47
47
|
buffer
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
private
|
52
|
+
def read_nonblocking_raw_compatible(buffer)
|
53
|
+
if (GLib::VERSION <=> [2, 42, 0]) >= 0
|
54
|
+
read_nonblocking_raw(buffer)
|
55
|
+
else
|
56
|
+
read_nonblocking_raw(buffer, buffer.bytesize)
|
57
|
+
end
|
58
|
+
end
|
50
59
|
end
|
51
60
|
end
|
data/test/gio2-test-utils.rb
CHANGED
@@ -14,11 +14,10 @@
|
|
14
14
|
# License along with this library; if not, write to the Free Software
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
|
-
module
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
write_raw(data, data.bytesize)
|
17
|
+
module GioTestUtils
|
18
|
+
module Omissions
|
19
|
+
def omit_on_os_x
|
20
|
+
omit("Skip this test on OS X") if RUBY_PLATFORM =~ /darwin/
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|
data/test/test-content-type.rb
CHANGED
@@ -15,6 +15,8 @@
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
17
|
class TestContentType < Test::Unit::TestCase
|
18
|
+
include GioTestUtils::Omissions
|
19
|
+
|
18
20
|
def setup
|
19
21
|
@content_type = Gio::ContentType.new("image/jpeg")
|
20
22
|
end
|
@@ -25,6 +27,7 @@ class TestContentType < Test::Unit::TestCase
|
|
25
27
|
end
|
26
28
|
|
27
29
|
def test_guess
|
30
|
+
omit_on_os_x
|
28
31
|
assert_equal(["audio/mpeg", false],
|
29
32
|
Gio::ContentType.guess("filename.mp3"))
|
30
33
|
end
|
data/test/test-file.rb
CHANGED
@@ -16,9 +16,11 @@
|
|
16
16
|
|
17
17
|
class TestFile < Test::Unit::TestCase
|
18
18
|
include GioTestUtils::Fixture
|
19
|
+
include GioTestUtils::Omissions
|
19
20
|
|
20
21
|
class TestContentType < self
|
21
22
|
def test_guess_content_type
|
23
|
+
omit_on_os_x
|
22
24
|
path = fixture_path("content-type", "x-content", "unix-software")
|
23
25
|
dir = Gio::File.path(path)
|
24
26
|
assert_equal(["x-content/unix-software"],
|
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: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME2 Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-12 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: 2.2.
|
19
|
+
version: 2.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: 2.2.
|
26
|
+
version: 2.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: 2.2.
|
33
|
+
version: 2.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: 2.2.
|
40
|
+
version: 2.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: []
|
@@ -46,20 +46,20 @@ extensions:
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- Rakefile
|
49
|
+
- ext/gio2/depend
|
50
|
+
- ext/gio2/extconf.rb
|
51
|
+
- ext/gio2/rb-gio2-pollable-source.c
|
52
|
+
- ext/gio2/rb-gio2.c
|
53
|
+
- ext/gio2/rb-gio2.h
|
49
54
|
- extconf.rb
|
50
55
|
- lib/gio2.rb
|
51
56
|
- lib/gio2/deprecated.rb
|
52
57
|
- lib/gio2/inet-address.rb
|
53
58
|
- lib/gio2/input-stream.rb
|
54
59
|
- lib/gio2/loader.rb
|
55
|
-
- lib/gio2/output-stream.rb
|
56
60
|
- lib/gio2/pollable-input-stream.rb
|
57
61
|
- lib/gio2/pollable-output-stream.rb
|
58
62
|
- lib/gio2/resources.rb
|
59
|
-
- ext/gio2/extconf.rb
|
60
|
-
- ext/gio2/rb-gio2-pollable-source.c
|
61
|
-
- ext/gio2/rb-gio2.c
|
62
|
-
- ext/gio2/rb-gio2.h
|
63
63
|
- test/fixture/content-type/x-content/unix-software/autorun.sh
|
64
64
|
- test/fixture/resource/Rakefile
|
65
65
|
- test/fixture/resource/logo.png
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- test/fixture/resource/ruby-gio2.gresource.xml
|
68
68
|
- test/gio2-test-utils.rb
|
69
69
|
- test/gio2-test-utils/fixture.rb
|
70
|
+
- test/gio2-test-utils/omissions.rb
|
70
71
|
- test/gio2-test-utils/socket-client.rb
|
71
72
|
- test/run-test.rb
|
72
73
|
- test/test-buffered-input-stream.rb
|
@@ -92,17 +93,17 @@ require_paths:
|
|
92
93
|
- lib
|
93
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
94
95
|
requirements:
|
95
|
-
- -
|
96
|
+
- - ">="
|
96
97
|
- !ruby/object:Gem::Version
|
97
98
|
version: 1.9.3
|
98
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
100
|
requirements:
|
100
|
-
- -
|
101
|
+
- - ">="
|
101
102
|
- !ruby/object:Gem::Version
|
102
103
|
version: '0'
|
103
104
|
requirements: []
|
104
105
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.2.2
|
106
107
|
signing_key:
|
107
108
|
specification_version: 4
|
108
109
|
summary: Ruby/GIO2 is a Ruby binding of gio-2.x.
|