Top Level Namespace

Defined Under Namespace

Modules: Writexlsx, ZipFileUtils Classes: ColName, String, WriteXLSX, WriteXLSXDimensionError, WriteXLSXInsufficientArgumentError, WriteXLSXOptionParameterError

Constant Summary collapse

WriteXLSX_VERSION =
"0.85.1"

Instance Method Summary collapse

Instance Method Details

#extract_vba_project(src, dest, options = {}) ⇒ Object

src zip filename dest destination directory options :fs_encoding=


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'bin/extract_vba.rb', line 10

def extract_vba_project(src, dest, options = {})
  FileUtils.makedirs(dest)
  Zip::ZipInputStream.open(src) do |is|
    loop do
      entry = is.get_next_entry()
      break if entry.nil?()
      if entry.name == 'xl/vbaProject.bin'
        path = File.join(dest, 'vbaProject.bin')
        File.open(path, File::CREAT|File::WRONLY|File::BINARY) do |w|
          w.puts(is.read())
        end
        # The mod data on vbaProject.bin isn't generally set correctly in the
        # xlsm/zip file. This can cause issues on Windows so reset it to the
        # current data.
        ctime = Time.now
        File::utime(ctime, ctime, path)
        break
      end
    end
  end
end

#ruby_18Object

:nodoc:


54
55
56
# File 'lib/write_xlsx/compatibility.rb', line 54

def ruby_18 #:nodoc:
  yield
end

#ruby_19Object

:nodoc:


58
59
60
# File 'lib/write_xlsx/compatibility.rb', line 58

def ruby_19 #:nodoc:
  false
end