log_sweeper 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 111f56f44bfe6d6b15ef828eafe2f228d5aec83b065fbf51ce52c0ba1c4cc8cd
4
- data.tar.gz: 2c1185b851704143399ba64dfc1135d1b109a253da02a2240e27079c8e3f30b5
3
+ metadata.gz: b8d4b1926425ea81b8acfefc600980a8c87f345566762144e7c6be3b864b7f06
4
+ data.tar.gz: 5d8050f8459929b534c48a343d39e1941f3dc4b9b5eb5d28419a1c202a402bb8
5
5
  SHA512:
6
- metadata.gz: c72400ca94cab881f05ab9cde7d4618f3de6b78af8a9fbb6fbdc3fb6b45b5aaa5bfcb9fa1ec99a9c7a41a4076d9b82679903af4abefd92a5d82aa1a93c97b6ce
7
- data.tar.gz: 6b3b28fface8383930cfba5063ae3c02036236e947cd0ed3fc560ea97db7dc054f8bb35b3f7faba8edfc8e93ba2b1e24c882a7253e5cabb7f7379d0329984bbc
6
+ metadata.gz: b1885a07e020793c0272c4ea1ac7051e9cbd4c4f3f299f933fadda6501ce4fe655322b6263a3b5ebda530aace05187fd7aeb531487d9e7603419ce15d44aeac3
7
+ data.tar.gz: 2bda9c408fdc55fe9a9f797afd58334e7f7e126427fb03986793c48306561b402be0ee2853af3992ee3cf8f774da6b0de2325c13f5dfdcda4406cc35760d4a65
data/README.md CHANGED
@@ -25,7 +25,7 @@ The best way to use this module is to run it via cron, for example you can use [
25
25
 
26
26
  ```ruby
27
27
  every 1.hour do
28
- runner "LogRotator.run(Rails.root.join('log'))"
28
+ runner "LogSweeper.run('log')"
29
29
  end
30
30
  ```
31
31
 
@@ -42,7 +42,12 @@ module LogSweeper
42
42
  zipped = "#{file_name}.gz"
43
43
 
44
44
  Zlib::GzipWriter.open(zipped) do |gz|
45
- gz.write IO.binread(file_name)
45
+ File.open(file_name) do |file|
46
+ loop do
47
+ chunk = file.read(16 * 1024) or break
48
+ gz.write(chunk)
49
+ end
50
+ end
46
51
  end
47
52
  end
48
53
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogSweeper
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_sweeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Smirnov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-03 00:00:00.000000000 Z
11
+ date: 2019-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.0.1
134
+ rubygems_version: 3.0.2
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: A simple module for cleaning up log directories.