rsvg2 3.4.0 → 3.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/sample/svg-viewer.rb +5 -8
- data/test/rsvg2-test-utils.rb +3 -3
- data/test/run-test.rb +12 -35
- data/test/test-handle.rb +14 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fee3b5ccf36bc57b114816d4f15b43c64703910172b2defb83c1d42439364332
|
4
|
+
data.tar.gz: 3a5292123171cbd31b0c218a02cb1297b674256fc2ee8c0dcddd155f528af943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80345cccbdf00be846d931e6d1f2833e5775162173a779da034f8630ed427023497f0262a664fe8186728416622634ec08c5aead4c7d2b223905308420c88e73
|
7
|
+
data.tar.gz: 63dc490d0b5149629c1ca0b2bb57eefd06457c2e06ae50bc7df53568182c37bd0bc0d5d1566a211965bdd2d19b98ebbb1b5c034e3a2f98a49e03381aa7022177
|
data/sample/svg-viewer.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'gtk3'
|
4
4
|
require 'rsvg2'
|
5
5
|
|
6
6
|
if ARGV.size != 1
|
@@ -15,15 +15,12 @@ width, height = handle.dimensions.to_a
|
|
15
15
|
|
16
16
|
window = Gtk::Window.new
|
17
17
|
window.set_default_size(width, height)
|
18
|
-
|
19
|
-
|
20
|
-
window.signal_connect(:destroy) do
|
21
|
-
Gtk.main_quit
|
22
|
-
end
|
18
|
+
window.signal_connect(:destroy) { Gtk.main_quit }
|
23
19
|
|
24
|
-
area
|
20
|
+
area = Gtk::DrawingArea.new
|
21
|
+
area.signal_connect(:draw) do |widget, _event|
|
25
22
|
context = widget.window.create_cairo_context
|
26
|
-
window_width, window_height = widget.window.
|
23
|
+
window_width, window_height = widget.window.width, widget.window.height
|
27
24
|
context.scale(window_width.to_f / width, window_height.to_f / height)
|
28
25
|
context.render_rsvg_handle(handle)
|
29
26
|
end
|
data/test/rsvg2-test-utils.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014 Ruby-
|
1
|
+
# Copyright (C) 2014-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
|
@@ -14,10 +14,10 @@
|
|
14
14
|
# License along with this library; if not, write to the Free Software
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
|
-
require "test-unit"
|
18
|
-
|
19
17
|
require "fileutils"
|
20
18
|
|
19
|
+
require "rsvg2"
|
20
|
+
|
21
21
|
module Rsvg2TestUtils
|
22
22
|
def only_rsvg_version(major, minor, micro=nil)
|
23
23
|
micro ||= 0
|
data/test/run-test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014-
|
3
|
+
# Copyright (C) 2014-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,38 +16,15 @@
|
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
modules = [
|
31
|
-
[glib_base, "glib2"],
|
32
|
-
[gio2_base, "gio2"],
|
33
|
-
[gdk_pixbuf2_base, "gdk_pixbuf2"],
|
34
|
-
[gobject_introspection_base, "gobject-introspection"],
|
35
|
-
[rsvg2_base, "rsvg2"],
|
36
|
-
]
|
37
|
-
modules.each do |target, module_name|
|
38
|
-
if File.exist?(File.join(target, "Makefile")) and have_make
|
39
|
-
`make -C #{target.dump} > /dev/null` or exit(false)
|
40
|
-
end
|
41
|
-
$LOAD_PATH.unshift(File.join(target, "ext", module_name))
|
42
|
-
$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
|
+
"gio2",
|
26
|
+
"gdk_pixbuf2",
|
27
|
+
"rsvg2",
|
28
|
+
]) do
|
29
|
+
require_relative "rsvg2-test-utils"
|
43
30
|
end
|
44
|
-
|
45
|
-
$LOAD_PATH.unshift(File.join(glib_base, "test"))
|
46
|
-
require "glib-test-init"
|
47
|
-
|
48
|
-
$LOAD_PATH.unshift(File.join(rsvg2_base, "test"))
|
49
|
-
require "rsvg2-test-utils"
|
50
|
-
|
51
|
-
require "rsvg2"
|
52
|
-
|
53
|
-
exit Test::Unit::AutoRunner.run(true, File.join(rsvg2_base, "test"))
|
data/test/test-handle.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014 Ruby-
|
1
|
+
# Copyright (C) 2014-2020 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
|
@@ -85,4 +85,17 @@ class TestHandle < Test::Unit::TestCase
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
88
|
+
|
89
|
+
test "#stylesheet=" do
|
90
|
+
only_rsvg_version(2, 48)
|
91
|
+
svg = <<-SVG
|
92
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
93
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
|
94
|
+
<rect id="rectangle" x="0" y="10" width="100" height="100"/>
|
95
|
+
</svg>
|
96
|
+
SVG
|
97
|
+
handle = Rsvg::Handle.new(data: svg)
|
98
|
+
handle.stylesheet = "rect {fill: red;}"
|
99
|
+
# TODO: Assert rendered color
|
100
|
+
end
|
88
101
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsvg2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.5
|
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:
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gdk_pixbuf2
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.4.
|
19
|
+
version: 3.4.5
|
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.
|
26
|
+
version: 3.4.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: cairo-gobject
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.4.
|
33
|
+
version: 3.4.5
|
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.
|
40
|
+
version: 3.4.5
|
41
41
|
description: Ruby/RSVG2 is a Ruby binding of librsvg-2.x.
|
42
42
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
43
43
|
executables: []
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.3.0.dev
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Ruby/RSVG2 is a Ruby binding of librsvg-2.x.
|