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.

@@ -0,0 +1,12 @@
1
+
2
+ module Sample
3
+ class Layer < Group
4
+ attr_accessor :name
5
+
6
+ def initialize(name)
7
+ super()
8
+ @name = name
9
+ end
10
+
11
+ end # Layer
12
+ end # Sample
@@ -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
@@ -0,0 +1,10 @@
1
+ module Sample
2
+
3
+ class Oval < Shape
4
+
5
+ def initialize(left, top, wide, high, color=nil)
6
+ super
7
+ end
8
+
9
+ end # Oval
10
+ end # Sample
@@ -0,0 +1,10 @@
1
+
2
+ module Sample
3
+ class Rect < Shape
4
+
5
+ def initialize(left, top, wide, high, color=nil)
6
+ super
7
+ end
8
+
9
+ end # Rect
10
+ end # Sample
@@ -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
+
@@ -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.6
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-02-09 00:00:00.000000000 Z
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