summaryrefslogtreecommitdiffstats
path: root/lib/roo.rb
blob: ec8eb4247fa34992ed32ac6114e9a2d35685e248 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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