ox 1.4.6 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ox might be problematic. Click here for more details.
- data/README.md +8 -2
- data/ext/ox/dump.c +129 -33
- data/ext/ox/gen_load.c +13 -13
- data/ext/ox/obj_load.c +21 -18
- data/ext/ox/ox.c +155 -158
- data/ext/ox/ox.h +48 -50
- data/ext/ox/parse.c +1 -1
- data/ext/ox/sax.c +29 -29
- data/lib/ox/version.rb +1 -1
- data/test/files.rb +4 -9
- data/test/func.rb +33 -0
- data/test/perf.rb +91 -0
- data/test/perf_obj.rb +61 -138
- data/test/sample.rb +9 -16
- data/test/sample/change.rb +14 -0
- data/test/sample/dir.rb +19 -0
- data/test/sample/doc.rb +36 -0
- data/test/sample/file.rb +48 -0
- data/test/sample/group.rb +16 -0
- data/test/sample/hasprops.rb +16 -0
- data/test/sample/layer.rb +12 -0
- data/test/sample/line.rb +20 -0
- data/test/sample/oval.rb +10 -0
- data/test/sample/rect.rb +10 -0
- data/test/sample/shape.rb +35 -0
- data/test/sample/text.rb +20 -0
- metadata +16 -2
data/test/sample/line.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Sample
|
2
|
+
|
3
|
+
class Line
|
4
|
+
include HasProps
|
5
|
+
|
6
|
+
attr_accessor :x, :y, :dx, :dy
|
7
|
+
attr_accessor :color
|
8
|
+
attr_accessor :thick
|
9
|
+
|
10
|
+
def initialize(x, y, dx, dy, thick, color)
|
11
|
+
@x = x
|
12
|
+
@y = y
|
13
|
+
@dx = dx
|
14
|
+
@dy = dy
|
15
|
+
@thick = thick
|
16
|
+
@color = color
|
17
|
+
end
|
18
|
+
|
19
|
+
end # Line
|
20
|
+
end # Sample
|
data/test/sample/oval.rb
ADDED
data/test/sample/rect.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
module Sample
|
3
|
+
class Shape
|
4
|
+
include HasProps
|
5
|
+
|
6
|
+
attr_accessor :bounds
|
7
|
+
attr_accessor :color
|
8
|
+
attr_accessor :border, :border_color
|
9
|
+
|
10
|
+
def initialize(left, top, wide, high, color=nil)
|
11
|
+
@bounds = [[left, top], [left + wide, top + high]]
|
12
|
+
@color = color
|
13
|
+
@border = 1
|
14
|
+
@border_color = :black
|
15
|
+
end
|
16
|
+
|
17
|
+
def left
|
18
|
+
@bounds[0][0]
|
19
|
+
end
|
20
|
+
|
21
|
+
def top
|
22
|
+
@bounds[0][1]
|
23
|
+
end
|
24
|
+
|
25
|
+
def width
|
26
|
+
@bounds[1][0] - @bounds[0][0]
|
27
|
+
end
|
28
|
+
|
29
|
+
def height
|
30
|
+
@bounds[1][1] - @bounds[0][1]
|
31
|
+
end
|
32
|
+
|
33
|
+
end # Shape
|
34
|
+
end # Sample
|
35
|
+
|
data/test/sample/text.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
module Sample
|
3
|
+
class Text < Shape
|
4
|
+
attr_accessor :text
|
5
|
+
attr_accessor :font
|
6
|
+
attr_accessor :font_size
|
7
|
+
attr_accessor :just
|
8
|
+
attr_accessor :text_color
|
9
|
+
|
10
|
+
def initialize(text, left, top, wide, high, color=nil)
|
11
|
+
super(left, top, wide, high, color)
|
12
|
+
@text = text
|
13
|
+
@font = 'helvetica'
|
14
|
+
@font_size = 14
|
15
|
+
@just = 'left'
|
16
|
+
@text_color = 'black'
|
17
|
+
end
|
18
|
+
|
19
|
+
end # Text
|
20
|
+
end # Sample
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! "A fast XML parser and object serializer that uses only standard C
|
15
15
|
lib.\n \nOptimized XML (Ox), as the name implies was written to provide
|
@@ -75,12 +75,25 @@ files:
|
|
75
75
|
- test/ox/shape.rb
|
76
76
|
- test/ox/text.rb
|
77
77
|
- test/parse_cmp.rb
|
78
|
+
- test/perf.rb
|
78
79
|
- test/perf_gen.rb
|
79
80
|
- test/perf_mars.rb
|
80
81
|
- test/perf_obj.rb
|
81
82
|
- test/perf_pod.rb
|
82
83
|
- test/perf_sax.rb
|
83
84
|
- test/perf_write.rb
|
85
|
+
- test/sample/change.rb
|
86
|
+
- test/sample/dir.rb
|
87
|
+
- test/sample/doc.rb
|
88
|
+
- test/sample/file.rb
|
89
|
+
- test/sample/group.rb
|
90
|
+
- test/sample/hasprops.rb
|
91
|
+
- test/sample/layer.rb
|
92
|
+
- test/sample/line.rb
|
93
|
+
- test/sample/oval.rb
|
94
|
+
- test/sample/rect.rb
|
95
|
+
- test/sample/shape.rb
|
96
|
+
- test/sample/text.rb
|
84
97
|
- test/sample.rb
|
85
98
|
- test/sax_example.rb
|
86
99
|
- test/sax_test.rb
|
@@ -116,3 +129,4 @@ signing_key:
|
|
116
129
|
specification_version: 3
|
117
130
|
summary: A fast XML parser and object serializer.
|
118
131
|
test_files: []
|
132
|
+
has_rdoc: true
|