Sha256: bcae7daff5c1200197d8d6d4ee525b9edcad03fd30e3b57e5136f2b2b6a70a0c

Contents?: true

Size: 929 Bytes

Versions: 3

Compression:

Stored size: 929 Bytes

Contents

class RemoteTable  
  class Format
    autoload :Excel, 'remote_table/format/excel'
    autoload :Excelx, 'remote_table/format/excelx'
    autoload :Delimited, 'remote_table/format/delimited'
    autoload :OpenOffice, 'remote_table/format/open_office'
    autoload :FixedWidth, 'remote_table/format/fixed_width'
    autoload :HTML, 'remote_table/format/html'
    
    autoload :Textual, 'remote_table/format/mixins/textual'
    autoload :Rooable, 'remote_table/format/mixins/rooable'
    
    attr_reader :t

    def initialize(t)
      @t = t
    end
    
    include ::Enumerable
    def each
      raise "must be defined by format"
    end
    
    def backup_file!
      ::FileUtils.cp t.local_file.path, "#{t.local_file.path}.backup"
    end
    
    def restore_file!
      return unless ::File.readable? "#{t.local_file.path}.backup"
      ::FileUtils.mv "#{t.local_file.path}.backup", t.local_file.path
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
remote_table-1.1.2 lib/remote_table/format.rb
remote_table-1.1.1 lib/remote_table/format.rb
remote_table-1.1.0 lib/remote_table/format.rb