gdk3 3.3.9 → 3.4.4

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: 21f1b3595cf6d2293b2329fde5804fead53367c341a47ea5d5c4e723ff64e636
4
- data.tar.gz: 5bc62e20ec7641c9b722c64c76180302f259ac04a7799040d9a684852ee209f4
3
+ metadata.gz: 94fdb8a714f11ae8a04b5d0afae927619a82d03e347d8713bfd41ac86df30ac4
4
+ data.tar.gz: 95a2f1c1c3e56a3d492e07864b6aa66b1484f4f5486f674996d47ba68c2de8a9
5
5
  SHA512:
6
- metadata.gz: 9cdd8961c23d6a6207d2a8f502312f209134f5bdc8c3175be29265b6f7b35dffb14097ed916f76daa23118abdba8636e3893a96ecbf755efc1ffc4c60b3ff02d
7
- data.tar.gz: 4f41bc90b758d98d4dd4525ae220896fd02702008b1b57df6118d75947b12a64fd4a1311128be5e3cfef9ee2833a731c0a182bf1200e3c2a64f548253a562443
6
+ metadata.gz: cf995bbd2a4a58c1785dcf173478e0f8703472d9a6c7385e2f84fd7804f5062f6d7a1f05cd56576e7cf9130da4d10afc524a2c5932708f1c31b8dc12cbeda669
7
+ data.tar.gz: ac4c8cf89a4cb2fe81fc91584f8c2279364200f0aa8ce73a5258d7d3ab8e925ab093b3eaeabf1fb52a4e8cdd0de293cb8fa6fd4e56140e65f9796b2a780d2132
data/lib/gdk3/color.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014 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
@@ -27,15 +27,22 @@ module Gdk
27
27
  message << "\"\#rrggbb\", "
28
28
  message << "\"\#rrggbb\", "
29
29
  message << "\"\#rrrgggbbb\", "
30
- message << "\"\#rrrrggggbbbb\", "
31
- message << "\"\#fff\", "
32
- message << "\"\#ffffff\", "
33
- message << "\"\#fffffffff\", "
34
- message << "\"\#fffffffffffff\""
30
+ message << "\"\#rrrrggggbbbb\""
35
31
  raise ArgumentError, message
36
32
  end
37
33
  color
38
34
  end
35
+
36
+ def try_convert(value)
37
+ case value
38
+ when String
39
+ parse(value)
40
+ when Symbol
41
+ parse(value.to_s)
42
+ else
43
+ nil
44
+ end
45
+ end
39
46
  end
40
47
 
41
48
  alias_method :initialize_raw, :initialize
data/lib/gdk3/rgba.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014 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
@@ -35,6 +35,17 @@ module Gdk
35
35
  end
36
36
  rgba
37
37
  end
38
+
39
+ def try_convert(value)
40
+ case value
41
+ when String
42
+ parse(value)
43
+ when Symbol
44
+ parse(value.to_s)
45
+ else
46
+ nil
47
+ end
48
+ end
38
49
  end
39
50
 
40
51
  alias_method :initialize_raw, :initialize
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2019 Ruby-GNOME Project Team
1
+ # Copyright (C) 2013-2021 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
@@ -17,6 +17,8 @@
17
17
  require "pkg-config"
18
18
  require "test-unit"
19
19
 
20
+ require "gdk3"
21
+
20
22
  module GdkTestUtils
21
23
  private
22
24
  def only_gdk_version(major, minor, micro=nil)
data/test/run-test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2013-2019 Ruby-GNOME Project Team
3
+ # Copyright (C) 2013-2021 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
@@ -16,45 +16,21 @@
16
16
  # License along with this library; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
- ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
20
- ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
21
-
22
- glib_base = File.join(ruby_gnome2_base, "glib2")
23
- gio_base = File.join(ruby_gnome2_base, "gio2")
24
- atk_base = File.join(ruby_gnome2_base, "atk")
25
- cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject")
26
- pango_base = File.join(ruby_gnome2_base, "pango")
27
- gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2")
28
- gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
29
- gdk3_base = File.join(ruby_gnome2_base, "gdk3")
30
-
31
- [
32
- [glib_base, "glib2"],
33
- [gio_base, "gio2"],
34
- [atk_base, "atk"],
35
- [cairo_gobject_base, "cairo-gobject"],
36
- [pango_base, "pango"],
37
- [gdk_pixbuf_base, "gdk_pixbuf2"],
38
- [gobject_introspection_base, "gobject-introspection"]
39
- ].each do |target, module_name|
40
- if File.exist?(File.join(target, "Makefile")) and
41
- system("which make > /dev/null")
42
- `make -C #{target.dump} > /dev/null` or exit(false)
43
- end
44
- $LOAD_PATH.unshift(File.join(target, "ext", module_name))
45
- $LOAD_PATH.unshift(File.join(target, "lib"))
19
+ require_relative "../../glib2/test/run-test"
20
+
21
+ run_test(__dir__,
22
+ [
23
+ "glib2",
24
+ "gobject-introspection",
25
+ "atk",
26
+ "cairo-gobject",
27
+ "gdk_pixbuf2",
28
+ "gio2",
29
+ "pango",
30
+ "gdk3",
31
+ ]) do
32
+ require_relative "gdk-test-utils"
33
+
34
+ Gdk.init
35
+ Gdk.init_check([$0])
46
36
  end
47
-
48
- $LOAD_PATH.unshift(File.join(gdk3_base, "lib"))
49
-
50
- $LOAD_PATH.unshift(File.join(glib_base, "test"))
51
- require "glib-test-init"
52
-
53
- $LOAD_PATH.unshift(File.join(gdk3_base, "test"))
54
- require "gdk-test-utils"
55
-
56
- require "gdk3"
57
- Gdk.init
58
- Gdk.init_check([$0])
59
-
60
- exit Test::Unit::AutoRunner.run(true, File.join(gdk3_base, "test"))
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2019 Ruby-GNOME Project Team
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -26,11 +24,7 @@ class TestGdkColor < Test::Unit::TestCase
26
24
  message << "\"\#rrggbb\", "
27
25
  message << "\"\#rrggbb\", "
28
26
  message << "\"\#rrrgggbbb\", "
29
- message << "\"\#rrrrggggbbbb\", "
30
- message << "\"\#fff\", "
31
- message << "\"\#ffffff\", "
32
- message << "\"\#fffffffff\", "
33
- message << "\"\#fffffffffffff\""
27
+ message << "\"\#rrrrggggbbbb\""
34
28
  assert_raise(ArgumentError.new(message)) do
35
29
  Gdk::Color.parse(spec)
36
30
  end
@@ -42,6 +36,18 @@ class TestGdkColor < Test::Unit::TestCase
42
36
  end
43
37
  end
44
38
 
39
+ sub_test_case ".try_convert" do
40
+ test("String") do
41
+ assert_equal(Gdk::Color.parse("gray"),
42
+ Gdk::Color.try_convert("gray"))
43
+ end
44
+
45
+ test("Symbol") do
46
+ assert_equal(Gdk::Color.parse("gray"),
47
+ Gdk::Color.try_convert(:gray))
48
+ end
49
+ end
50
+
45
51
  def test_to_s
46
52
  color = Gdk::Color.new(0xffff, 0x1234, 0xabcd)
47
53
  assert_equal("#ffff1234abcd", color.to_s)
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013-2014 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2019 Ruby-GNOME Project Team
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -17,6 +15,18 @@
17
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
16
 
19
17
  class TestGdkRGBA < Test::Unit::TestCase
18
+ sub_test_case ".try_convert" do
19
+ test("String") do
20
+ assert_equal(Gdk::RGBA.parse("gray"),
21
+ Gdk::RGBA.try_convert("gray"))
22
+ end
23
+
24
+ test("Symbol") do
25
+ assert_equal(Gdk::RGBA.parse("gray"),
26
+ Gdk::RGBA.try_convert(:gray))
27
+ end
28
+ end
29
+
20
30
  def test_to_s
21
31
  rgba = Gdk::RGBA.new(0.2, 0.4, 0.6, 0.5)
22
32
  assert_equal("rgba(51,102,153,0.5)", rgba.to_s)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gdk3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.9
4
+ version: 3.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-10 00:00:00.000000000 Z
11
+ date: 2021-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pango
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.9
19
+ version: 3.4.4
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.9
26
+ version: 3.4.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gdk_pixbuf2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.3.9
33
+ version: 3.4.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.3.9
40
+ version: 3.4.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cairo-gobject
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.3.9
47
+ version: 3.4.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 3.3.9
54
+ version: 3.4.4
55
55
  description: Ruby/GDK3 is a Ruby binding of GDK-3.x.
56
56
  email: ruby-gnome2-devel-en@lists.sourceforge.net
57
57
  executables: []
@@ -116,8 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubyforge_project:
120
- rubygems_version: 2.7.6.2
119
+ rubygems_version: 3.3.0.dev
121
120
  signing_key:
122
121
  specification_version: 4
123
122
  summary: Ruby/GDK3 is a Ruby binding of GDK-3.x.