gio2 4.2.2 → 4.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8daf7d00e6d639ce114c7f42700abd812cef10c26e4912d8ef8b3e8a6b8839e1
4
- data.tar.gz: 5e158a985f5e8c60828c4da0c80695862bcd6403db0487d62b0d08d40b532c5d
3
+ metadata.gz: 01fa14486e6e5514bbf35b40d356c6561e2942041d656d8158a609837992162e
4
+ data.tar.gz: 2b03eac643e5cae2bf1cae3e465ab2523559c7a0933b5a74a64b6db50782cb40
5
5
  SHA512:
6
- metadata.gz: f98a75f9f59dadc6eb2a7511f22c41306f5b1b86fb9795b2915bcc35376b2b87dd029c7a151f0d433826bc25ac26bf28d5e4ca2e8e805e21c2783551f6dab11a
7
- data.tar.gz: 29306c2a16c013ff8e234b36b669526e59c602596d143459a4b127e8d037059eb0460097b2fe9b11ad9094a8d074692f5bcbda9dee1c9a1b041317074595dc9e
6
+ metadata.gz: 6bd03c72fae2156efa11c93b3473769ad30ed37655ec50da037e958d16aed308835f70704a3a70f9a5dd189bb25def5c1ffb98a4463ce1769c0ddda1075a052d
7
+ data.tar.gz: 8db2cadddd08879bfbbff35805b67dc172ce27ba73bb7705e9a7263717e5b154f4da824fc189ddf3b2d966297f5a9ed5b3e26d7ba21d754326141bcdf0e33936
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-gnome2.osdn.jp/)
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-gnome2.osdn.jp/
24
+ https://ruby-gnome.github.io/
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-gnome2.osdn.jp/"
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"]
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2021 Ruby-GNOME Project Team
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 = "".force_encoding("ASCII-8BIT")
35
+ all = "".b
36
36
  buffer_size = 8192
37
- buffer = " ".force_encoding("ASCII-8BIT") * buffer_size
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-2023 Ruby-GNOME Project Team
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-GNOME2 Project Team
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 = "".force_encoding("ASCII-8BIT")
30
+ all = "".b
31
31
  buffer_size = 8192
32
- buffer = " ".force_encoding("ASCII-8BIT") * buffer_size
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,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gio2
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.2
4
+ version: 4.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME Project Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2024-04-02 00:00:00.000000000 Z
10
+ date: 2024-09-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: fiddle
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 4.2.2
32
+ version: 4.2.3
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 4.2.2
39
+ version: 4.2.3
40
40
  description: Ruby/GIO2 provide Ruby binding to a VFS API and useful APIs for desktop
41
41
  applications (such as networking and D-Bus support).
42
42
  email: ruby-gnome2-devel-en@lists.sourceforge.net
@@ -66,6 +66,7 @@ files:
66
66
  - lib/gio2/icon.rb
67
67
  - lib/gio2/inet-address.rb
68
68
  - lib/gio2/input-stream.rb
69
+ - lib/gio2/list-model.rb
69
70
  - lib/gio2/loader.rb
70
71
  - lib/gio2/menu-item.rb
71
72
  - lib/gio2/output-stream.rb
@@ -83,8 +84,11 @@ files:
83
84
  - test/fixture/content-type/x-content/unix-software/autorun.sh
84
85
  - test/fixture/resource/Rakefile
85
86
  - test/fixture/resource/logo.png
87
+ - test/fixture/resource/ruby-gio2.gresource
86
88
  - test/fixture/resource/ruby-gio2.gresource.xml
89
+ - test/fixture/schema/default/gschemas.compiled
87
90
  - test/fixture/schema/default/jp.ruby-gnome2.test.settings.gschema.xml
91
+ - test/fixture/schema/source/gschemas.compiled
88
92
  - test/fixture/schema/source/jp.ruby-gnome2.test.source.gschema.xml
89
93
  - test/gio2-test-utils.rb
90
94
  - test/gio2-test-utils/fixture.rb
@@ -104,6 +108,7 @@ files:
104
108
  - test/test-icon.rb
105
109
  - test/test-inet-address.rb
106
110
  - test/test-input-stream.rb
111
+ - test/test-list-model.rb
107
112
  - test/test-memory-input-stream.rb
108
113
  - test/test-memory-output-stream.rb
109
114
  - test/test-menu-item.rb
@@ -119,7 +124,7 @@ files:
119
124
  - test/test-settings.rb
120
125
  - test/test-simple-action.rb
121
126
  - test/test-version.rb
122
- homepage: https://ruby-gnome2.osdn.jp/
127
+ homepage: https://ruby-gnome.github.io/
123
128
  licenses:
124
129
  - LGPL-2.1+
125
130
  metadata: