raykit 0.0.459 → 0.0.461

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/raykit/zip.rb +9 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 196a78b5f6d6888a6558835adc1fce6cba8440777d4a5a53246dcde6b0877042
4
- data.tar.gz: adb0cbaccc38c715cf987d1f00de1f14c419a46a7863b424a1acd2f8da5f9839
3
+ metadata.gz: 1955e4631d8d6b8f74ef9209960e15eeb1c5a0f65298580770baa6c194e0f81a
4
+ data.tar.gz: 249f71291c48f3834d054b22a66fb871d0e1924fd5ef0c4eb281b6551f88c8a4
5
5
  SHA512:
6
- metadata.gz: 1015a2e2be7dc81b8c923b88ae9a04ad507a51d5fc89cd2bf3cd8fd5029408563da8c28a93f5a69bd747861118ba11af8eff370c284f055e5dd7bdeb6441a948
7
- data.tar.gz: 6eeccf4bb3b966d3f31d292e7dc03d968845e7332f3eed06144edece4fa8e126a57a198d7ecd56c4a95ee071bf5481eaf56964db6578a858f058d6690840bcec
6
+ metadata.gz: e21696dee8ea2de879beebfea8475fdedd5d99e1570db42675ec62aa7ff54b5fea97b21beac9a0d957751008ac043e494a71ebbd194b1e13a777f01844fd8fdb
7
+ data.tar.gz: c8d5afb9649b215bf897ab4c5f2ee7705ee997e013e9bc76482fd81116e0cd5ebc07f254ff0b5667b3d9e6e668b47eb5803442ed092779199d053f0244dab0fd
data/lib/raykit/zip.rb CHANGED
@@ -60,5 +60,14 @@ module Raykit
60
60
  puts " added " << count.to_s << " files to " << @filename
61
61
  }
62
62
  end
63
+
64
+ def self.zip_directory(directory, zipfile_name, overwrite = true)
65
+ File.delete(zipfile_name) if File.exist?(zipfile_name) && overwrite
66
+ ::Zip::File.open(zipfile_name, ::Zip::File::CREATE) do |zipfile|
67
+ Dir[File.join(directory, "**", "**")].each do |file|
68
+ zipfile.add(file.sub(directory + "/", ""), file)
69
+ end
70
+ end
71
+ end
63
72
  end
64
73
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.459
4
+ version: 0.0.461
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-09 00:00:00.000000000 Z
11
+ date: 2023-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler