osheet-xmlss 1.0.0.rc.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -2
- data/Gemfile +4 -5
- data/{LICENSE → LICENSE.txt} +0 -0
- data/README.md +16 -16
- data/Rakefile +1 -8
- data/lib/osheet/xmlss.rb +1 -1
- data/lib/osheet/xmlss/version.rb +1 -1
- data/lib/osheet/xmlss_writer.rb +0 -1
- data/osheet-xmlss.gemspec +12 -10
- data/test/helper.rb +8 -3
- data/test/{xmlss/api_test.rb → unit/xmlss/api_tests.rb} +0 -1
- data/test/{xmlss/style_cache_test.rb → unit/xmlss/style_cache_tests.rb} +4 -7
- data/test/{xmlss/style_settings_test.rb → unit/xmlss/style_settings_tests.rb} +11 -24
- data/test/{xmlss/styles_test.rb → unit/xmlss/styles_tests.rb} +0 -1
- data/test/{xmlss_writer_test.rb → unit/xmlss_writer_tests.rb} +5 -5
- metadata +38 -55
- data/examples/basic.xls +0 -2
- data/examples/basic_with_templates.xls +0 -93
- data/examples/formats.xls +0 -768
- data/examples/formula.xls +0 -36
- data/examples/styles.xls +0 -343
- data/examples/trivial.xls +0 -18
- data/test/irb.rb +0 -9
data/.gitignore
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
*.gem
|
2
2
|
*.log
|
3
3
|
*.rbc
|
4
|
+
.rbx/
|
4
5
|
.bundle
|
5
6
|
.config
|
6
7
|
.yardoc
|
7
|
-
.rvmrc
|
8
|
-
.rbenv-version
|
9
8
|
Gemfile.lock
|
10
9
|
InstalledFiles
|
11
10
|
_yardoc
|
@@ -18,4 +17,6 @@ spec/reports
|
|
18
17
|
test/tmp
|
19
18
|
test/version_tmp
|
20
19
|
tmp
|
20
|
+
|
21
21
|
bench/*_100*.xls
|
22
|
+
examples/*.xls
|
data/Gemfile
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
source "
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in osheet-xmlss.gemspec
|
4
3
|
gemspec
|
5
4
|
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
gem "whysoslow"
|
5
|
+
gem 'rake'
|
6
|
+
gem 'pry'
|
7
|
+
gem "whysoslow"
|
9
8
|
gem "ruby-prof"
|
data/{LICENSE → LICENSE.txt}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -2,22 +2,6 @@
|
|
2
2
|
|
3
3
|
A writer for Osheet (https://github.com/kellyredding/osheet). Use this with Osheet to write workbooks in the Xmlss format (https://github.com/kellyredding/xmlss.)
|
4
4
|
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'osheet-xmlss'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install osheet-xmlss
|
18
|
-
|
19
|
-
Osheet::Xmlss will install Osheet and Xmlss for you and you are all set.
|
20
|
-
|
21
5
|
## Usage
|
22
6
|
|
23
7
|
```ruby
|
@@ -122,6 +106,22 @@ I've add a few examples to ./examples. Please refer first to the API then to th
|
|
122
106
|
* *Xmlss Source*
|
123
107
|
- http://github.com/kellyredding/xmlss
|
124
108
|
|
109
|
+
## Installation
|
110
|
+
|
111
|
+
Add this line to your application's Gemfile:
|
112
|
+
|
113
|
+
gem 'osheet-xmlss'
|
114
|
+
|
115
|
+
And then execute:
|
116
|
+
|
117
|
+
$ bundle
|
118
|
+
|
119
|
+
Or install it yourself as:
|
120
|
+
|
121
|
+
$ gem install osheet-xmlss
|
122
|
+
|
123
|
+
Osheet::Xmlss will install Osheet and Xmlss for you and you are all set.
|
124
|
+
|
125
125
|
## Contributing
|
126
126
|
|
127
127
|
1. Fork it
|
data/Rakefile
CHANGED
data/lib/osheet/xmlss.rb
CHANGED
data/lib/osheet/xmlss/version.rb
CHANGED
data/lib/osheet/xmlss_writer.rb
CHANGED
data/osheet-xmlss.gemspec
CHANGED
@@ -1,24 +1,26 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'osheet/xmlss/version'
|
3
5
|
|
4
6
|
Gem::Specification.new do |gem|
|
5
7
|
gem.name = "osheet-xmlss"
|
6
8
|
gem.version = Osheet::Xmlss::VERSION
|
7
|
-
gem.description = %q{An Osheet writer (https://github.com/kellyredding/osheet) for the XMLSS format (https://github.com/kellyredding/xmlss)}
|
8
|
-
gem.summary = %q{An Osheet writer (https://github.com/kellyredding/osheet) for the XMLSS format (https://github.com/kellyredding/xmlss)}
|
9
|
-
|
10
9
|
gem.authors = ["Kelly Redding"]
|
11
10
|
gem.email = ["kelly@kellyredding.com"]
|
11
|
+
gem.description = %q{An Osheet writer (https://github.com/kellyredding/osheet) for the XMLSS format (https://github.com/kellyredding/xmlss)}
|
12
|
+
gem.summary = %q{An Osheet writer (https://github.com/kellyredding/osheet) for the XMLSS format (https://github.com/kellyredding/xmlss)}
|
12
13
|
gem.homepage = "http://github.com/kellyredding/osheet-xmlss"
|
14
|
+
gem.license = 'MIT'
|
13
15
|
|
14
|
-
gem.files = `git ls-files`.split(
|
15
|
-
gem.
|
16
|
-
gem.
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
19
|
gem.require_paths = ["lib"]
|
18
20
|
|
19
|
-
gem.add_development_dependency("assert")
|
21
|
+
gem.add_development_dependency("assert", ["~> 2.0"])
|
20
22
|
|
21
|
-
gem.add_dependency("osheet", ["~> 1.0
|
22
|
-
gem.add_dependency("xmlss", ["~> 1.0
|
23
|
+
gem.add_dependency("osheet", ["~> 1.0"])
|
24
|
+
gem.add_dependency("xmlss", ["~> 1.0"])
|
23
25
|
|
24
26
|
end
|
data/test/helper.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
-
# this file is automatically required
|
2
|
-
# put test helpers here
|
1
|
+
# this file is automatically required when you run `assert`
|
2
|
+
# put any test helpers here
|
3
3
|
|
4
|
-
# add root dir to the load path
|
4
|
+
# add the root dir to the load path
|
5
5
|
$LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
|
6
6
|
|
7
|
+
# require pry for debugging (`binding.pry`)
|
8
|
+
require 'pry'
|
9
|
+
|
10
|
+
require 'xmlss/workbook'
|
11
|
+
|
7
12
|
class Assert::Context
|
8
13
|
|
9
14
|
def xmlss_style_markup(writer)
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require "assert"
|
2
|
-
|
3
2
|
require 'osheet/xmlss/style_cache'
|
4
3
|
|
5
|
-
|
4
|
+
class Osheet::Xmlss::StyleCache
|
6
5
|
|
7
|
-
class
|
6
|
+
class UnitTests < Assert::Context
|
8
7
|
desc "the style cache"
|
9
8
|
before do
|
10
9
|
@workbook = Osheet::Workbook.new
|
@@ -16,9 +15,9 @@ module Osheet::Xmlss
|
|
16
15
|
@workbook.style('.border.color') { @workbook.border '#FF0000', :thin }
|
17
16
|
@xmlss_workbook = ::Xmlss::Workbook.new(Xmlss::Writer.new)
|
18
17
|
|
19
|
-
@cache = StyleCache.new(@workbook, @xmlss_workbook)
|
18
|
+
@cache = Osheet::Xmlss::StyleCache.new(@workbook, @xmlss_workbook)
|
20
19
|
end
|
21
|
-
subject
|
20
|
+
subject{ @cache }
|
22
21
|
|
23
22
|
should have_reader :styles
|
24
23
|
should have_instance_method :get, :keys, :empty?, :size, :[]
|
@@ -60,6 +59,4 @@ module Osheet::Xmlss
|
|
60
59
|
|
61
60
|
end
|
62
61
|
|
63
|
-
|
64
|
-
|
65
62
|
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
require "assert"
|
2
|
-
|
3
2
|
require 'osheet/xmlss/style_settings'
|
4
3
|
|
5
|
-
|
4
|
+
class Osheet::Xmlss::StyleSettings
|
6
5
|
|
7
|
-
class
|
6
|
+
class UnitTests < Assert::Context
|
8
7
|
desc "the style writer when building"
|
9
8
|
before do
|
10
|
-
@settings = StyleSettings.new([])
|
9
|
+
@settings = Osheet::Xmlss::StyleSettings.new([])
|
11
10
|
@workbook = Osheet::Workbook.new
|
12
11
|
@workbook.style('.align.center') { @workbook.align :center }
|
13
12
|
@workbook.style('.font.size') { @workbook.font 14 }
|
@@ -26,7 +25,7 @@ module Osheet::Xmlss
|
|
26
25
|
end
|
27
26
|
|
28
27
|
should "conditionally run a block if the setting exists and is not empty" do
|
29
|
-
settings = StyleSettings.new([@workbook.styles.first])
|
28
|
+
settings = Osheet::Xmlss::StyleSettings.new([@workbook.styles.first])
|
30
29
|
@something = ''
|
31
30
|
|
32
31
|
settings.setting(:font) { @something = 'i should be empty' }
|
@@ -38,9 +37,7 @@ module Osheet::Xmlss
|
|
38
37
|
|
39
38
|
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
class AlignmentSettingsTests < StyleSettingsTests
|
40
|
+
class AlignmentSettingsTests < UnitTests
|
44
41
|
desc "align settings"
|
45
42
|
|
46
43
|
should "translate horizontal directives" do
|
@@ -62,9 +59,7 @@ module Osheet::Xmlss
|
|
62
59
|
|
63
60
|
end
|
64
61
|
|
65
|
-
|
66
|
-
|
67
|
-
class FontSettingsTests < StyleSettingsTests
|
62
|
+
class FontSettingsTests < UnitTests
|
68
63
|
desc "font settings"
|
69
64
|
|
70
65
|
should "translate size, color and name directives" do
|
@@ -91,10 +86,7 @@ module Osheet::Xmlss
|
|
91
86
|
|
92
87
|
end
|
93
88
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
class BgSettingsTests < StyleSettingsTests
|
89
|
+
class BgSettingsTests < UnitTests
|
98
90
|
desc "bg settings"
|
99
91
|
|
100
92
|
should "translate color directives" do
|
@@ -111,11 +103,7 @@ module Osheet::Xmlss
|
|
111
103
|
|
112
104
|
end
|
113
105
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
class BorderSettingsTests < StyleSettingsTests
|
106
|
+
class BorderSettingsTests < UnitTests
|
119
107
|
desc "border settings"
|
120
108
|
|
121
109
|
should "translate color directives" do
|
@@ -144,9 +132,7 @@ module Osheet::Xmlss
|
|
144
132
|
|
145
133
|
end
|
146
134
|
|
147
|
-
|
148
|
-
|
149
|
-
class ParseSettingsTests < StyleSettingsTests
|
135
|
+
class ParseSettingsTests < UnitTests
|
150
136
|
desc "settings"
|
151
137
|
|
152
138
|
should "parse Osheet style objs for their settings" do
|
@@ -255,8 +241,9 @@ module Osheet::Xmlss
|
|
255
241
|
:color => "#FF0000",
|
256
242
|
:weight => :thin
|
257
243
|
}
|
258
|
-
}, StyleSettings.new(@workbook.styles).value)
|
244
|
+
}, Osheet::Xmlss::StyleSettings.new(@workbook.styles).value)
|
259
245
|
end
|
246
|
+
|
260
247
|
end
|
261
248
|
|
262
249
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require "assert"
|
2
|
-
|
3
2
|
require 'osheet/xmlss_writer'
|
4
3
|
|
5
|
-
|
4
|
+
class Osheet::Xmlss::Writer
|
6
5
|
|
7
|
-
class
|
6
|
+
class UnitTests < Assert::Context
|
8
7
|
desc "the xmlss writer"
|
9
8
|
before do
|
10
9
|
@writer = Osheet::XmlssWriter.new
|
@@ -25,7 +24,7 @@ module Osheet::Xmlss
|
|
25
24
|
|
26
25
|
end
|
27
26
|
|
28
|
-
class WorkbookTests <
|
27
|
+
class WorkbookTests < UnitTests
|
29
28
|
before do
|
30
29
|
@workbook.worksheet("testsheet1")
|
31
30
|
end
|
@@ -34,6 +33,7 @@ module Osheet::Xmlss
|
|
34
33
|
assert_raises ArgumentError do
|
35
34
|
subject.worksheet(Osheet::Worksheet.new("testsheet1"))
|
36
35
|
end
|
36
|
+
|
37
37
|
assert_nothing_raised do
|
38
38
|
subject.worksheet(Osheet::Worksheet.new("testsheet2"))
|
39
39
|
subject.worksheet(Osheet::Worksheet.new) {
|
@@ -47,7 +47,7 @@ module Osheet::Xmlss
|
|
47
47
|
|
48
48
|
end
|
49
49
|
|
50
|
-
class ToFileTests <
|
50
|
+
class ToFileTests < UnitTests
|
51
51
|
desc "used with a workbook"
|
52
52
|
before do
|
53
53
|
Osheet::Workbook.new(@writer) {
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: osheet-xmlss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
|
11
|
-
- 3
|
12
|
-
version: 1.0.0.rc.3
|
10
|
+
version: 1.0.0
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Kelly Redding
|
@@ -17,58 +15,53 @@ autorequire:
|
|
17
15
|
bindir: bin
|
18
16
|
cert_chain: []
|
19
17
|
|
20
|
-
date:
|
18
|
+
date: 2013-07-21 00:00:00 Z
|
21
19
|
dependencies:
|
22
20
|
- !ruby/object:Gem::Dependency
|
23
|
-
|
21
|
+
name: assert
|
22
|
+
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
25
|
requirements:
|
27
|
-
- -
|
26
|
+
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
28
|
hash: 3
|
30
29
|
segments:
|
30
|
+
- 2
|
31
31
|
- 0
|
32
|
-
version: "0"
|
33
|
-
|
32
|
+
version: "2.0"
|
33
|
+
type: :development
|
34
34
|
version_requirements: *id001
|
35
|
-
prerelease: false
|
36
35
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
36
|
+
name: osheet
|
37
|
+
prerelease: false
|
38
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
hash:
|
43
|
+
hash: 15
|
44
44
|
segments:
|
45
45
|
- 1
|
46
46
|
- 0
|
47
|
-
|
48
|
-
|
49
|
-
- 3
|
50
|
-
version: 1.0.0.rc.3
|
51
|
-
name: osheet
|
47
|
+
version: "1.0"
|
48
|
+
type: :runtime
|
52
49
|
version_requirements: *id002
|
53
|
-
prerelease: false
|
54
50
|
- !ruby/object:Gem::Dependency
|
55
|
-
|
51
|
+
name: xmlss
|
52
|
+
prerelease: false
|
56
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
54
|
none: false
|
58
55
|
requirements:
|
59
56
|
- - ~>
|
60
57
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
58
|
+
hash: 15
|
62
59
|
segments:
|
63
60
|
- 1
|
64
61
|
- 0
|
65
|
-
|
66
|
-
|
67
|
-
- 4
|
68
|
-
version: 1.0.0.rc.4
|
69
|
-
name: xmlss
|
62
|
+
version: "1.0"
|
63
|
+
type: :runtime
|
70
64
|
version_requirements: *id003
|
71
|
-
prerelease: false
|
72
65
|
description: An Osheet writer (https://github.com/kellyredding/osheet) for the XMLSS format (https://github.com/kellyredding/xmlss)
|
73
66
|
email:
|
74
67
|
- kelly@kellyredding.com
|
@@ -81,7 +74,7 @@ extra_rdoc_files: []
|
|
81
74
|
files:
|
82
75
|
- .gitignore
|
83
76
|
- Gemfile
|
84
|
-
- LICENSE
|
77
|
+
- LICENSE.txt
|
85
78
|
- README.md
|
86
79
|
- Rakefile
|
87
80
|
- bench/bench_runner.rb
|
@@ -91,17 +84,11 @@ files:
|
|
91
84
|
- bench/profiler.rb
|
92
85
|
- bench/profiler_runner.rb
|
93
86
|
- examples/basic.rb
|
94
|
-
- examples/basic.xls
|
95
87
|
- examples/basic_with_templates.rb
|
96
|
-
- examples/basic_with_templates.xls
|
97
88
|
- examples/formats.rb
|
98
|
-
- examples/formats.xls
|
99
89
|
- examples/formula.rb
|
100
|
-
- examples/formula.xls
|
101
90
|
- examples/styles.rb
|
102
|
-
- examples/styles.xls
|
103
91
|
- examples/trivial.rb
|
104
|
-
- examples/trivial.xls
|
105
92
|
- lib/osheet/xmlss.rb
|
106
93
|
- lib/osheet/xmlss/style_cache.rb
|
107
94
|
- lib/osheet/xmlss/style_settings.rb
|
@@ -109,15 +96,14 @@ files:
|
|
109
96
|
- lib/osheet/xmlss_writer.rb
|
110
97
|
- osheet-xmlss.gemspec
|
111
98
|
- test/helper.rb
|
112
|
-
- test/
|
113
|
-
- test/xmlss/
|
114
|
-
- test/xmlss/
|
115
|
-
- test/xmlss/
|
116
|
-
- test/
|
117
|
-
- test/xmlss_writer_test.rb
|
99
|
+
- test/unit/xmlss/api_tests.rb
|
100
|
+
- test/unit/xmlss/style_cache_tests.rb
|
101
|
+
- test/unit/xmlss/style_settings_tests.rb
|
102
|
+
- test/unit/xmlss/styles_tests.rb
|
103
|
+
- test/unit/xmlss_writer_tests.rb
|
118
104
|
homepage: http://github.com/kellyredding/osheet-xmlss
|
119
|
-
licenses:
|
120
|
-
|
105
|
+
licenses:
|
106
|
+
- MIT
|
121
107
|
post_install_message:
|
122
108
|
rdoc_options: []
|
123
109
|
|
@@ -135,26 +121,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
122
|
none: false
|
137
123
|
requirements:
|
138
|
-
- - "
|
124
|
+
- - ">="
|
139
125
|
- !ruby/object:Gem::Version
|
140
|
-
hash:
|
126
|
+
hash: 3
|
141
127
|
segments:
|
142
|
-
-
|
143
|
-
|
144
|
-
- 1
|
145
|
-
version: 1.3.1
|
128
|
+
- 0
|
129
|
+
version: "0"
|
146
130
|
requirements: []
|
147
131
|
|
148
132
|
rubyforge_project:
|
149
|
-
rubygems_version: 1.8.
|
133
|
+
rubygems_version: 1.8.24
|
150
134
|
signing_key:
|
151
135
|
specification_version: 3
|
152
136
|
summary: An Osheet writer (https://github.com/kellyredding/osheet) for the XMLSS format (https://github.com/kellyredding/xmlss)
|
153
137
|
test_files:
|
154
138
|
- test/helper.rb
|
155
|
-
- test/
|
156
|
-
- test/xmlss/
|
157
|
-
- test/xmlss/
|
158
|
-
- test/xmlss/
|
159
|
-
- test/
|
160
|
-
- test/xmlss_writer_test.rb
|
139
|
+
- test/unit/xmlss/api_tests.rb
|
140
|
+
- test/unit/xmlss/style_cache_tests.rb
|
141
|
+
- test/unit/xmlss/style_settings_tests.rb
|
142
|
+
- test/unit/xmlss/styles_tests.rb
|
143
|
+
- test/unit/xmlss_writer_tests.rb
|