gio2 4.2.9 → 4.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2cd558ee558dec88d8c50552ed5a21fdcd4d55a23f735ec5b3ba5b851e4b3c0
4
- data.tar.gz: 91dbc65f1c4b91c2be4097c0e207954326505b4e18fcdbab5e5027996f4c9cb6
3
+ metadata.gz: 6121635b732b04c98e445446e174a0a09e1a45f3fd3afd012f3d71e9ccf9a00f
4
+ data.tar.gz: b6f4863c19caa84981b4c7fd0ccfb8275cb6c526d4b8e4f13653505c3e1f4906
5
5
  SHA512:
6
- metadata.gz: bff13d14d94ef49a173cedfad503a8f7dff1b99088d2c05a05a907aed354d49bb256866680191851e1d1e3bfa34ac553684c934b3cc044b06220c9ce59570fc1
7
- data.tar.gz: 7a4609690361037fff004cea5483ae85de47017b51bc55c16297d6f4f5f07825b72d656895849546baffef26db1f7e549bdc7b24ffe836044c9a9dc7125a3e5d
6
+ metadata.gz: 8c191edd7865dddb43e31f8288a17838a73c75ba1fab41111231f2daecd43ef39ecbe3502c47488a68f26bb2bfef6fb8aee961b0c45799f3fc3046ecfc33d6dc
7
+ data.tar.gz: 70738058045a6f24e2c3751b1bbaa1cef90fbb9d57d6bf7f0f4d99dbcef5fce5e275f956d24e29cddb37cd742d09fc9a97040c636d1c5418d0dc3932de559a83
data/lib/gio2/action.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2015-2025 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
@@ -26,5 +26,16 @@ module Gio
26
26
  end
27
27
  activate_raw(parameter)
28
28
  end
29
+
30
+ alias_method :change_state_raw, :change_state
31
+ def change_state(value)
32
+ case value
33
+ when GLib::Variant
34
+ # do nothing
35
+ else
36
+ value = GLib::Variant.new(value, state_type)
37
+ end
38
+ change_state_raw(value)
39
+ end
29
40
  end
30
41
  end
@@ -0,0 +1,25 @@
1
+ # Copyright (C) 2025 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
+ class BytesIcon
19
+ alias_method :initialize_raw, :initialize
20
+ def initialize(bytes)
21
+ @bytes = bytes
22
+ initialize_raw(@bytes)
23
+ end
24
+ end
25
+ end
data/lib/gio2/loader.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2024 Ruby-GNOME Project Team
1
+ # Copyright (C) 2013-2025 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
@@ -58,28 +58,29 @@ module Gio
58
58
  end
59
59
 
60
60
  def require_libraries
61
- require "gio2/action"
62
- require "gio2/action-map"
63
- require "gio2/application-command-line"
64
- require "gio2/content-type"
65
- require "gio2/file"
66
- require "gio2/icon"
67
- require "gio2/inet-address"
68
- require "gio2/input-stream"
69
- require "gio2/list-model"
70
- require "gio2/menu-item"
71
- require "gio2/output-stream"
72
- require "gio2/pollable-input-stream"
73
- require "gio2/pollable-output-stream"
74
- require "gio2/resources"
75
- require "gio2/ruby-input-stream"
76
- require "gio2/ruby-output-stream"
77
- require "gio2/settings"
78
- require "gio2/settings-schema-source"
79
- require "gio2/simple-action"
80
- require "gio2/volume"
61
+ require_relative "action"
62
+ require_relative "action-map"
63
+ require_relative "application-command-line"
64
+ require_relative "bytes-icon"
65
+ require_relative "content-type"
66
+ require_relative "file"
67
+ require_relative "icon"
68
+ require_relative "inet-address"
69
+ require_relative "input-stream"
70
+ require_relative "list-model"
71
+ require_relative "menu-item"
72
+ require_relative "output-stream"
73
+ require_relative "pollable-input-stream"
74
+ require_relative "pollable-output-stream"
75
+ require_relative "resources"
76
+ require_relative "ruby-input-stream"
77
+ require_relative "ruby-output-stream"
78
+ require_relative "settings"
79
+ require_relative "settings-schema-source"
80
+ require_relative "simple-action"
81
+ require_relative "volume"
81
82
 
82
- require "gio2/deprecated"
83
+ require_relative "deprecated"
83
84
  end
84
85
 
85
86
  def define_content_type_class
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2018-2025 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
@@ -34,7 +34,10 @@ module Gio
34
34
  define_method(name) do
35
35
  self[Gio.const_get(constant_name)]
36
36
  end
37
- define_method("#{name}=") do |value|
37
+
38
+ setter = "#{name}="
39
+ next if method_defined?(setter)
40
+ define_method(setter) do |value|
38
41
  self[Gio.const_get(constant_name)] = value
39
42
  end
40
43
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2018-2025 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
@@ -35,5 +35,13 @@ class TestMenuItem < Test::Unit::TestCase
35
35
  @menu_item.action_namespace = "doc"
36
36
  assert_equal("doc", @menu_item.action_namespace)
37
37
  end
38
+
39
+ test "icon" do
40
+ only_gio_version(2, 36, 0)
41
+ assert_nil(@menu_item.action_namespace)
42
+ icon = Gio::ThemedIcon.new("edit")
43
+ @menu_item.icon = icon
44
+ assert_equal(icon.serialize, @menu_item.icon)
45
+ end
38
46
  end
39
47
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2015-2025 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
@@ -41,4 +41,24 @@ class TestSimpleAction < Test::Unit::TestCase
41
41
  end
42
42
  end
43
43
  end
44
+
45
+ sub_test_case "#change_state" do
46
+ def setup
47
+ @action = Gio::SimpleAction.new("show", nil, GLib::Variant.new(true))
48
+ end
49
+
50
+ test "GLib::Variant" do
51
+ @action.change_state(GLib::Variant.new(false))
52
+ assert do
53
+ not @action.state
54
+ end
55
+ end
56
+
57
+ test "false" do
58
+ @action.change_state(false)
59
+ assert do
60
+ not @action.state
61
+ end
62
+ end
63
+ end
44
64
  end
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.9
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME Project Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 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.9
32
+ version: 4.3.0
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.9
39
+ version: 4.3.0
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
@@ -60,6 +60,7 @@ files:
60
60
  - lib/gio2/action-map.rb
61
61
  - lib/gio2/action.rb
62
62
  - lib/gio2/application-command-line.rb
63
+ - lib/gio2/bytes-icon.rb
63
64
  - lib/gio2/content-type.rb
64
65
  - lib/gio2/deprecated.rb
65
66
  - lib/gio2/file.rb
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
141
  - !ruby/object:Gem::Version
141
142
  version: '0'
142
143
  requirements: []
143
- rubygems_version: 3.6.2
144
+ rubygems_version: 3.6.7
144
145
  specification_version: 4
145
146
  summary: Ruby/GIO2 is a Ruby binding of gio-2.x.
146
147
  test_files: []