simple-spreadsheet-extractor 0.7.2.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.rdoc +3 -5
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/simple-spreadsheet-extractor.rb +22 -23
- data/simple-spreadsheet-extractor.gemspec +8 -14
- metadata +12 -33
- data/test/files/not-a-spreadsheet.xls +0 -1
- data/test/files/test-csv-output1-trimmed.csv +0 -2
- data/test/files/test-csv-output1.csv +0 -4
- data/test/files/test-spreadsheet.xls +0 -0
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
= Simple Spreadsheet Extractor
|
2
2
|
|
3
3
|
Authors:: Stuart Owen, Finn Bacall
|
4
|
-
Version:: 0.
|
4
|
+
Version:: 0.8.0
|
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
|
-
Copyright:: (c) 2010 The University of Manchester, UK
|
7
|
+
Copyright:: (c) 2010-2012 The University of Manchester, UK
|
8
8
|
|
9
9
|
|
10
10
|
== Synopsis
|
@@ -23,9 +23,7 @@ Java 1.6 (JRE) is required.
|
|
23
23
|
|
24
24
|
gem install simple-spreadsheet-extractor
|
25
25
|
|
26
|
-
Note that
|
27
|
-
|
28
|
-
gem install win32-open3
|
26
|
+
*Note that Windows is no longer supported* (since version 0.7.2.1)
|
29
27
|
|
30
28
|
== Usage
|
31
29
|
|
data/Rakefile
CHANGED
@@ -21,8 +21,8 @@ begin
|
|
21
21
|
gemspec.files.include %w(jars)
|
22
22
|
gemspec.files.exclude "test/*"
|
23
23
|
gemspec.extra_rdoc_files = ["README.rdoc", "LICENCE"]
|
24
|
-
gemspec.add_dependency("POpen4","0.1.4")
|
25
|
-
gemspec.add_dependency("open4","1.0
|
24
|
+
#gemspec.add_dependency("POpen4","0.1.4")
|
25
|
+
gemspec.add_dependency("open4","1.3.0")
|
26
26
|
end
|
27
27
|
rescue LoadError
|
28
28
|
puts "Jeweler not available. Install it with: gem install jeweler"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.8.0
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'popen4'
|
3
2
|
require 'open4'
|
4
3
|
|
5
4
|
|
@@ -14,7 +13,7 @@ module SysMODB
|
|
14
13
|
|
15
14
|
def spreadsheet_to_xml spreadsheet_data
|
16
15
|
if is_windows?
|
17
|
-
|
16
|
+
raise Exception.new("Windows is not currently supported")
|
18
17
|
else
|
19
18
|
read_with_open4 spreadsheet_data,"xml"
|
20
19
|
end
|
@@ -22,7 +21,7 @@ module SysMODB
|
|
22
21
|
|
23
22
|
def spreadsheet_to_csv spreadsheet_data,sheet=1,trim=false
|
24
23
|
if is_windows?
|
25
|
-
|
24
|
+
raise Exception.new("Windows is not currently supported")
|
26
25
|
else
|
27
26
|
read_with_open4 spreadsheet_data,"csv",sheet,trim
|
28
27
|
end
|
@@ -45,26 +44,26 @@ module SysMODB
|
|
45
44
|
end
|
46
45
|
|
47
46
|
#opens using POpen4 - this is for the benefit of Windows. It has been found to be unstable in Linux and give occasional segmentation faults
|
48
|
-
def read_with_popen4 spreadsheet_data,format="xml",sheet=nil,trim=false
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
47
|
+
#def read_with_popen4 spreadsheet_data,format="xml",sheet=nil,trim=false
|
48
|
+
# output=""
|
49
|
+
# err_message = ""
|
50
|
+
# command = spreadsheet_extractor_command format,sheet,trim
|
51
|
+
# status = POpen4::popen4(command) do |stdout, stderr, stdin, pid|
|
52
|
+
# stdin=stdin.binmode
|
53
|
+
# spreadsheet_data.each_byte{|b| stdin.putc(b)}
|
54
|
+
# stdin.close
|
55
|
+
#
|
56
|
+
# output=stdout.read.strip
|
57
|
+
# err_message=stderr.read.strip
|
58
|
+
#
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# if status.to_i != 0
|
62
|
+
# raise SpreadsheetExtractionException.new(err_message)
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# output.strip
|
66
|
+
#end
|
68
67
|
|
69
68
|
def read_with_open4 spreadsheet_data,format="xml",sheet=nil,trim=false
|
70
69
|
output = ""
|
@@ -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.
|
8
|
+
s.version = "0.8.0"
|
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{
|
12
|
+
s.date = %q{2012-01-20}
|
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 = [
|
@@ -29,30 +29,24 @@ Gem::Specification.new do |s|
|
|
29
29
|
"jars/lib/xmlbeans-2.3.0.jar",
|
30
30
|
"jars/simple-spreadsheet-extractor-0.7.2.jar",
|
31
31
|
"lib/simple-spreadsheet-extractor.rb",
|
32
|
-
"simple-spreadsheet-extractor.gemspec"
|
33
|
-
"test/files/not-a-spreadsheet.xls",
|
34
|
-
"test/files/test-csv-output1-trimmed.csv",
|
35
|
-
"test/files/test-csv-output1.csv",
|
36
|
-
"test/files/test-spreadsheet.xls"
|
32
|
+
"simple-spreadsheet-extractor.gemspec"
|
37
33
|
]
|
38
34
|
s.homepage = %q{http://github.com/myGrid/simple-spreadsheet-extractor-gem}
|
39
35
|
s.require_paths = ["lib"]
|
40
|
-
s.rubygems_version = %q{1.
|
36
|
+
s.rubygems_version = %q{1.3.7}
|
41
37
|
s.summary = %q{Basic spreadsheet content extraction using Apache POI}
|
42
38
|
|
43
39
|
if s.respond_to? :specification_version then
|
40
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
41
|
s.specification_version = 3
|
45
42
|
|
46
43
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
-
s.add_runtime_dependency(%q<
|
48
|
-
s.add_runtime_dependency(%q<open4>, ["= 1.0.1"])
|
44
|
+
s.add_runtime_dependency(%q<open4>, ["= 1.3.0"])
|
49
45
|
else
|
50
|
-
s.add_dependency(%q<
|
51
|
-
s.add_dependency(%q<open4>, ["= 1.0.1"])
|
46
|
+
s.add_dependency(%q<open4>, ["= 1.3.0"])
|
52
47
|
end
|
53
48
|
else
|
54
|
-
s.add_dependency(%q<
|
55
|
-
s.add_dependency(%q<open4>, ["= 1.0.1"])
|
49
|
+
s.add_dependency(%q<open4>, ["= 1.3.0"])
|
56
50
|
end
|
57
51
|
end
|
58
52
|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-spreadsheet-extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 63
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 0.7.2.1
|
8
|
+
- 8
|
9
|
+
- 0
|
10
|
+
version: 0.8.0
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Stuart Owen
|
@@ -17,41 +16,25 @@ autorequire:
|
|
17
16
|
bindir: bin
|
18
17
|
cert_chain: []
|
19
18
|
|
20
|
-
date:
|
19
|
+
date: 2012-01-20 00:00:00 +00:00
|
21
20
|
default_executable:
|
22
21
|
dependencies:
|
23
|
-
- !ruby/object:Gem::Dependency
|
24
|
-
name: POpen4
|
25
|
-
prerelease: false
|
26
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
-
none: false
|
28
|
-
requirements:
|
29
|
-
- - "="
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
hash: 19
|
32
|
-
segments:
|
33
|
-
- 0
|
34
|
-
- 1
|
35
|
-
- 4
|
36
|
-
version: 0.1.4
|
37
|
-
type: :runtime
|
38
|
-
version_requirements: *id001
|
39
22
|
- !ruby/object:Gem::Dependency
|
40
23
|
name: open4
|
41
24
|
prerelease: false
|
42
|
-
requirement: &
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
43
26
|
none: false
|
44
27
|
requirements:
|
45
28
|
- - "="
|
46
29
|
- !ruby/object:Gem::Version
|
47
|
-
hash:
|
30
|
+
hash: 27
|
48
31
|
segments:
|
49
32
|
- 1
|
33
|
+
- 3
|
50
34
|
- 0
|
51
|
-
|
52
|
-
version: 1.0.1
|
35
|
+
version: 1.3.0
|
53
36
|
type: :runtime
|
54
|
-
version_requirements: *
|
37
|
+
version_requirements: *id001
|
55
38
|
description: Takes a stream to a spreadsheet file and produces an XML or CSV representation of its contents
|
56
39
|
email: stuart.owen@manchester.ac.uk
|
57
40
|
executables: []
|
@@ -75,10 +58,6 @@ files:
|
|
75
58
|
- jars/simple-spreadsheet-extractor-0.7.2.jar
|
76
59
|
- lib/simple-spreadsheet-extractor.rb
|
77
60
|
- simple-spreadsheet-extractor.gemspec
|
78
|
-
- test/files/not-a-spreadsheet.xls
|
79
|
-
- test/files/test-csv-output1-trimmed.csv
|
80
|
-
- test/files/test-csv-output1.csv
|
81
|
-
- test/files/test-spreadsheet.xls
|
82
61
|
has_rdoc: true
|
83
62
|
homepage: http://github.com/myGrid/simple-spreadsheet-extractor-gem
|
84
63
|
licenses: []
|
@@ -109,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
88
|
requirements: []
|
110
89
|
|
111
90
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.
|
91
|
+
rubygems_version: 1.3.7
|
113
92
|
signing_key:
|
114
93
|
specification_version: 3
|
115
94
|
summary: Basic spreadsheet content extraction using Apache POI
|
@@ -1 +0,0 @@
|
|
1
|
-
this is not a spreadsheet
|
Binary file
|