cairo 1.12.1-x86-mingw32 → 1.12.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cairo might be problematic. Click here for more details.

data/lib/1.8/cairo.so CHANGED
Binary file
data/lib/1.9/cairo.so CHANGED
Binary file
data/lib/cairo.rb CHANGED
@@ -142,6 +142,9 @@ require 'cairo/point'
142
142
  require 'cairo/colors'
143
143
  require 'cairo/papers'
144
144
  require 'cairo/context'
145
+ require 'cairo/device'
146
+ require 'cairo/surface'
147
+ require 'cairo/pattern'
145
148
  require 'cairo/path'
146
149
 
147
150
  module Cairo
@@ -0,0 +1,13 @@
1
+ module Cairo
2
+ if const_defined?(:Device)
3
+ class Device
4
+ class << self
5
+ def supported?(type)
6
+ supported_predicate = "#{type.to_s.downcase}_supported?"
7
+ return false unless respond_to?(supported_predicate)
8
+ send(supported_predicate)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ module Cairo
2
+ class Pattern
3
+ class << self
4
+ def supported?(type)
5
+ type = type.to_s.gsub(/([a-z])([A-Z])/, '\\1_\\2').downcase
6
+ supported_predicate = "#{type}_supported?"
7
+ return false unless respond_to?(supported_predicate)
8
+ send(supported_predicate)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Cairo
2
+ class Surface
3
+ class << self
4
+ def supported?(type)
5
+ supported_predicate = "#{type.to_s.downcase}_supported?"
6
+ return false unless respond_to?(supported_predicate)
7
+ send(supported_predicate)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -18,16 +18,22 @@ module CairoTestUtils
18
18
  end
19
19
 
20
20
  def only_device(name)
21
- device_class = "#{name}Device"
22
- unless Cairo.const_defined?(device_class)
23
- omit("Only for #{device_class} device available")
21
+ only_cairo_version(1, 10)
22
+
23
+ unless Cairo::Device.supported?(name)
24
+ omit("Only for #{name} device available")
24
25
  end
25
26
  end
26
27
 
27
28
  def only_surface(name)
28
- surface_class = "#{name}Surface"
29
- unless Cairo.const_defined?(surface_class)
30
- omit("Only for #{surface_class} surface available")
29
+ unless Cairo::Surface.supported?(name)
30
+ omit("Only for #{name} device available")
31
+ end
32
+ end
33
+
34
+ def only_pattern(name)
35
+ unless Cairo::Pattern.supported?(name)
36
+ omit("Only for #{name} device available")
31
37
  end
32
38
  end
33
39
  end
data/test/run-test.rb CHANGED
@@ -13,7 +13,7 @@ end
13
13
 
14
14
  require 'rubygems'
15
15
  require 'bundler/setup'
16
- require 'test/unit'
16
+ require 'test-unit'
17
17
 
18
18
  $LOAD_PATH.unshift(base_dir)
19
19
  $LOAD_PATH.unshift(ext_dir)
@@ -1,9 +1,13 @@
1
1
  require "cairo"
2
2
  require "tempfile"
3
3
 
4
- class RasterPatternSourceTest < Test::Unit::TestCase
4
+ class RasterSourcePatternTest < Test::Unit::TestCase
5
5
  include CairoTestUtils
6
6
 
7
+ def setup
8
+ only_pattern("RasterSource")
9
+ end
10
+
7
11
  def test_acquire_and_release
8
12
  Cairo::ImageSurface.new(100, 100) do |surface|
9
13
  Cairo::Context.new(surface) do |context|
@@ -36,6 +40,11 @@ class RasterPatternSourceTest < Test::Unit::TestCase
36
40
  end
37
41
 
38
42
  class SnapshotTest < self
43
+ def setup
44
+ super
45
+ only_surface("Recording")
46
+ end
47
+
39
48
  def test_success
40
49
  Cairo::RecordingSurface.new(0, 0, 100, 100) do |surface|
41
50
  Cairo::Context.new(surface) do |context|
@@ -75,6 +84,11 @@ class RasterPatternSourceTest < Test::Unit::TestCase
75
84
  end
76
85
 
77
86
  class CopyTest < self
87
+ def setup
88
+ super
89
+ only_surface("Script")
90
+ end
91
+
78
92
  def test_success
79
93
  output = StringIO.new
80
94
  device = Cairo::ScriptDevice.new(output)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cairo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 37
4
+ hash: 35
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 12
9
- - 1
10
- version: 1.12.1
9
+ - 2
10
+ version: 1.12.2
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - Kouhei Sutou
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-31 00:00:00 Z
18
+ date: 2012-06-03 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -106,9 +106,11 @@ files:
106
106
  - ext/cairo/extconf.rb
107
107
  - Rakefile
108
108
  - lib/cairo/color.rb
109
+ - lib/cairo/pattern.rb
109
110
  - lib/cairo/papers.rb
110
111
  - lib/cairo/point.rb
111
112
  - lib/cairo/context.rb
113
+ - lib/cairo/device.rb
112
114
  - lib/cairo/colors.rb
113
115
  - lib/cairo/context/circle.rb
114
116
  - lib/cairo/context/rectangle.rb
@@ -117,6 +119,7 @@ files:
117
119
  - lib/cairo/context/triangle.rb
118
120
  - lib/cairo/context/path.rb
119
121
  - lib/cairo/path.rb
122
+ - lib/cairo/surface.rb
120
123
  - lib/cairo/constants.rb
121
124
  - lib/cairo/paper.rb
122
125
  - lib/cairo.rb