rodf 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.3.4. Procedural cell styling
1
2
  v0.3.3. Documents can now write themselves to disk
2
3
  v0.3.2. Fixes broken styles.xml
3
4
  v0.3.1. Adds support for conditional formatting
@@ -47,6 +47,10 @@ module ODF
47
47
  make_value_paragraph
48
48
  end
49
49
 
50
+ def style=(style_name)
51
+ @elem_attrs['table:style-name'] = style_name
52
+ end
53
+
50
54
  def xml
51
55
  markup = Builder::XmlMarkup.new
52
56
  text = markup.tag! 'table:table-cell', @elem_attrs do |xml|
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rodf"
5
- s.version = "0.3.3"
5
+ s.version = "0.3.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Thiago Arrais, Foivos Zakkak"]
9
- s.date = "2013-02-01"
9
+ s.date = "2013-02-05"
10
10
  s.description = "ODF generation library for Ruby"
11
11
  s.email = "thiago.arrais@gmail.com"
12
12
  s.extra_rdoc_files = ["CHANGELOG", "LICENSE.LGPL", "README.rdoc", "lib/odf/cell.rb", "lib/odf/column.rb", "lib/odf/compatibility.rb", "lib/odf/container.rb", "lib/odf/data_style.rb", "lib/odf/document.rb", "lib/odf/hyperlink.rb", "lib/odf/master_page.rb", "lib/odf/page_layout.rb", "lib/odf/paragraph.rb", "lib/odf/paragraph_container.rb", "lib/odf/property.rb", "lib/odf/row.rb", "lib/odf/skeleton.rb", "lib/odf/skeleton/manifest.xml.erb", "lib/odf/skeleton/styles.pxml", "lib/odf/span.rb", "lib/odf/spreadsheet.rb", "lib/odf/style.rb", "lib/odf/style_section.rb", "lib/odf/tab.rb", "lib/odf/table.rb", "lib/odf/text.rb"]
@@ -85,12 +85,19 @@ describe ODF::Cell do
85
85
  end
86
86
  end
87
87
 
88
- it "should allow an style to be specified" do
88
+ it "should allow an style to be specified in the constructor" do
89
89
  cell = ODF::Cell.new 45.8, :type => :float, :style => 'left-column-cell'
90
90
  Hpricot(cell.xml).at('table:table-cell')['table:style-name'].
91
91
  should == 'left-column-cell'
92
92
  end
93
93
 
94
+ it "should allow and style to be specified through a method call" do
95
+ cell = ODF::Cell.new 45.8, :type => :float
96
+ cell.style = 'left-column-cell'
97
+ Hpricot(cell.xml).at('table:table-cell')['table:style-name'].
98
+ should == 'left-column-cell'
99
+ end
100
+
94
101
  it "should span multiple cells when asked to" do
95
102
  cell = ODF::Cell.new 'Spreadsheet title', :span => 4
96
103
  doc = Hpricot(cell.xml)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
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: 2013-02-01 00:00:00.000000000 Z
12
+ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder