gio2 4.2.0 → 4.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +2 -2
- data/gio2.gemspec +1 -1
- data/lib/gio2/content-type.rb +8 -6
- data/lib/gio2/input-stream.rb +5 -5
- data/lib/gio2/list-model.rb +32 -0
- data/lib/gio2/loader.rb +12 -1
- data/lib/gio2/pollable-input-stream.rb +4 -4
- data/lib/gio2/ruby-input-stream.rb +2 -2
- data/test/test-list-model.rb +40 -0
- data/test/test-ruby-input-stream.rb +2 -2
- data/test/test-ruby-output-stream.rb +2 -2
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c60f50771f40016ef96b368a141240417fdd0c13a2d9a6580f974bccba4c3c
|
4
|
+
data.tar.gz: 51fe3825149f20560411b969a2e695b6e1b520d467b2fcd9898527b57a92a90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abe1a719bff415cd18ce000875f14277a08c7ec5cf19b14e9681543874eeac848956689559cdd645e94f0f7c8408cdea9e0a0b904ab84fd7058e6319506bad0c
|
7
|
+
data.tar.gz: 9b2bd15361b98c4a8b53d19cb4c398d3c0a19169c318533510accc9d18f524f921e1f1663ecb26abfc43b9ff83a7a20c563a75b436c3d7dceede6b4e270c56da
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Ruby/GIO2 is a Ruby binding of gio-2.0.x.
|
|
5
5
|
## Requirements
|
6
6
|
|
7
7
|
* Ruby/GObjectIntrospection in
|
8
|
-
[Ruby-GNOME2](https://ruby-
|
8
|
+
[Ruby-GNOME2](https://ruby-gnome.github.io/)
|
9
9
|
* [GIO](http://library.gnome.org/devel/gio/stable)
|
10
10
|
|
11
11
|
## Install
|
@@ -21,4 +21,4 @@ under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
|
|
21
21
|
|
22
22
|
## Project Website
|
23
23
|
|
24
|
-
https://ruby-
|
24
|
+
https://ruby-gnome.github.io/
|
data/Rakefile
CHANGED
@@ -17,10 +17,10 @@
|
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
18
|
|
19
19
|
$LOAD_PATH.unshift("./../glib2/lib")
|
20
|
-
require "
|
20
|
+
require "gnome/rake/package-task"
|
21
21
|
|
22
22
|
package_name = File.basename(__dir__)
|
23
23
|
spec = Gem::Specification.load("#{package_name}.gemspec")
|
24
24
|
|
25
|
-
|
25
|
+
GNOME::Rake::PackageTask.define(spec, __dir__) do |package|
|
26
26
|
end
|
data/gio2.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
"for desktop applications (such as networking and D-Bus support)."
|
27
27
|
s.author = "The Ruby-GNOME Project Team"
|
28
28
|
s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
|
29
|
-
s.homepage = "https://ruby-
|
29
|
+
s.homepage = "https://ruby-gnome.github.io/"
|
30
30
|
s.licenses = ["LGPL-2.1+"]
|
31
31
|
s.version = ruby_glib2_version
|
32
32
|
s.extensions = ["ext/#{s.name}/extconf.rb"]
|
data/lib/gio2/content-type.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2016 Ruby-
|
1
|
+
# Copyright (C) 2016-2024 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
|
@@ -16,11 +16,13 @@
|
|
16
16
|
|
17
17
|
module Gio
|
18
18
|
class ContentType
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
if respond_to?(:registered)
|
20
|
+
class << self
|
21
|
+
alias_method :registered_raw, :registered
|
22
|
+
def registered
|
23
|
+
registered_raw.collect do |type|
|
24
|
+
new(type)
|
25
|
+
end
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
data/lib/gio2/input-stream.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-
|
1
|
+
# Copyright (C) 2014-2024 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
|
@@ -32,9 +32,9 @@ module Gio
|
|
32
32
|
alias_method :read_raw, :read
|
33
33
|
def read(size=nil)
|
34
34
|
if size.nil?
|
35
|
-
all = "".
|
35
|
+
all = "".b
|
36
36
|
buffer_size = 8192
|
37
|
-
buffer = " ".
|
37
|
+
buffer = " ".b * buffer_size
|
38
38
|
loop do
|
39
39
|
read_bytes = read_all_raw_compatible(buffer)
|
40
40
|
all << buffer.byteslice(0, read_bytes)
|
@@ -42,7 +42,7 @@ module Gio
|
|
42
42
|
end
|
43
43
|
all
|
44
44
|
else
|
45
|
-
buffer = " " * size
|
45
|
+
buffer = " ".b * size
|
46
46
|
read_bytes = read_raw_compatible(buffer)
|
47
47
|
buffer.replace(buffer.byteslice(0, read_bytes))
|
48
48
|
buffer
|
@@ -51,7 +51,7 @@ module Gio
|
|
51
51
|
|
52
52
|
alias_method :read_all_raw, :read_all
|
53
53
|
def read_all(size)
|
54
|
-
buffer = " " * size
|
54
|
+
buffer = " ".b * size
|
55
55
|
read_bytes = read_all_raw_compatible(buffer)
|
56
56
|
buffer.replace(buffer.byteslice(0, read_bytes))
|
57
57
|
buffer
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Copyright (C) 2024 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 ListModel
|
19
|
+
include Enumerable
|
20
|
+
|
21
|
+
def each(&block)
|
22
|
+
return to_enum(__method__) unless block_given?
|
23
|
+
n_items.times do |i|
|
24
|
+
yield(get_item(i))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def [](index)
|
29
|
+
get_item(index)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/gio2/loader.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2024 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
|
@@ -66,6 +66,7 @@ module Gio
|
|
66
66
|
require "gio2/icon"
|
67
67
|
require "gio2/inet-address"
|
68
68
|
require "gio2/input-stream"
|
69
|
+
require "gio2/list-model"
|
69
70
|
require "gio2/menu-item"
|
70
71
|
require "gio2/output-stream"
|
71
72
|
require "gio2/pollable-input-stream"
|
@@ -211,6 +212,16 @@ module Gio
|
|
211
212
|
end
|
212
213
|
end
|
213
214
|
|
215
|
+
def load_interface_info(info)
|
216
|
+
super
|
217
|
+
case info.gtype.name
|
218
|
+
when "GListModel"
|
219
|
+
# This is workaround for Ruby < 3.
|
220
|
+
# AlmaLinux 8 and Ubuntu 20.04 still use Ruby < 3.
|
221
|
+
require_relative "list-model"
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
214
225
|
def rubyish_method_name(function_info, options={})
|
215
226
|
case function_info.name
|
216
227
|
when "get_mount"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014 Ruby-
|
1
|
+
# Copyright (C) 2014-2024 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
|
@@ -27,9 +27,9 @@ module Gio
|
|
27
27
|
alias_method :read_nonblocking_raw, :read_nonblocking
|
28
28
|
def read_nonblocking(size=nil)
|
29
29
|
if size.nil?
|
30
|
-
all = "".
|
30
|
+
all = "".b
|
31
31
|
buffer_size = 8192
|
32
|
-
buffer = " ".
|
32
|
+
buffer = " ".b * buffer_size
|
33
33
|
loop do
|
34
34
|
begin
|
35
35
|
read_bytes = read_nonblocking_raw_compatible(buffer)
|
@@ -41,7 +41,7 @@ module Gio
|
|
41
41
|
end
|
42
42
|
all
|
43
43
|
else
|
44
|
-
buffer = " " * size
|
44
|
+
buffer = " ".b * size
|
45
45
|
read_bytes = read_nonblocking_raw_compatible(buffer)
|
46
46
|
buffer.replace(buffer.byteslice(0, read_bytes))
|
47
47
|
buffer
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2021 Ruby-GNOME Project Team
|
1
|
+
# Copyright (C) 2021-2024 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
|
@@ -27,7 +27,7 @@ module Gio
|
|
27
27
|
|
28
28
|
def initialize(ruby_input)
|
29
29
|
@ruby_input = ruby_input
|
30
|
-
@buffer = ""
|
30
|
+
@buffer = +""
|
31
31
|
super()
|
32
32
|
end
|
33
33
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright (C) 2024 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 TestListModel < Test::Unit::TestCase
|
18
|
+
def setup
|
19
|
+
@list_model = Gio::ListStore.new(Gio::SimpleAction)
|
20
|
+
@elements = [
|
21
|
+
Gio::SimpleAction.new("a"),
|
22
|
+
Gio::SimpleAction.new("b"),
|
23
|
+
]
|
24
|
+
@elements.each do |element|
|
25
|
+
@list_model.append(element)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_aref
|
30
|
+
assert_equal(@elements[0], @list_model[0])
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_each
|
34
|
+
assert_equal(@elements, @list_model.to_a)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_each_without_block
|
38
|
+
assert_equal(@elements, @list_model.each.to_a)
|
39
|
+
end
|
40
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2021 Ruby-GNOME Project Team
|
1
|
+
# Copyright (C) 2021-2024 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
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
class TestRubyInputStream < Test::Unit::TestCase
|
18
18
|
def setup
|
19
|
-
@base_stream = StringIO.new("Hello!")
|
19
|
+
@base_stream = StringIO.new(+"Hello!")
|
20
20
|
Gio::RubyInputStream.open(@base_stream) do |stream|
|
21
21
|
@stream = stream
|
22
22
|
yield
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2021 Ruby-GNOME Project Team
|
1
|
+
# Copyright (C) 2021-2024 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
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
class TestRubyOutputStream < Test::Unit::TestCase
|
18
18
|
def setup
|
19
|
-
@base_stream = StringIO.new("Hello World")
|
19
|
+
@base_stream = StringIO.new(+"Hello World")
|
20
20
|
Gio::RubyOutputStream.open(@base_stream) do |stream|
|
21
21
|
@stream = stream
|
22
22
|
yield
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gio2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-28 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: fiddle
|
@@ -30,14 +29,14 @@ dependencies:
|
|
30
29
|
requirements:
|
31
30
|
- - '='
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.2.
|
32
|
+
version: 4.2.7
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - '='
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.2.
|
39
|
+
version: 4.2.7
|
41
40
|
description: Ruby/GIO2 provide Ruby binding to a VFS API and useful APIs for desktop
|
42
41
|
applications (such as networking and D-Bus support).
|
43
42
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
@@ -67,6 +66,7 @@ files:
|
|
67
66
|
- lib/gio2/icon.rb
|
68
67
|
- lib/gio2/inet-address.rb
|
69
68
|
- lib/gio2/input-stream.rb
|
69
|
+
- lib/gio2/list-model.rb
|
70
70
|
- lib/gio2/loader.rb
|
71
71
|
- lib/gio2/menu-item.rb
|
72
72
|
- lib/gio2/output-stream.rb
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- test/test-icon.rb
|
106
106
|
- test/test-inet-address.rb
|
107
107
|
- test/test-input-stream.rb
|
108
|
+
- test/test-list-model.rb
|
108
109
|
- test/test-memory-input-stream.rb
|
109
110
|
- test/test-memory-output-stream.rb
|
110
111
|
- test/test-menu-item.rb
|
@@ -120,12 +121,11 @@ files:
|
|
120
121
|
- test/test-settings.rb
|
121
122
|
- test/test-simple-action.rb
|
122
123
|
- test/test-version.rb
|
123
|
-
homepage: https://ruby-
|
124
|
+
homepage: https://ruby-gnome.github.io/
|
124
125
|
licenses:
|
125
126
|
- LGPL-2.1+
|
126
127
|
metadata:
|
127
128
|
msys2_mingw_dependencies: glib-networking
|
128
|
-
post_install_message:
|
129
129
|
rdoc_options: []
|
130
130
|
require_paths:
|
131
131
|
- lib
|
@@ -140,8 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
144
|
-
signing_key:
|
143
|
+
rubygems_version: 3.6.2
|
145
144
|
specification_version: 4
|
146
145
|
summary: Ruby/GIO2 is a Ruby binding of gio-2.x.
|
147
146
|
test_files: []
|