cairo 1.12.1 → 1.12.2

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/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,80 +1,102 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cairo
3
- version: !ruby/object:Gem::Version
4
- version: 1.12.1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 35
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 12
9
+ - 2
10
+ version: 1.12.2
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Kouhei Sutou
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-03-31 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: pkg-config
16
- requirement: &12214820 !ruby/object:Gem::Requirement
17
+
18
+ date: 2012-06-03 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
17
22
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ hash: 3
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ name: pkg-config
23
31
  prerelease: false
24
- version_requirements: *12214820
25
- - !ruby/object:Gem::Dependency
26
- name: bundler
27
- requirement: &12214300 !ruby/object:Gem::Requirement
32
+ type: :runtime
33
+ requirement: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
28
36
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- type: :development
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ hash: 3
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ name: bundler
34
45
  prerelease: false
35
- version_requirements: *12214300
36
- - !ruby/object:Gem::Dependency
37
- name: test-unit-notify
38
- requirement: &12213780 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
46
  type: :development
45
- prerelease: false
46
- version_requirements: *12213780
47
- - !ruby/object:Gem::Dependency
48
- name: rake-compiler
49
- requirement: &12213240 !ruby/object:Gem::Requirement
47
+ requirement: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ version_requirements: &id003 !ruby/object:Gem::Requirement
50
50
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :development
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ name: test-unit-notify
56
59
  prerelease: false
57
- version_requirements: *12213240
58
- - !ruby/object:Gem::Dependency
59
- name: packnga
60
- requirement: &12212780 !ruby/object:Gem::Requirement
60
+ type: :development
61
+ requirement: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ version_requirements: &id004 !ruby/object:Gem::Requirement
61
64
  none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
- version: '0'
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ hash: 3
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ name: rake-compiler
73
+ prerelease: false
66
74
  type: :development
75
+ requirement: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ version_requirements: &id005 !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ hash: 3
83
+ segments:
84
+ - 0
85
+ version: "0"
86
+ name: packnga
67
87
  prerelease: false
68
- version_requirements: *12212780
88
+ type: :development
89
+ requirement: *id005
69
90
  description: Ruby bindings for cairo
70
- email:
91
+ email:
71
92
  - kou@cozmixng.org
72
93
  executables: []
73
- extensions:
94
+
95
+ extensions:
74
96
  - ext/cairo/extconf.rb
75
- extra_rdoc_files:
97
+ extra_rdoc_files:
76
98
  - README.rdoc
77
- files:
99
+ files:
78
100
  - AUTHORS
79
101
  - COPYING
80
102
  - GPL
@@ -84,9 +106,11 @@ files:
84
106
  - ext/cairo/extconf.rb
85
107
  - Rakefile
86
108
  - lib/cairo/color.rb
109
+ - lib/cairo/pattern.rb
87
110
  - lib/cairo/papers.rb
88
111
  - lib/cairo/point.rb
89
112
  - lib/cairo/context.rb
113
+ - lib/cairo/device.rb
90
114
  - lib/cairo/colors.rb
91
115
  - lib/cairo/context/circle.rb
92
116
  - lib/cairo/context/rectangle.rb
@@ -95,6 +119,7 @@ files:
95
119
  - lib/cairo/context/triangle.rb
96
120
  - lib/cairo/context/path.rb
97
121
  - lib/cairo/path.rb
122
+ - lib/cairo/surface.rb
98
123
  - lib/cairo/constants.rb
99
124
  - lib/cairo/paper.rb
100
125
  - lib/cairo.rb
@@ -155,31 +180,39 @@ files:
155
180
  - test/test_font_options.rb
156
181
  - test/test_constants.rb
157
182
  homepage: http://cairographics.org/rcairo
158
- licenses:
183
+ licenses:
159
184
  - Ruby's
160
185
  post_install_message:
161
186
  rdoc_options: []
162
- require_paths:
187
+
188
+ require_paths:
163
189
  - lib
164
- required_ruby_version: !ruby/object:Gem::Requirement
190
+ required_ruby_version: !ruby/object:Gem::Requirement
165
191
  none: false
166
- requirements:
167
- - - ! '>='
168
- - !ruby/object:Gem::Version
169
- version: '0'
170
- required_rubygems_version: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ hash: 3
196
+ segments:
197
+ - 0
198
+ version: "0"
199
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
200
  none: false
172
- requirements:
173
- - - ! '>='
174
- - !ruby/object:Gem::Version
175
- version: '0'
201
+ requirements:
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ hash: 3
205
+ segments:
206
+ - 0
207
+ version: "0"
176
208
  requirements: []
209
+
177
210
  rubyforge_project: cairo
178
- rubygems_version: 1.8.11
211
+ rubygems_version: 1.8.15
179
212
  signing_key:
180
213
  specification_version: 3
181
214
  summary: Ruby bindings for cairo
182
- test_files:
215
+ test_files:
183
216
  - test/test_surface.rb
184
217
  - test/test_scaled_font.rb
185
218
  - test/test_recording_surface.rb