Issue #12404 has been reported by Justin Peal.

----------------------------------------
Bug #12404: Segmentation fault in ruby 2.3.0p0
https://bugs.ruby-lang.org/issues/12404

* Author: Justin Peal
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
C:/R/Hike/genexcel.rb:36: [BUG] Segmentation fault
ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]

-- Control frame information -----------------------------------------------
c:0027 p:---- s:0098 e:000097 CFUNC  :method_missing
c:0026 p:0034 s:0093 e:000091 BLOCK  C:/R/Hike/genexcel.rb:36 [FINISH]
c:0025 p:---- s:0088 e:000087 IFUNC
c:0024 p:---- s:0086 e:000085 IFUNC
c:0023 p:---- s:0084 e:000083 CFUNC  :upto
c:0022 p:---- s:0082 e:000081 CFUNC  :each
c:0021 p:---- s:0080 e:000079 CFUNC  :each_with_index
c:0020 p:0040 s:0077 e:000076 BLOCK  C:/R/Hike/genexcel.rb:35 [FINISH]
c:0019 p:---- s:0073 e:000072 CFUNC  :each_line
c:0018 p:0010 s:0070 e:000069 BLOCK  C:/R/Hike/genexcel.rb:32 [FINISH]
c:0017 p:---- s:0067 e:000066 CFUNC  :open
c:0016 p:0188 s:0062 e:000061 METHOD C:/R/Hike/genexcel.rb:31
c:0015 p:0120 s:0051 e:000050 METHOD C:/R/Hike/genexcel.rb:61
c:0014 p:0021 s:0045 e:000044 METHOD C:/R/hike/Lvzi.rb:2359
c:0013 p:0012 s:0040 e:000039 METHOD C:/R/hike/Lvzi.rb:2365
c:0012 p:0317 s:0037 e:000036 METHOD C:/R/hike/Lvzi.rb:2664
c:0011 p:0010 s:0033 e:000032 BLOCK  C:/R/hike/Lvzi.rb:2692
c:0010 p:0015 s:0031 e:000030 BLOCK  C:/R/hike/Lvzi.rb:2686
c:0009 p:0028 s:0028 e:000027 BLOCK  C:/R/Hike/sqlity.rb:29 [FINISH]
c:0008 p:---- s:0025 e:000024 CFUNC  :initialize
c:0007 p:---- s:0023 e:000022 CFUNC  :new
c:0006 p:0019 s:0019 e:000018 METHOD C:/R/Hike/sqlity.rb:26 [FINISH]
c:0005 p:---- s:0015 e:000014 CFUNC  :new
c:0004 p:0017 s:0011 e:000010 METHOD C:/R/hike/Lvzi.rb:2684
c:0003 p:0009 s:0008 e:000007 METHOD C:/R/hike/Lvzi.rb:2691
c:0002 p:0202 s:0004 E:001770 EVAL   C:/R/hike/Lvzi.rb:2699 [FINISH]
c:0001 p:0000 s:0002 E:0026d0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
C:/R/hike/Lvzi.rb:2699:in `<main>'
C:/R/hike/Lvzi.rb:2691:in `main'
C:/R/hike/Lvzi.rb:2684:in `inner_db'
C:/R/hike/Lvzi.rb:2684:in `new'
C:/R/Hike/sqlity.rb:26:in `initialize'
C:/R/Hike/sqlity.rb:26:in `new'
C:/R/Hike/sqlity.rb:26:in `initialize'
C:/R/Hike/sqlity.rb:29:in `block in initialize'
C:/R/hike/Lvzi.rb:2686:in `block in inner_db'
C:/R/hike/Lvzi.rb:2692:in `block in main'
C:/R/hike/Lvzi.rb:2664:in `inner'
C:/R/hike/Lvzi.rb:2365:in `do_generate'
C:/R/hike/Lvzi.rb:2359:in `gen_xls_one'
C:/R/Hike/genexcel.rb:61:in `main'
C:/R/Hike/genexcel.rb:31:in `book'
C:/R/Hike/genexcel.rb:31:in `open'
C:/R/Hike/genexcel.rb:32:in `block in book'
C:/R/Hike/genexcel.rb:32:in `each_line'
C:/R/Hike/genexcel.rb:35:in `block (2 levels) in book'
C:/R/Hike/genexcel.rb:35:in `each_with_index'
C:/R/Hike/genexcel.rb:35:in `each'
C:/R/Hike/genexcel.rb:35:in `upto'
C:/R/Hike/genexcel.rb:36:in `block (3 levels) in book'
C:/R/Hike/genexcel.rb:36:in `method_missing'

-- C level backtrace information -------------------------------------------
C:\WINDOWS\SYSTEM32\ntdll.dll(NtWaitForSingleObject+0x14) [0x00007FFF70E35164]
C:\WINDOWS\system32\KERNELBASE.dll(WaitForSingleObjectEx+0x8f) [0x00007FFF6DF0AADF]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_bugreport+0xa4) [0x000000006E6AF2C4]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_bug_context+0x68) [0x000000006E54B758]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_check_safe_obj+0x3b2) [0x000000006E61ED82]
 [0x0000000000401A85]
C:\WINDOWS\SYSTEM32\ntdll.dll(_C_specific_handler+0x96) [0x00007FFF70E25B26]
C:\WINDOWS\SYSTEM32\ntdll.dll(_chkstk+0xfd) [0x00007FFF70E39AFD]
C:\WINDOWS\SYSTEM32\ntdll.dll(RtlImageNtHeaderEx+0x4b9) [0x00007FFF70DC4FE9]
C:\WINDOWS\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x3a) [0x00007FFF70E38C0A]
 [0x0000000065282CF3]
 [0x0000000065283FA6]
 [0x0000000065285A1A]
 [0x0000000065288E13]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_error_arity+0x1fb) [0x000000006E697DBB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x760) [0x000000006E6A4210]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0xdee) [0x000000006E6A489E]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0xe03) [0x000000006E69E8E3]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x57e8) [0x000000006E6A32C8]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x5e8f) [0x000000006E6A396F]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_get_insns_address_table+0x6b) [0x000000006E6AAD3B]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_yield_values+0xc7) [0x000000006E6AB137]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_make_proc_lambda+0x1a1) [0x000000006E69A611]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x5d1b) [0x000000006E6A37FB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_get_insns_address_table+0x6b) [0x000000006E6AAD3B]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_yield+0x27) [0x000000006E6AB047]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(InitVM_Random+0x8ad) [0x000000006E5E35CD]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_make_proc_lambda+0x1a1) [0x000000006E69A611]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x5d1b) [0x000000006E6A37FB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_get_insns_address_table+0x6b) [0x000000006E6AAD3B]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_yield+0x27) [0x000000006E6AB047]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_strftime_timespec+0x7dd) [0x000000006E62C01D]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_str_cmp+0x2b3) [0x000000006E640293]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_str_cmp+0x996) [0x000000006E640976]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x13a5) [0x000000006E6A4E55]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_each+0x185) [0x000000006E6A9FD5]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_catch+0x18d) [0x000000006E69A04D]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_block_call+0x65) [0x000000006E69A1B5]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(InitVM_Random+0x2609) [0x000000006E5E5329]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x13a5) [0x000000006E6A4E55]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_each+0x185) [0x000000006E6A9FD5]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_catch+0x18d) [0x000000006E69A04D]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_block_call+0x65) [0x000000006E69A1B5]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_enc_foreach_name+0x1da0) [0x000000006E5407F0]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_error_arity+0x1fb) [0x000000006E697DBB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0xd42) [0x000000006E69E822]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x57e8) [0x000000006E6A32C8]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x5e8f) [0x000000006E6A396F]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_get_insns_address_table+0x6b) [0x000000006E6AAD3B]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_yield+0x27) [0x000000006E6AB047]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_io_check_char_readable+0xe89) [0x000000006E5877E9]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_error_arity+0x1fb) [0x000000006E697DBB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x760) [0x000000006E6A4210]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0xd42) [0x000000006E69E822]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x57e8) [0x000000006E6A32C8]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x5e8f) [0x000000006E6A396F]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_get_insns_address_table+0x6b) [0x000000006E6AAD3B]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_yield+0x27) [0x000000006E6AB047]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_ensure+0x133) [0x000000006E554563]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_error_arity+0x1fb) [0x000000006E697DBB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x760) [0x000000006E6A4210]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0xd42) [0x000000006E69E822]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x57e8) [0x000000006E6A32C8]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x5e8f) [0x000000006E6A396F]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_get_insns_address_table+0x6b) [0x000000006E6AAD3B]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_yield+0x27) [0x000000006E6AB047]
 [0x000000006C002F6C]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x13a5) [0x000000006E6A4E55]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_funcallv+0xb8) [0x000000006E6A9158]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_class_new_instance+0x2d) [0x000000006E5B280D]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_error_arity+0x1fb) [0x000000006E697DBB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x760) [0x000000006E6A4210]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0xd42) [0x000000006E69E822]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x57e8) [0x000000006E6A32C8]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x11a7) [0x000000006E6A4C57]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_funcallv+0xb8) [0x000000006E6A9158]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_class_new_instance+0x2d) [0x000000006E5B280D]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_error_arity+0x1fb) [0x000000006E697DBB]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_invoke_proc+0x760) [0x000000006E6A4210]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0xd42) [0x000000006E69E822]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_vm_localjump_error+0x57e8) [0x000000006E6A32C8]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(rb_check_copyable+0x30c1) [0x000000006E550B31]
C:\Ruby23\bin\x64-msvcrt-ruby230.dll(ruby_run_node+0x51) [0x000000006E553881]
 [0x0000000000402D14]
 [0x00000000004013D7]
 [0x00000000004014F8]
C:\WINDOWS\system32\KERNEL32.DLL(BaseThreadInitThunk+0x22) [0x00007FFF6F568102]

-- Other runtime information -----------------------------------------------

* Loaded script: C:/R/hike/Lvzi.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/encdb.so
    5 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/trans/transdb.so
    6 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/gbk.so
    7 C:/Ruby23/lib/ruby/2.3.0/unicode_normalize.rb
    8 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/rbconfig.rb
    9 C:/Ruby23/lib/ruby/2.3.0/rubygems/compatibility.rb
   10 C:/Ruby23/lib/ruby/2.3.0/rubygems/defaults.rb
   11 C:/Ruby23/lib/ruby/2.3.0/rubygems/deprecate.rb
   12 C:/Ruby23/lib/ruby/2.3.0/rubygems/errors.rb
   13 C:/Ruby23/lib/ruby/2.3.0/rubygems/version.rb
   14 C:/Ruby23/lib/ruby/2.3.0/rubygems/requirement.rb
   15 C:/Ruby23/lib/ruby/2.3.0/rubygems/platform.rb
   16 C:/Ruby23/lib/ruby/2.3.0/rubygems/basic_specification.rb
   17 C:/Ruby23/lib/ruby/2.3.0/rubygems/stub_specification.rb
   18 C:/Ruby23/lib/ruby/2.3.0/rubygems/util/list.rb
   19 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/stringio.so
   20 C:/Ruby23/lib/ruby/2.3.0/rubygems/specification.rb
   21 C:/Ruby23/lib/ruby/2.3.0/rubygems/exceptions.rb
   22 C:/Ruby23/lib/ruby/2.3.0/rubygems/defaults/operating_system.rb
   23 C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb
   24 C:/Ruby23/lib/ruby/2.3.0/monitor.rb
   25 C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb
   26 C:/Ruby23/lib/ruby/2.3.0/rubygems.rb
   27 C:/Ruby23/lib/ruby/2.3.0/rubygems/path_support.rb
   28 C:/Ruby23/lib/ruby/2.3.0/rubygems/dependency.rb
   29 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/version.rb
   30 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/core_ext/name_error.rb
   31 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/levenshtein.rb
   32 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/jaro_winkler.rb
   33 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkable.rb
   34 C:/Ruby23/lib/ruby/2.3.0/delegate.rb
   35 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   36 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   37 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
   38 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
   39 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/null_checker.rb
   40 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/formatter.rb
   41 C:/Ruby23/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean.rb
   42 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/date_core.so
   43 C:/Ruby23/lib/ruby/2.3.0/date.rb
   44 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/digest.so
   45 C:/Ruby23/lib/ruby/2.3.0/digest.rb
   46 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/etc.so
   47 C:/Ruby23/lib/ruby/2.3.0/fileutils.rb
   48 C:/Ruby23/lib/ruby/2.3.0/optparse.rb
   49 C:/Ruby23/lib/ruby/2.3.0/ostruct.rb
   50 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/openssl.so
   51 C:/Ruby23/lib/ruby/2.3.0/openssl/bn.rb
   52 C:/Ruby23/lib/ruby/2.3.0/openssl/pkey.rb
   53 C:/Ruby23/lib/ruby/2.3.0/openssl/cipher.rb
   54 C:/Ruby23/lib/ruby/2.3.0/openssl/config.rb
   55 C:/Ruby23/lib/ruby/2.3.0/openssl/digest.rb
   56 C:/Ruby23/lib/ruby/2.3.0/openssl/x509.rb
   57 C:/Ruby23/lib/ruby/2.3.0/openssl/buffering.rb
   58 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/io/nonblock.so
   59 C:/Ruby23/lib/ruby/2.3.0/openssl/ssl.rb
   60 C:/Ruby23/lib/ruby/2.3.0/openssl.rb
   61 C:/Ruby23/lib/ruby/2.3.0/securerandom.rb
   62 C:/Ruby23/lib/ruby/2.3.0/set.rb
   63 C:/Ruby23/lib/ruby/2.3.0/shellwords.rb
   64 C:/Ruby23/lib/ruby/2.3.0/uri/rfc2396_parser.rb
   65 C:/Ruby23/lib/ruby/2.3.0/uri/rfc3986_parser.rb
   66 C:/Ruby23/lib/ruby/2.3.0/uri/common.rb
   67 C:/Ruby23/lib/ruby/2.3.0/uri/generic.rb
   68 C:/Ruby23/lib/ruby/2.3.0/uri/ftp.rb
   69 C:/Ruby23/lib/ruby/2.3.0/uri/http.rb
   70 C:/Ruby23/lib/ruby/2.3.0/uri/https.rb
   71 C:/Ruby23/lib/ruby/2.3.0/uri/ldap.rb
   72 C:/Ruby23/lib/ruby/2.3.0/uri/ldaps.rb
   73 C:/Ruby23/lib/ruby/2.3.0/uri/mailto.rb
   74 C:/Ruby23/lib/ruby/2.3.0/uri.rb
   75 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/socket.so
   76 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/io/wait.so
   77 C:/Ruby23/lib/ruby/2.3.0/socket.rb
   78 C:/Ruby23/lib/ruby/2.3.0/timeout.rb
   79 C:/Ruby23/lib/ruby/2.3.0/net/protocol.rb
   80 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/digest/md5.so
   81 C:/Ruby23/lib/ruby/2.3.0/net/smtp.rb
   82 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/type.rb
   83 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/type/columnar.rb
   84 C:/Ruby23/lib/ruby/2.3.0/logger.rb
   85 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/types/logger.rb
   86 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/types/container.rb
   87 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/types/cache.rb
   88 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-data-3.2016.0221/lib/mime/types/data.rb
   89 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/types/loader.rb
   90 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/types/registry.rb
   91 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/types.rb
   92 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mime-types-3.0/lib/mime/types/columnar.rb
   93 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/version_specific/ruby_1_9.rb
   94 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/version.rb
   95 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/core_extensions/string.rb
   96 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/indifferent_hash.rb
   97 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/core_extensions/string/access.rb
   98 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/multibyte/exceptions.rb
   99 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/multibyte/chars.rb
  100 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/multibyte/unicode.rb
  101 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/multibyte/utils.rb
  102 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/multibyte.rb
  103 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/core_extensions/string/multibyte.rb
  104 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/constants.rb
  105 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/utilities.rb
  106 C:/Ruby23/lib/ruby/2.3.0/singleton.rb
  107 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/configuration.rb
  108 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/network/retriever_methods/base.rb
  109 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/network.rb
  110 C:/Ruby23/lib/ruby/2.3.0/psych/exception.rb
  111 C:/Ruby23/lib/ruby/2.3.0/psych/syntax_error.rb
  112 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/psych.so
  113 C:/Ruby23/lib/ruby/2.3.0/psych/omap.rb
  114 C:/Ruby23/lib/ruby/2.3.0/psych/set.rb
  115 C:/Ruby23/lib/ruby/2.3.0/psych/class_loader.rb
  116 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/strscan.so
  117 C:/Ruby23/lib/ruby/2.3.0/psych/scalar_scanner.rb
  118 C:/Ruby23/lib/ruby/2.3.0/psych/nodes/node.rb
  119 C:/Ruby23/lib/ruby/2.3.0/psych/nodes/stream.rb
  120 C:/Ruby23/lib/ruby/2.3.0/psych/nodes/document.rb
  121 C:/Ruby23/lib/ruby/2.3.0/psych/nodes/sequence.rb
  122 C:/Ruby23/lib/ruby/2.3.0/psych/nodes/scalar.rb
  123 C:/Ruby23/lib/ruby/2.3.0/psych/nodes/mapping.rb
  124 C:/Ruby23/lib/ruby/2.3.0/psych/nodes/alias.rb
  125 C:/Ruby23/lib/ruby/2.3.0/psych/nodes.rb
  126 C:/Ruby23/lib/ruby/2.3.0/psych/streaming.rb
  127 C:/Ruby23/lib/ruby/2.3.0/psych/visitors/visitor.rb
  128 C:/Ruby23/lib/ruby/2.3.0/psych/visitors/to_ruby.rb
  129 C:/Ruby23/lib/ruby/2.3.0/psych/visitors/emitter.rb
  130 C:/Ruby23/lib/ruby/2.3.0/psych/handler.rb
  131 C:/Ruby23/lib/ruby/2.3.0/psych/tree_builder.rb
  132 C:/Ruby23/lib/ruby/2.3.0/psych/visitors/yaml_tree.rb
  133 C:/Ruby23/lib/ruby/2.3.0/psych/json/ruby_events.rb
  134 C:/Ruby23/lib/ruby/2.3.0/psych/visitors/json_tree.rb
  135 C:/Ruby23/lib/ruby/2.3.0/psych/visitors/depth_first.rb
  136 C:/Ruby23/lib/ruby/2.3.0/psych/visitors.rb
  137 C:/Ruby23/lib/ruby/2.3.0/psych/parser.rb
  138 C:/Ruby23/lib/ruby/2.3.0/psych/coder.rb
  139 C:/Ruby23/lib/ruby/2.3.0/psych/core_ext.rb
  140 C:/Ruby23/lib/ruby/2.3.0/psych/deprecated.rb
  141 C:/Ruby23/lib/ruby/2.3.0/psych/stream.rb
  142 C:/Ruby23/lib/ruby/2.3.0/psych/json/yaml_events.rb
  143 C:/Ruby23/lib/ruby/2.3.0/psych/json/tree_builder.rb
  144 C:/Ruby23/lib/ruby/2.3.0/psych/json/stream.rb
  145 C:/Ruby23/lib/ruby/2.3.0/psych/handlers/document_stream.rb
  146 C:/Ruby23/lib/ruby/2.3.0/psych.rb
  147 C:/Ruby23/lib/ruby/2.3.0/yaml.rb
  148 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb
  149 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/part.rb
  150 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/header.rb
  151 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/parts_list.rb
  152 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/attachments_list.rb
  153 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/body.rb
  154 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields.rb
  155 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/common/address_container.rb
  156 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/common/common_address.rb
  157 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/common/common_field.rb
  158 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/structured_field.rb
  159 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/to_field.rb
  160 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/cc_field.rb
  161 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/bcc_field.rb
  162 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/common/common_message_id.rb
  163 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/message_id_field.rb
  164 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/in_reply_to_field.rb
  165 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/references_field.rb
  166 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/unstructured_field.rb
  167 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/subject_field.rb
  168 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/comments_field.rb
  169 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/keywords_field.rb
  170 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/common/common_date.rb
  171 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/date_field.rb
  172 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/from_field.rb
  173 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/sender_field.rb
  174 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/reply_to_field.rb
  175 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/resent_date_field.rb
  176 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/resent_from_field.rb
  177 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/resent_sender_field.rb
  178 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/resent_to_field.rb
  179 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/resent_cc_field.rb
  180 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/resent_bcc_field.rb
  181 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/resent_message_id_field.rb
  182 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/return_path_field.rb
  183 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/received_field.rb
  184 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/mime_version_field.rb
  185 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/content_transfer_encoding_field.rb
  186 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/content_description_field.rb
  187 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/common/parameter_hash.rb
  188 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/content_disposition_field.rb
  189 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/content_type_field.rb
  190 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/content_id_field.rb
  191 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/fields/content_location_field.rb
  192 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/field.rb
  193 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/field_list.rb
  194 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/envelope.rb
  195 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/elements.rb
  196 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings.rb
  197 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings/transfer_encoding.rb
  198 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings/binary.rb
  199 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings/8bit.rb
  200 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings/7bit.rb
  201 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings/base64.rb
  202 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings/quoted_printable.rb
  203 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/encodings/unix_to_unix.rb
  204 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/matchers/has_sent_mail.rb
  205 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/matchers/attachment_matchers.rb
  206 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/mail.rb
  207 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail.rb
  208 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi_c.so
  209 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/platform.rb
  210 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/types.rb
  211 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/library.rb
  212 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/errno.rb
  213 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/pointer.rb
  214 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/memorypointer.rb
  215 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/struct_layout_builder.rb
  216 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/struct.rb
  217 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/union.rb
  218 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/managedstruct.rb
  219 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/callback.rb
  220 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/io.rb
  221 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/autopointer.rb
  222 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/variadic.rb
  223 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/enum.rb
  224 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/ffi.rb
  225 C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi.rb
  226 C:/R/Hike/b128.rb
  227 C:/R/Hike/crypto.rb
  228 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/win32ole.so
  229 C:/R/Hike/genexcel.rb
  230 C:/Ruby23/lib/ruby/2.3.0/net/imap.rb
  231 C:/R/Hike/aesy.rb
  232 C:/Ruby23/lib/ruby/2.3.0/base64.rb
  233 C:/R/Hike/rsay.rb
  234 C:/Ruby23/lib/ruby/2.3.0/forwardable.rb
  235 C:/Ruby23/lib/ruby/2.3.0/English.rb
  236 C:/Ruby23/lib/ruby/2.3.0/csv.rb
  237 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/cgi/escape.so
  238 C:/Ruby23/lib/ruby/2.3.0/cgi/util.rb
  239 C:/Ruby23/lib/ruby/2.3.0/erb.rb
  240 C:/Ruby23/lib/ruby/2.3.0/abbrev.rb
  241 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/compatibility.rb
  242 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/fiddle.so
  243 C:/Ruby23/lib/ruby/2.3.0/fiddle/function.rb
  244 C:/Ruby23/lib/ruby/2.3.0/fiddle/closure.rb
  245 C:/Ruby23/lib/ruby/2.3.0/fiddle.rb
  246 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/system_extensions.rb
  247 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/pathname.so
  248 C:/Ruby23/lib/ruby/2.3.0/pathname.rb
  249 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/question.rb
  250 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/menu.rb
  251 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/color_scheme.rb
  252 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/style.rb
  253 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/version.rb
  254 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/string_extensions.rb
  255 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline.rb
  256 C:/Ruby23/lib/ruby/gems/2.3.0/gems/highline-1.7.8/lib/highline/import.rb
  257 C:/R/Hike/tips.rb
  258 C:/R/Hike/smtpy.rb
  259 C:/R/Hike/imapy.rb
  260 C:/R/Hike/inifile.rb
  261 C:/R/Hike/note.rb
  262 C:/R/Hike/chinese.rb
  263 C:/R/Hike/nick.rb
  264 C:/R/Hike/reg.rb
  265 C:/R/Hike/join.rb
  266 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/sqlite3_native.so
  267 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/constants.rb
  268 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/errors.rb
  269 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/pragmas.rb
  270 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/resultset.rb
  271 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/statement.rb
  272 C:/Ruby23/lib/ruby/2.3.0/time.rb
  273 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/translator.rb
  274 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/value.rb
  275 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/database.rb
  276 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3/version.rb
  277 C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11/lib/sqlite3.rb
  278 C:/R/Hike/sqlity.rb
  279 C:/Ruby23/lib/ruby/2.3.0/fiddle/value.rb
  280 C:/Ruby23/lib/ruby/2.3.0/fiddle/pack.rb
  281 C:/Ruby23/lib/ruby/2.3.0/fiddle/struct.rb
  282 C:/Ruby23/lib/ruby/2.3.0/fiddle/cparser.rb
  283 C:/Ruby23/lib/ruby/2.3.0/fiddle/import.rb
  284 C:/Ruby23/lib/ruby/2.3.0/win32api.rb
  285 C:/R/Hike/clipboard.rb
  286 C:/R/Hike/rnd.rb
  287 C:/R/Hike/carry.rb
  288 C:/R/Hike/whole.rb
  289 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/utf_16le.so
  290 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/utf_16be.so
  291 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/trans/utf_16_32.so
  292 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/check_delivery_params.rb
  293 C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb
  294 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/gb18030.so
  295 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/trans/gb18030.so
  296 C:/Ruby23/lib/ruby/2.3.0/x64-mingw32/enc/trans/single_byte.so

==============================================================================
Content of genexcel.rb (Can run in Ruby 2.2 x64)
==============================================================================
#!/usr/bin/env ruby
# encoding: utf-8

require 'win32ole'

class Member
  def full_path xls_name
    File.expand_path(xls_name.encode('gb18030')).encode('utf-8').gsub('/', "\\")
  end

  def book excel, txt_name, xls_name
    workbook = excel.Workbooks.Add
    begin
      worksheet = workbook.worksheets(1)
      worksheet.Name = '成表'
      worksheet.Rows.RowHeight = 20
      worksheet.Range("A2").select
      begin
        excel.ActiveWindow.FreezePanes = true
      rescue
      end
      worksheet.Cells.Font.Size = 9
      widths = [3, 3, 3, 5.63, 7.00, 3.75, 9, 3.75, 3.75, 5.63, 3.75, 3.75, 3.75, 3.75]
      titles = %w{ 号 CXO 上点 昵称 性 手机号 区 街道 社区 数 本  金}
      worksheet.Range("G:G").NumberFormat = '@'
      ('A'..'N').each_with_index do |column, index|
        worksheet.Range("#{column}1").ColumnWidth = widths[index]
        worksheet.Range("#{column}1").Value = titles[index]
      end
      line = 1
      File.open(txt_name, 'r:gb18030') do |fil|
       fil.each_line do |row|
          line += 1
          columns = row.chomp.split("\t")
          ('A'..'N').each_with_index do |column, index|
            worksheet.Range("#{column}#{line}").Value = columns[index]
          end
       end
      end
      worksheet.Range("A1:N#{line}").HorizontalAlignment = 1
      worksheet.Range("A1:N#{line}").VerticalAlignment = 2     # (1~5)
      worksheet.Range("A1:N#{line}").Borders.Weight = 2
      worksheet.Range("A1:N#{line}").Borders.ColorIndex = 1
      worksheet.Range("A1:N#{line}").Borders.LineStyle = 1     # (1~13)
      worksheet.Range("A1:N1").Interior.ColorIndex = 39
      worksheet.Range("A2:N#{line}").Interior.ColorIndex = 2
      workbook.saveas(full_path(xls_name))
    ensure
      workbook.close
    end
  end

  def main txt_name, xls_name
    WIN32OLE.codepage = WIN32OLE::CP_UTF8
    excel = WIN32OLE::new('ket.Application')   # http://bbs.wps.cn/thread-22427901-1-1.html
    begin
      # excel.AskToUpdateLinks WPS不
      excel.Visible = excel.DisplayAlerts = excel.ScreenUpdating = false
      excel.SheetsInNewWorkbook = 1
      File.delete(xls_name) if File.exist?(xls_name)
      book excel, txt_name, xls_name
    ensure
      excel.Quit
    end
  end
end

if $0 == __FILE__
  Dir.chdir 'C:/K/Hike'
  Member.new.main('simple.txt', 'simple.xls')
end


---Files--------------------------------
genexcel.rb (2.31 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>