gio2 3.3.7 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gio2/extconf.rb +3 -3
- data/gio2.gemspec +2 -2
- data/lib/gio2/icon.rb +24 -0
- data/lib/gio2/input-stream.rb +16 -8
- data/lib/gio2/loader.rb +14 -2
- data/test/gio2-test-utils/fixture.rb +1 -2
- data/test/run-test.rb +19 -9
- data/test/test-icon.rb +49 -0
- data/test/test-input-stream.rb +3 -3
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75fe99fb019058b4123b68e7e842775045cfef99abe481183159eec5358f647c
|
4
|
+
data.tar.gz: 44df8cb622524ab801addebcb4326274358db3b7fb08f5aa8c71683591764598
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60a1d62c7aa9a6ccc11538fd10c276df8560abb8857ed18c31ac4587b6999a9915f2ea19a16f25aec7ee90fc53d641f34b1a33195f2577b8200a49bb03aee54c
|
7
|
+
data.tar.gz: 31aeab7572e86ae2dd0345106c4717000c6bf29a3968437cb1ae4c4875c8374aca05874ae360fb89c40a9d97d31de8e0617d242e923031a0bc3cb3bad95a9ef3
|
data/ext/gio2/extconf.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014 Ruby-
|
3
|
+
# Copyright (C) 2014-2019 Ruby-GNOME Project Team
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -36,7 +36,7 @@ $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
|
|
36
36
|
module_name = "gio2"
|
37
37
|
package_id = "gio-2.0"
|
38
38
|
|
39
|
-
require "mkmf-
|
39
|
+
require "mkmf-gnome"
|
40
40
|
|
41
41
|
["glib2", "gobject-introspection"].each do |package|
|
42
42
|
directory = "#{package}#{version_suffix}"
|
@@ -52,7 +52,7 @@ end
|
|
52
52
|
unless required_pkg_config_package(package_id,
|
53
53
|
:alt_linux => "libgio-devel",
|
54
54
|
:debian => "libglib2.0-dev",
|
55
|
-
:redhat => "
|
55
|
+
:redhat => "pkgconfig(#{package_id})",
|
56
56
|
:arch_linux => "glib2",
|
57
57
|
:homebrew => "glib",
|
58
58
|
:macports => "glib2")
|
data/gio2.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2018 Ruby-
|
3
|
+
# Copyright (C) 2018 Ruby-GNOME Project Team
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.description =
|
25
25
|
"Ruby/GIO2 provide Ruby binding to a VFS API and useful APIs " +
|
26
26
|
"for desktop applications (such as networking and D-Bus support)."
|
27
|
-
s.author = "The Ruby-
|
27
|
+
s.author = "The Ruby-GNOME Project Team"
|
28
28
|
s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
|
29
29
|
s.homepage = "https://ruby-gnome2.osdn.jp/"
|
30
30
|
s.licenses = ["LGPL-2.1+"]
|
data/lib/gio2/icon.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Copyright (C) 2019 Ruby-GNOME Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
module Gio
|
18
|
+
module Icon
|
19
|
+
def eql?(other)
|
20
|
+
other.is_a?(self.class) and
|
21
|
+
hash == other.hash
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/gio2/input-stream.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-2019 Ruby-
|
1
|
+
# Copyright (C) 2014-2019 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -36,7 +36,7 @@ module Gio
|
|
36
36
|
buffer_size = 8192
|
37
37
|
buffer = " ".force_encoding("ASCII-8BIT") * buffer_size
|
38
38
|
loop do
|
39
|
-
|
39
|
+
read_bytes = read_all_raw_compatible(buffer)
|
40
40
|
all << buffer.byteslice(0, read_bytes)
|
41
41
|
break if read_bytes != buffer_size
|
42
42
|
end
|
@@ -52,25 +52,33 @@ module Gio
|
|
52
52
|
alias_method :read_all_raw, :read_all
|
53
53
|
def read_all(size)
|
54
54
|
buffer = " " * size
|
55
|
-
|
55
|
+
read_bytes = read_all_raw_compatible(buffer)
|
56
56
|
buffer.replace(buffer.byteslice(0, read_bytes))
|
57
57
|
buffer
|
58
58
|
end
|
59
59
|
|
60
60
|
private
|
61
61
|
def read_raw_compatible(buffer)
|
62
|
-
if (GLib::VERSION <=> [2,
|
62
|
+
if (GLib::VERSION <=> [2, 62, 0]) >= 0
|
63
|
+
read_bytes, _buffer = read_raw(buffer)
|
64
|
+
read_bytes
|
65
|
+
elsif (GLib::VERSION <=> [2, 36, 0]) >= 0
|
63
66
|
read_raw(buffer)
|
64
67
|
else
|
65
|
-
read_raw(buffer, buffer.bytesize)
|
68
|
+
read_bytes = read_raw(buffer, buffer.bytesize)
|
66
69
|
end
|
67
70
|
end
|
68
71
|
|
69
72
|
def read_all_raw_compatible(buffer)
|
70
|
-
if (GLib::VERSION <=> [2,
|
71
|
-
read_all_raw(buffer)
|
73
|
+
if (GLib::VERSION <=> [2, 62, 0]) >= 0
|
74
|
+
_success, _buffer, read_bytes = read_all_raw(buffer)
|
75
|
+
read_bytes
|
76
|
+
elsif (GLib::VERSION <=> [2, 36, 0]) >= 0
|
77
|
+
_success, read_bytes = read_all_raw(buffer)
|
78
|
+
read_bytes
|
72
79
|
else
|
73
|
-
read_all_raw(buffer, buffer.bytesize)
|
80
|
+
_success, read_bytes = read_all_raw(buffer, buffer.bytesize)
|
81
|
+
read_bytes
|
74
82
|
end
|
75
83
|
end
|
76
84
|
end
|
data/lib/gio2/loader.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2019 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -51,6 +51,7 @@ module Gio
|
|
51
51
|
require "gio2/application-command-line"
|
52
52
|
require "gio2/content-type"
|
53
53
|
require "gio2/file"
|
54
|
+
require "gio2/icon"
|
54
55
|
require "gio2/inet-address"
|
55
56
|
require "gio2/input-stream"
|
56
57
|
require "gio2/menu-item"
|
@@ -113,7 +114,7 @@ module Gio
|
|
113
114
|
when /\Adbus_/
|
114
115
|
name = rubyish_method_name(info, :prefix => "dbus_")
|
115
116
|
define_singleton_method(@dbus_module, name, info)
|
116
|
-
when /\
|
117
|
+
when /\A{file,icon}_/
|
117
118
|
# Ignore because they are defined by load_interface_info
|
118
119
|
else
|
119
120
|
super
|
@@ -171,6 +172,17 @@ module Gio
|
|
171
172
|
end
|
172
173
|
end
|
173
174
|
|
175
|
+
def load_function_info_singleton_method(info, klass, method_name)
|
176
|
+
case "#{klass.name}##{method_name}"
|
177
|
+
when "Gio::Icon#hash"
|
178
|
+
define_method(info, klass, method_name)
|
179
|
+
when "Gio::Icon#new_for_string"
|
180
|
+
super(info, klass, "find")
|
181
|
+
else
|
182
|
+
super
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
174
186
|
def rubyish_class_name(info)
|
175
187
|
case info.name
|
176
188
|
when /Enum\z/
|
@@ -17,8 +17,7 @@
|
|
17
17
|
module GioTestUtils
|
18
18
|
module Fixture
|
19
19
|
def fixture_path(*components)
|
20
|
-
|
21
|
-
File.expand_path(File.join(base_dir, *components))
|
20
|
+
File.expand_path(File.join("test", "fixture", *components))
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|
data/test/run-test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Copyright (C) 2013-
|
3
|
+
# Copyright (C) 2013-2020 Ruby-GNOME Project Team
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -16,12 +16,16 @@
|
|
16
16
|
# License along with this library; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
18
|
|
19
|
-
|
20
|
-
ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
|
19
|
+
require "fileutils"
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
build_dir = File.expand_path(".")
|
22
|
+
|
23
|
+
ruby_gnome_base = File.join(__dir__, "..", "..")
|
24
|
+
ruby_gnome_base = File.expand_path(ruby_gnome_base)
|
25
|
+
|
26
|
+
glib_base = File.join(ruby_gnome_base, "glib2")
|
27
|
+
gobject_introspection_base = File.join(ruby_gnome_base, "gobject-introspection")
|
28
|
+
gio2_base = File.join(ruby_gnome_base, "gio2")
|
25
29
|
|
26
30
|
modules = [
|
27
31
|
[glib_base, "glib2"],
|
@@ -38,11 +42,17 @@ modules.each do |target, module_name|
|
|
38
42
|
$LOAD_PATH.unshift(File.join(target, "lib"))
|
39
43
|
end
|
40
44
|
|
41
|
-
|
42
|
-
|
45
|
+
source_fixture_dir = File.join(gio2_base, "test", "fixture")
|
46
|
+
build_fixture_dir = File.join(build_dir, "test", "fixture")
|
47
|
+
unless source_fixture_dir == build_fixture_dir
|
48
|
+
FileUtils.rm_rf(build_fixture_dir)
|
49
|
+
FileUtils.mkdir_p(File.dirname(build_fixture_dir))
|
50
|
+
FileUtils.cp_r(source_fixture_dir, build_fixture_dir)
|
51
|
+
end
|
52
|
+
Dir.chdir(build_fixture_dir) do
|
43
53
|
system("rake") or exit(false)
|
44
54
|
end
|
45
|
-
ENV["GSETTINGS_SCHEMA_DIR"] = File.join(
|
55
|
+
ENV["GSETTINGS_SCHEMA_DIR"] = File.join(build_fixture_dir, "schema", "default")
|
46
56
|
|
47
57
|
$LOAD_PATH.unshift(File.join(glib_base, "test"))
|
48
58
|
require "glib-test-init"
|
data/test/test-icon.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Copyright (C) 2019 Ruby-GNOME Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
class TestIcon < Test::Unit::TestCase
|
18
|
+
include GioTestUtils::Fixture
|
19
|
+
include GioTestUtils::Omissions
|
20
|
+
|
21
|
+
sub_test_case(".find") do
|
22
|
+
def test_found
|
23
|
+
assert_equal(Gio::ThemedIcon.new("open"),
|
24
|
+
Gio::Icon.find("open"))
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_not_found
|
28
|
+
Gio::Icon.find("nonexistent")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
sub_test_case(".hash") do
|
33
|
+
def test_use_as_key
|
34
|
+
hash = {Gio::Icon => true}
|
35
|
+
assert do
|
36
|
+
hash[Gio::Icon]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
sub_test_case("#hash") do
|
42
|
+
def test_use_as_key
|
43
|
+
hash = {Gio::Icon.find("open") => true}
|
44
|
+
assert do
|
45
|
+
hash[Gio::Icon.find("open")]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
data/test/test-input-stream.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-2019 Ruby-
|
1
|
+
# Copyright (C) 2014-2019 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -56,9 +56,9 @@ class TestInputStream < Test::Unit::TestCase
|
|
56
56
|
input = nil
|
57
57
|
read_data = Gio::BufferedInputStream.open(@stream) do |i|
|
58
58
|
input = i
|
59
|
-
|
59
|
+
data = input.read(4)
|
60
60
|
input.close
|
61
|
-
|
61
|
+
data
|
62
62
|
end
|
63
63
|
assert_equal([@data[0, 4], true],
|
64
64
|
[read_data, input.closed?])
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gio2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- The Ruby-
|
7
|
+
- The Ruby-GNOME Project Team
|
8
|
+
autorequire:
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date:
|
11
|
+
date: 2020-05-02 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: gobject-introspection
|
@@ -15,14 +16,14 @@ dependencies:
|
|
15
16
|
requirements:
|
16
17
|
- - '='
|
17
18
|
- !ruby/object:Gem::Version
|
18
|
-
version: 3.
|
19
|
+
version: 3.4.2
|
19
20
|
type: :runtime
|
20
21
|
prerelease: false
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
22
23
|
requirements:
|
23
24
|
- - '='
|
24
25
|
- !ruby/object:Gem::Version
|
25
|
-
version: 3.
|
26
|
+
version: 3.4.2
|
26
27
|
description: Ruby/GIO2 provide Ruby binding to a VFS API and useful APIs for desktop
|
27
28
|
applications (such as networking and D-Bus support).
|
28
29
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
@@ -49,6 +50,7 @@ files:
|
|
49
50
|
- lib/gio2/content-type.rb
|
50
51
|
- lib/gio2/deprecated.rb
|
51
52
|
- lib/gio2/file.rb
|
53
|
+
- lib/gio2/icon.rb
|
52
54
|
- lib/gio2/inet-address.rb
|
53
55
|
- lib/gio2/input-stream.rb
|
54
56
|
- lib/gio2/loader.rb
|
@@ -81,6 +83,7 @@ files:
|
|
81
83
|
- test/test-file-enumerator.rb
|
82
84
|
- test/test-file-monitor.rb
|
83
85
|
- test/test-file.rb
|
86
|
+
- test/test-icon.rb
|
84
87
|
- test/test-inet-address.rb
|
85
88
|
- test/test-input-stream.rb
|
86
89
|
- test/test-memory-input-stream.rb
|
@@ -115,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
118
|
- !ruby/object:Gem::Version
|
116
119
|
version: '0'
|
117
120
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.2.0.pre1
|
119
122
|
signing_key:
|
120
123
|
specification_version: 4
|
121
124
|
summary: Ruby/GIO2 is a Ruby binding of gio-2.x.
|