bixby-common 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bixby-common.gemspec +3 -3
- data/lib/bixby-common/util/log/logger.rb +32 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87d3070441db547be5189c4ce392baafe2c83937
|
4
|
+
data.tar.gz: 9dd0b345793a65a756acf37601c2840c3e787ec1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f5201dce873bb430e8d31fe8d3a596b4b1191cb11c53bfe34c8dea66743dd76cd4597a0bd170179ad624d30b6ac2cdbc5fed472d9e32aca71d5f33e93d6ccbd
|
7
|
+
data.tar.gz: bfefd1e37777a206221e779158c7a5bfb7b29d235fa3173ef6bf8e8d2b18db97fb73e1ed708854ac20f6db3d2e053627eacb6b047fb17a6fc086d1512a7641c9
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.6
|
data/bixby-common.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: bixby-common 0.6.
|
5
|
+
# stub: bixby-common 0.6.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bixby-common"
|
9
|
-
s.version = "0.6.
|
9
|
+
s.version = "0.6.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Chetan Sarva"]
|
14
|
-
s.date = "2015-06-
|
14
|
+
s.date = "2015-06-18"
|
15
15
|
s.description = "Bixby Common files/libs"
|
16
16
|
s.email = "chetan@pixelcop.net"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -21,5 +21,37 @@ module Logging
|
|
21
21
|
|
22
22
|
# :nocov:
|
23
23
|
end
|
24
|
+
|
25
|
+
module Appenders
|
26
|
+
class RollingFile < ::Logging::Appenders::IO
|
27
|
+
|
28
|
+
# Simple patch to DateRoller which uses the previous day's date for the rolled filename
|
29
|
+
#
|
30
|
+
# oneliner to fix incorrect dates from previously rolled files:
|
31
|
+
# ruby -rtime -e '`ls *.2*.log`.split("\n").each{ |f| f =~ /(2015\d+)/; d = $1; dd = (Time.parse(d)-86400).strftime("%Y%m%d"); File.rename(f, f.gsub(/#{d}/, dd)) }'
|
32
|
+
class DateRoller
|
33
|
+
|
34
|
+
def roll_files
|
35
|
+
return unless @roll and ::File.exist?(@fn_copy)
|
36
|
+
|
37
|
+
# rename the copied log file
|
38
|
+
::File.rename(@fn_copy, (Time.now-86400).strftime(@logname_fmt))
|
39
|
+
|
40
|
+
# prune old log files
|
41
|
+
if @keep
|
42
|
+
files = Dir.glob(@glob).find_all {|fn| @rgxp =~ fn}
|
43
|
+
length = files.length
|
44
|
+
if length > @keep
|
45
|
+
files.sort {|a,b| b <=> a}.last(length-@keep).each {|fn| ::File.delete fn}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
ensure
|
50
|
+
@roll = false
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
24
56
|
end
|
25
57
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bixby-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chetan Sarva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bixby-auth
|