diff options
Diffstat (limited to 'lib/roo.rb')
| -rw-r--r-- | lib/roo.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/roo.rb b/lib/roo.rb new file mode 100644 index 0000000..ec8eb42 --- /dev/null +++ b/lib/roo.rb @@ -0,0 +1,33 @@ +require 'roo/constants' +require 'roo/errors' +require 'roo/spreadsheet' +require 'roo/base' + +module Roo + autoload :OpenOffice, 'roo/open_office' + autoload :LibreOffice, 'roo/libre_office' + autoload :Excelx, 'roo/excelx' + autoload :CSV, 'roo/csv' + + TEMP_PREFIX = 'roo_'.freeze + + CLASS_FOR_EXTENSION = { + ods: Roo::OpenOffice, + xlsx: Roo::Excelx, + xlsm: Roo::Excelx, + csv: Roo::CSV + } + + def self.const_missing(const_name) + case const_name + when :Excel + raise ROO_EXCEL_NOTICE + when :Excel2003XML + raise ROO_EXCELML_NOTICE + when :Google + raise ROO_GOOGLE_NOTICE + else + super + end + end +end |
