gio2 4.2.1 → 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: e221e88eecd04ea55685378826bdf7a576025add33231e19d3c6759f9bcdb840
4
- data.tar.gz: 2a17be51dc3b1a63e073bb002c6238fd9364a4a020f58c74cf37a15d154486cb
3
+ metadata.gz: 01fa14486e6e5514bbf35b40d356c6561e2942041d656d8158a609837992162e
4
+ data.tar.gz: 2b03eac643e5cae2bf1cae3e465ab2523559c7a0933b5a74a64b6db50782cb40
5
5
  SHA512:
6
- metadata.gz: 31e568bc4355207ffa9fb29e179f9d6b43fb7fd0fb1beaf20c89f3e92502aebc98a0533de85e806a9aef6e044de963832008b2298062426f33d4aa8f23dbdde9
7
- data.tar.gz: 3245a585a905b8b6fdde2106cfbc26a8a73d38498a5c6661bcd77f05e89bb219bf7ada1ec193906ef6544ed96fdd9e2f57d07f935cfb9c8dea2e5c9e3700d11c
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) 2016 Ruby-GNOME2 Project Team
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
- class << self
20
- alias_method :registered_raw, :registered
21
- def registered
22
- registered_raw([]).collect do |type|
23
- new(type)
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
@@ -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,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gio2
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.3
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: 2024-02-22 00:00:00.000000000 Z
10
+ date: 2024-09-19 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.1
32
+ version: 4.2.3
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.1
39
+ version: 4.2.3
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
@@ -84,8 +84,11 @@ files:
84
84
  - test/fixture/content-type/x-content/unix-software/autorun.sh
85
85
  - test/fixture/resource/Rakefile
86
86
  - test/fixture/resource/logo.png
87
+ - test/fixture/resource/ruby-gio2.gresource
87
88
  - test/fixture/resource/ruby-gio2.gresource.xml
89
+ - test/fixture/schema/default/gschemas.compiled
88
90
  - test/fixture/schema/default/jp.ruby-gnome2.test.settings.gschema.xml
91
+ - test/fixture/schema/source/gschemas.compiled
89
92
  - test/fixture/schema/source/jp.ruby-gnome2.test.source.gschema.xml
90
93
  - test/gio2-test-utils.rb
91
94
  - test/gio2-test-utils/fixture.rb
@@ -105,6 +108,7 @@ files:
105
108
  - test/test-icon.rb
106
109
  - test/test-inet-address.rb
107
110
  - test/test-input-stream.rb
111
+ - test/test-list-model.rb
108
112
  - test/test-memory-input-stream.rb
109
113
  - test/test-memory-output-stream.rb
110
114
  - test/test-menu-item.rb
@@ -120,12 +124,11 @@ files:
120
124
  - test/test-settings.rb
121
125
  - test/test-simple-action.rb
122
126
  - test/test-version.rb
123
- homepage: https://ruby-gnome2.osdn.jp/
127
+ homepage: https://ruby-gnome.github.io/
124
128
  licenses:
125
129
  - LGPL-2.1+
126
130
  metadata:
127
131
  msys2_mingw_dependencies: glib-networking
128
- post_install_message:
129
132
  rdoc_options: []
130
133
  require_paths:
131
134
  - lib
@@ -140,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
143
  - !ruby/object:Gem::Version
141
144
  version: '0'
142
145
  requirements: []
143
- rubygems_version: 3.5.1
144
- signing_key:
146
+ rubygems_version: 3.6.0.dev
145
147
  specification_version: 4
146
148
  summary: Ruby/GIO2 is a Ruby binding of gio-2.x.
147
149
  test_files: []