gdk3 3.4.0 → 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: e04b0cdee4599d4a9cab34733911026a96043395698e3973296b99f24745b93c
4
- data.tar.gz: eb7930a3b628e9804ad692d75de1d1f9f183c29e6b11ea0aaffb663a6cb44f5f
3
+ metadata.gz: ba535a498c1d9d80a0ce08b1a86d320fdfe4a9682db8742e7c63be03ef4c71c1
4
+ data.tar.gz: 520d8eebbb84057498995033024e88d2471952406ddc285af283c2efee8b78b3
5
5
  SHA512:
6
- metadata.gz: e60b8270befbf4eb78c31a20fe7197fc34cdcbbe9686b2d871bcfbaa95b5d179c98d10c86454b2534064f12f9f505deaea70e960287c622893c90f065a6e3b11
7
- data.tar.gz: 7b9ca50a4403d5d2d80e64d4673a8bdfcb38d505440499a5deaf48e0827191cfe14b17cd20eed9813b32ec66f6002abb8bb6203fc695fc67e66d18a6ebb53f65
6
+ metadata.gz: f44520cb0607564b2ce0d3b210812599b07e46bf4505762f3e1d4ca0fc72731d552b5c46ffcbd7f1b137104ae2706f4e49360ea4fda264ca41dea5e4183e1d43
7
+ data.tar.gz: dd98277694c2e23ecf232fba04b3eb559dcba598a7c35b5f6d6f45e74f979bf289ed4912e4cae996383699c9c16e530a4ca7f541bd491ca71becdc5c11e0cc52
@@ -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
@@ -36,6 +36,17 @@ module Gdk
36
36
  end
37
37
  color
38
38
  end
39
+
40
+ def try_convert(value)
41
+ case value
42
+ when String
43
+ parse(value)
44
+ when Symbol
45
+ parse(value.to_s)
46
+ else
47
+ nil
48
+ end
49
+ end
39
50
  end
40
51
 
41
52
  alias_method :initialize_raw, :initialize
@@ -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,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
@@ -42,6 +40,18 @@ class TestGdkColor < Test::Unit::TestCase
42
40
  end
43
41
  end
44
42
 
43
+ sub_test_case ".try_convert" do
44
+ test("String") do
45
+ assert_equal(Gdk::Color.parse("gray"),
46
+ Gdk::Color.try_convert("gray"))
47
+ end
48
+
49
+ test("Symbol") do
50
+ assert_equal(Gdk::Color.parse("gray"),
51
+ Gdk::Color.try_convert(:gray))
52
+ end
53
+ end
54
+
45
55
  def test_to_s
46
56
  color = Gdk::Color.new(0xffff, 0x1234, 0xabcd)
47
57
  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.4.0
4
+ version: 3.4.1
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: 2019-10-16 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.4.0
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.4.0
26
+ version: 3.4.1
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.4.0
33
+ version: 3.4.1
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.4.0
40
+ version: 3.4.1
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.4.0
47
+ version: 3.4.1
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.4.0
54
+ version: 3.4.1
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,7 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 3.1.0.pre1
119
+ rubyforge_project:
120
+ rubygems_version: 2.7.6.2
120
121
  signing_key:
121
122
  specification_version: 4
122
123
  summary: Ruby/GDK3 is a Ruby binding of GDK-3.x.