simple-spreadsheet-extractor 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = Simple Spreadsheet Extractor
2
2
 
3
3
  Authors:: Stuart Owen, Finn Bacall
4
- Version:: 0.6.1
4
+ Version:: 0.6.2
5
5
  Contact:: mailto:stuart.owen@manchester.ac.uk
6
6
  Licence:: BSD (See LICENCE or http://www.opensource.org/licenses/bsd-license.php)
7
7
  Copyright:: (c) 2010 The University of Manchester, UK
@@ -136,4 +136,4 @@ e.g.
136
136
  </columns>
137
137
  <rows first_row="1" last_row="1"/>
138
138
  </sheet>
139
- </workbook>
139
+ </workbook>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.2
@@ -9,7 +9,7 @@ module SysMODB
9
9
  end
10
10
 
11
11
  module SpreadsheetExtractor
12
- JAR_VERSION="0.6.0"
12
+ JAR_VERSION="0.6.2"
13
13
  DEFAULT_PATH = File.dirname(__FILE__) + "/../jars/simple-spreadsheet-extractor-#{JAR_VERSION}.jar"
14
14
 
15
15
  def spreadsheet_to_xml spreadsheet_data
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{simple-spreadsheet-extractor}
8
- s.version = "0.6.1"
8
+ s.version = "0.6.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Stuart Owen", "Finn Bacall"]
12
- s.date = %q{2011-06-16}
12
+ s.date = %q{2011-07-21}
13
13
  s.description = %q{Takes a stream to a spreadsheet file and produces an XML or CSV representation of its contents}
14
14
  s.email = %q{stuart.owen@manchester.ac.uk}
15
15
  s.extra_rdoc_files = [
@@ -27,18 +27,14 @@ Gem::Specification.new do |s|
27
27
  "jars/lib/poi-ooxml-3.7.jar",
28
28
  "jars/lib/poi-ooxml-schemas-3.7.jar",
29
29
  "jars/lib/xmlbeans-2.3.0.jar",
30
- "jars/simple-spreadsheet-extractor-0.6.0.jar",
30
+ "jars/simple-spreadsheet-extractor-0.6.2.jar",
31
31
  "lib/simple-spreadsheet-extractor.rb",
32
32
  "simple-spreadsheet-extractor.gemspec"
33
33
  ]
34
34
  s.homepage = %q{http://github.com/myGrid/simple-spreadsheet-extractor-gem}
35
35
  s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.4.2}
36
+ s.rubygems_version = %q{1.5.3}
37
37
  s.summary = %q{Basic spreadsheet content extraction using Apache POI}
38
- s.test_files = [
39
- "examples/example.rb",
40
- "test/test_extraction.rb"
41
- ]
42
38
 
43
39
  if s.respond_to? :specification_version then
44
40
  s.specification_version = 3
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-spreadsheet-extractor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
9
+ - 2
10
+ version: 0.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stuart Owen
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-06-16 00:00:00 +01:00
19
+ date: 2011-07-21 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -71,10 +71,9 @@ files:
71
71
  - jars/lib/poi-ooxml-3.7.jar
72
72
  - jars/lib/poi-ooxml-schemas-3.7.jar
73
73
  - jars/lib/xmlbeans-2.3.0.jar
74
- - jars/simple-spreadsheet-extractor-0.6.0.jar
74
+ - jars/simple-spreadsheet-extractor-0.6.2.jar
75
75
  - lib/simple-spreadsheet-extractor.rb
76
76
  - simple-spreadsheet-extractor.gemspec
77
- - test/test_extraction.rb
78
77
  has_rdoc: true
79
78
  homepage: http://github.com/myGrid/simple-spreadsheet-extractor-gem
80
79
  licenses: []
@@ -105,10 +104,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
104
  requirements: []
106
105
 
107
106
  rubyforge_project:
108
- rubygems_version: 1.4.2
107
+ rubygems_version: 1.5.3
109
108
  signing_key:
110
109
  specification_version: 3
111
110
  summary: Basic spreadsheet content extraction using Apache POI
112
- test_files:
113
- - examples/example.rb
114
- - test/test_extraction.rb
111
+ test_files: []
112
+
@@ -1,78 +0,0 @@
1
- require 'test/unit'
2
- require 'simple-spreadsheet-extractor'
3
- require 'libxml'
4
-
5
- class TestExtraction < Test::Unit::TestCase
6
-
7
- SCHEMA_FILE_PATH = File.dirname(__FILE__) + "/../doc/schema-v1.xsd"
8
-
9
- include SysMODB::SpreadsheetExtractor
10
-
11
- def test_from_file_object
12
- test_sheet = File.dirname(__FILE__) + "/files/test-spreadsheet.xls"
13
- f=open(test_sheet,"rb")
14
- xml = spreadsheet_to_xml(f)
15
- assert_not_nil xml
16
- end
17
-
18
- def test_validate_xml
19
- test_sheet = File.dirname(__FILE__) + "/files/test-spreadsheet.xls"
20
- f=open(test_sheet,"rb")
21
- xml = spreadsheet_to_xml(f)
22
- validate_against_schema(xml)
23
- end
24
-
25
- def test_failure
26
- test_sheet = File.dirname(__FILE__) + "/files/not-a-spreadsheet.xls"
27
- f=open(test_sheet,"rb")
28
- assert_raise SysMODB::SpreadsheetExtractionException do
29
- spreadsheet_to_xml(f)
30
- end
31
- end
32
-
33
- def validate_against_schema xml
34
- document = LibXML::XML::Document.string(xml)
35
- schema = LibXML::XML::Schema.new(SCHEMA_FILE_PATH)
36
- begin
37
- document.validate_schema(schema)
38
- rescue LibXML::XML::Error => e
39
- puts xml
40
- assert false,"Error validating against schema: #{e.message}"
41
- end
42
- end
43
-
44
- def test_csv_output
45
- test_sheet = File.dirname(__FILE__) + "/files/test-spreadsheet.xls"
46
- expected_file = File.dirname(__FILE__) + "/files/test-csv-output1.csv"
47
- expected = open(expected_file,"rb").read
48
-
49
- f=open(test_sheet,"rb")
50
- csv = spreadsheet_to_csv(f,2)
51
- assert_equal expected,csv
52
-
53
- #try sheet as a string
54
- f=open(test_sheet,"rb")
55
- csv = spreadsheet_to_csv(f,"2")
56
- assert_equal expected,csv
57
- end
58
-
59
- # def test_csv_output_trimmed
60
- # test_sheet = File.dirname(__FILE__) + "/files/test-spreadsheet.xls"
61
- # expected_file = File.dirname(__FILE__) + "/files/test-csv-output1-trimmed.csv"
62
- # expected = open(expected_file,"rb").read
63
- #
64
- # f=open(test_sheet,"rb")
65
- # csv = spreadsheet_to_csv(f,2,true)
66
- # assert_equal expected,csv
67
- # end
68
-
69
- def test_for_segfault
70
- test_sheet = File.dirname(__FILE__) + "/files/test-spreadsheet.xls"
71
- 10.times do |x|
72
- f=open(test_sheet,"rb")
73
- xml = spreadsheet_to_xml(f)
74
- end
75
- true
76
- end
77
-
78
- end