xmlss 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/xmlss/style/font.rb +5 -2
- data/lib/xmlss/version.rb +1 -1
- data/test/style/font_test.rb +4 -2
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/lib/xmlss/style/font.rb
CHANGED
@@ -5,7 +5,8 @@ module Xmlss::Style
|
|
5
5
|
{ :node => :font,
|
6
6
|
:attributes => [
|
7
7
|
:bold, :color, :italic, :size, :shadow,
|
8
|
-
:strike_through, :underline, :vertical_align
|
8
|
+
:strike_through, :underline, :vertical_align,
|
9
|
+
:font_name
|
9
10
|
] }
|
10
11
|
end
|
11
12
|
|
@@ -22,7 +23,8 @@ module Xmlss::Style
|
|
22
23
|
}
|
23
24
|
alias_method :vertical_align, :alignment
|
24
25
|
|
25
|
-
attr_accessor :bold, :color, :italic, :size, :strike_through, :shadow
|
26
|
+
attr_accessor :bold, :color, :italic, :size, :strike_through, :shadow, :name
|
27
|
+
alias :font_name :name
|
26
28
|
|
27
29
|
def initialize(attrs={})
|
28
30
|
self.bold = attrs[:bold] || false
|
@@ -33,6 +35,7 @@ module Xmlss::Style
|
|
33
35
|
self.shadow = attrs[:shadow] || false
|
34
36
|
self.underline = attrs[:underline]
|
35
37
|
self.alignment = attrs[:alignment]
|
38
|
+
self.name = attrs[:name]
|
36
39
|
end
|
37
40
|
|
38
41
|
def bold?; !!self.bold; end
|
data/lib/xmlss/version.rb
CHANGED
data/test/style/font_test.rb
CHANGED
@@ -32,7 +32,7 @@ module Xmlss::Style
|
|
32
32
|
end
|
33
33
|
|
34
34
|
should have_accessors :bold, :color, :italic, :size, :strike_through, :shadow
|
35
|
-
should have_accessors :underline, :alignment
|
35
|
+
should have_accessors :underline, :alignment, :name
|
36
36
|
should have_instance_methods :bold?, :italic?, :strike_through?, :shadow?
|
37
37
|
should have_reader :vertical_align
|
38
38
|
|
@@ -45,6 +45,7 @@ module Xmlss::Style
|
|
45
45
|
assert_equal false, subject.shadow
|
46
46
|
assert_equal nil, subject.underline
|
47
47
|
assert_equal nil, subject.alignment
|
48
|
+
assert_equal nil, subject.name
|
48
49
|
end
|
49
50
|
|
50
51
|
should "set attrs at init" do
|
@@ -55,7 +56,8 @@ module Xmlss::Style
|
|
55
56
|
:size => 10,
|
56
57
|
:strike_through => true,
|
57
58
|
:underline => :single,
|
58
|
-
:alignment => :superscript
|
59
|
+
:alignment => :superscript,
|
60
|
+
:name => 'Verdana'
|
59
61
|
}
|
60
62
|
font = Font.new(attrs)
|
61
63
|
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
type: :development
|