Class: SysMODB::Extractor
- Inherits:
-
Object
- Object
- SysMODB::Extractor
- Defined in:
- lib/sysmodb/extractor.rb
Overview
handles the delegation to java, and executes the extraction passing the input file through STDIN, and reading the results through STDOUT.
Constant Summary collapse
- JAR_VERSION =
"0.15.0"
- DEFAULT_PATH =
File.dirname(__FILE__) + "/../../jars/simple-spreadsheet-extractor-#{JAR_VERSION}.jar"
- BUFFER_SIZE =
1/4 a megabyte
250000
Instance Method Summary collapse
-
#initialize(memory_allocation) ⇒ Extractor
constructor
A new instance of Extractor.
- #spreadsheet_to_csv(spreadsheet_data, sheet = 1, trim = false) ⇒ Object
- #spreadsheet_to_xml(spreadsheet_data) ⇒ Object
Constructor Details
#initialize(memory_allocation) ⇒ Extractor
Returns a new instance of Extractor.
14 15 16 17 18 19 |
# File 'lib/sysmodb/extractor.rb', line 14 def initialize(memory_allocation) @memory_allocation = memory_allocation if is_windows? raise Exception.new("Windows is not currently supported") end end |
Instance Method Details
#spreadsheet_to_csv(spreadsheet_data, sheet = 1, trim = false) ⇒ Object
25 26 27 |
# File 'lib/sysmodb/extractor.rb', line 25 def spreadsheet_to_csv(spreadsheet_data,sheet=1,trim=false) read_with_open4 spreadsheet_data,"csv",sheet,trim end |
#spreadsheet_to_xml(spreadsheet_data) ⇒ Object
21 22 23 |
# File 'lib/sysmodb/extractor.rb', line 21 def spreadsheet_to_xml(spreadsheet_data) read_with_open4 spreadsheet_data,"xml" end |