poi2csv 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/classes/ToCSV$ExcelFilenameFilter.class +0 -0
- data/classes/ToCSV.class +0 -0
- data/lib/poi2csv/version.rb +1 -1
- data/lib/poi2csv.rb +4 -1
- data/src/ToCSV.java +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ebec8107ea1c700652cf0ad34f2a79559eff813
|
4
|
+
data.tar.gz: 1c1849e8fe0939a46fe534fa55952bbd9983a2df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 144bd751b9e12f3412ca49408cc6a9fdd83539f726694de8e5cc2c038225f784aed321d3c43c1aa70cc35bf3a5fd57514412c4d1d2ebf78e16a95ba8be76c6d0
|
7
|
+
data.tar.gz: a08b5bccd32699b4914de68d7e731fff64cb1ca032cf41f0dc3ff74e642d1dddd6fdf0a51d9d40df94a3b7cc4367f8d0c7df328c15f026984128023343a81b5a
|
Binary file
|
data/classes/ToCSV.class
CHANGED
Binary file
|
data/lib/poi2csv/version.rb
CHANGED
data/lib/poi2csv.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
require 'shellwords'
|
1
2
|
require "poi2csv/version"
|
2
3
|
|
3
4
|
module Poi2csv
|
4
5
|
|
5
6
|
def self.to_csv(input_file_path, output_folder_path, separator=nil, formating_convention=nil)
|
6
|
-
|
7
|
+
args = [input_file_path, output_folder_path, separator, formating_convention].reject { |v| v.nil? }
|
8
|
+
args = args.map { |v| Shellwords.escape(v) }
|
9
|
+
`java -cp #{classpath} ToCSV #{args * ' '}`
|
7
10
|
end
|
8
11
|
|
9
12
|
def self.classpath
|
data/src/ToCSV.java
CHANGED
@@ -26,11 +26,12 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
26
26
|
|
27
27
|
import java.io.File;
|
28
28
|
import java.io.FileInputStream;
|
29
|
-
import java.io.FileWriter;
|
30
29
|
import java.io.BufferedWriter;
|
31
30
|
import java.io.FilenameFilter;
|
31
|
+
import java.io.FileOutputStream;
|
32
32
|
import java.io.IOException;
|
33
33
|
import java.io.FileNotFoundException;
|
34
|
+
import java.io.OutputStreamWriter;
|
34
35
|
import java.util.ArrayList;
|
35
36
|
|
36
37
|
/**
|
@@ -445,7 +446,7 @@ public class ToCSV {
|
|
445
446
|
*/
|
446
447
|
private void saveCSVFile(File file)
|
447
448
|
throws FileNotFoundException, IOException {
|
448
|
-
|
449
|
+
OutputStreamWriter fw = null;
|
449
450
|
BufferedWriter bw = null;
|
450
451
|
ArrayList<String> line = null;
|
451
452
|
StringBuffer buffer = null;
|
@@ -455,7 +456,7 @@ public class ToCSV {
|
|
455
456
|
System.out.println("Saving the CSV file [" + file.getName() + "]");
|
456
457
|
|
457
458
|
// Open a writer onto the CSV file.
|
458
|
-
fw = new
|
459
|
+
fw = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
|
459
460
|
bw = new BufferedWriter(fw);
|
460
461
|
|
461
462
|
// Step through the elements of the ArrayList that was used to hold
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poi2csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Douglas English
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|