tmtms.hatenablog.com ã¨ããè¨äºãæ¸ãã¾ããããä»åã¯Rubyã§ZIPãã¡ã¤ã«ãä½ãæã®è©±ãã Rubyã§ZIPãã¡ã¤ã«ãä½ãã«ã¯ãrubyzip ã¨ããã©ã¤ãã©ãªã使ãã¾ãã % gem install rubyzip 次ã®ããã«ãã¦ZIPã«ãã¡ã¤ã«ã追å ã§ãã¾ãã require 'zip' Zip::File.open('hoge.zip', Zip::File::CREATE) do |zip| zip.add('ããã¯ã«ã»ã¸ã¨.txt', '/path/to/ããã¯ã«ã»ã¸ã¨.txt') end Zip::File#add ã®ç¬¬ä¸å¼æ°ã¯ZIPå ã«è¨é²ããããã¡ã¤ã«åã第äºå¼æ°ã¯å®éã®ãã¡ã¤ã«ã®ãã¹ã§ãããã®äºã¤ã®ãã¡ã¤ã«åã¯åãã§ããå¿ è¦ã¯ããã¾ããã ãã ãããã®å ´åã¯UTF-8ãã©ã°ãã»ããããã¾ãããã¤ã¾ãWindowsã®æ¨æºæ©è½ã§éãã¨æååããã¦ãã¾ã
{{#tags}}- {{label}}
{{/tags}}