gio2 3.3.6 → 3.4.1

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: 852d554d3e78a6b9c79bb99431e531bbfb123bd1cb5d457b34d6511ccba2c871
4
- data.tar.gz: f77f0d28354552d43c42445543e80c4bda4857f0a39e7b16fd46882ec94feafa
3
+ metadata.gz: 1415c46c7ff5e0fab8f474ed203bd49b4b414094f22d65180aa56334dda58292
4
+ data.tar.gz: 2a86babeda5105389d819cd19302e3ace84cdba0d9acb7e37564b2d7b4e94c5b
5
5
  SHA512:
6
- metadata.gz: 70ccbe75a0382d5d9d6d60681731c87a396fcc63cc3870a0d438031b5ecdd4a136fbc6cbb3844d169971af91d9a765155e13d25908b6c0b097895c4eae7266dc
7
- data.tar.gz: 98f2188796590570649db9c613bbb29b6477fb87fa27324460ffe9fa007dd382d7994df659ba2bb53b20f5d1bd114433e856e49dc61c37cf089dde934f918520
6
+ metadata.gz: 3c73b05e29d75c50a0f9f5d682cd44817a7c3a03a4ac55dc6887a9a3b7e5a537775915cb7a315dada211639a34791478b85506cb7c41dac099d4dac1bbf6b8ae
7
+ data.tar.gz: 9cb04fcfa3319801ae59bf45842bb8f7fff69ce284ce920a85a9e77f652854398192a5a1847cd2e82dc75baaeee78e202401c52b4abebb33ca9a1dd981a9db6f
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2014 Ruby-GNOME2 Project Team
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-gnome2"
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 => "glib2-devel",
55
+ :redhat => "pkgconfig(#{package_id})",
56
56
  :arch_linux => "glib2",
57
57
  :homebrew => "glib",
58
58
  :macports => "glib2")
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2018 Ruby-GNOME2 Project Team
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-GNOME2 Project Team"
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+"]
@@ -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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2019 Ruby-GNOME2 Project Team
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
- _, read_bytes = read_all_raw_compatible(buffer)
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
- _, read_bytes = read_all_raw_compatible(buffer)
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, 36, 0]) >= 0
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, 36, 0]) >= 0
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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2016 Ruby-GNOME2 Project Team
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 /\Afile_/
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/
@@ -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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2019 Ruby-GNOME2 Project Team
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
- _data = input.read(4)
59
+ data = input.read(4)
60
60
  input.close
61
- _data
61
+ data
62
62
  end
63
63
  assert_equal([@data[0, 4], true],
64
64
  [read_data, input.closed?])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gio2
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.6
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
- - The Ruby-GNOME2 Project Team
7
+ - The Ruby-GNOME Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-21 00:00:00.000000000 Z
11
+ date: 2019-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gobject-introspection
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.6
19
+ version: 3.4.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.3.6
26
+ version: 3.4.1
27
27
  description: Ruby/GIO2 provide Ruby binding to a VFS API and useful APIs for desktop
28
28
  applications (such as networking and D-Bus support).
29
29
  email: ruby-gnome2-devel-en@lists.sourceforge.net
@@ -50,6 +50,7 @@ files:
50
50
  - lib/gio2/content-type.rb
51
51
  - lib/gio2/deprecated.rb
52
52
  - lib/gio2/file.rb
53
+ - lib/gio2/icon.rb
53
54
  - lib/gio2/inet-address.rb
54
55
  - lib/gio2/input-stream.rb
55
56
  - lib/gio2/loader.rb
@@ -82,6 +83,7 @@ files:
82
83
  - test/test-file-enumerator.rb
83
84
  - test/test-file-monitor.rb
84
85
  - test/test-file.rb
86
+ - test/test-icon.rb
85
87
  - test/test-inet-address.rb
86
88
  - test/test-input-stream.rb
87
89
  - test/test-memory-input-stream.rb
@@ -116,7 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
118
  - !ruby/object:Gem::Version
117
119
  version: '0'
118
120
  requirements: []
119
- rubygems_version: 3.1.0.pre1
121
+ rubyforge_project:
122
+ rubygems_version: 2.7.6.2
120
123
  signing_key:
121
124
  specification_version: 4
122
125
  summary: Ruby/GIO2 is a Ruby binding of gio-2.x.