lumberjack_aziz_light 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ae9171da4a378479133de30af3e891550667e9a
4
- data.tar.gz: aa5e35929402d35ecff363c776c8ff2fc1620ab9
3
+ metadata.gz: 8c13f582284b6e863efb7cb121e413c1aa064da6
4
+ data.tar.gz: d3d424b0f33b547dd28362374dc6befde889682c
5
5
  SHA512:
6
- metadata.gz: c92d8d0fb6d685146e00c3bffa0f44abffd7d7834d155409fb82a13645dac65f32d3507d7e71c5a18cced4b4ea3a9b41be17f4f0a0de2c098a6dd00b032c9807
7
- data.tar.gz: 65d396ab9d6e02007c0976ed95fc5c942112f7d40dd635a2fcb9bc2b988ff918b4ed8981307db214630ee4b2f2584c280bd6dfb8f9f99e6e6f0d4ad8adac1c5f
6
+ metadata.gz: 29e68560a8743a2b915fa7820b24c92a505ccbaf9666dbaebde01501e753b10ead2b3f6d347ae17ea5e8d814316611e5db093dab9c2c04f28c2e41b542de9c4e
7
+ data.tar.gz: 8235405c7cbfb5b0a112d3a4c055f9e0a20184d55dad9d12ff41f278711e685569a97899b818acf4f996173f9773a645c479cc5296365754c14a03ae4f15afed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.5
1
+ 1.0.6
@@ -12,6 +12,7 @@ module Lumberjack
12
12
  # with the <tt>:roll</tt> option which may contain a value of <tt>:daily</tt>, <tt>:weekly</tt>,
13
13
  # or <tt>:monthly</tt>.
14
14
  def initialize(path, options = {})
15
+ @manual = options[:manual]
15
16
  @file_date = Date.today
16
17
  if options[:roll] && options[:roll].to_s.match(/(daily)|(weekly)|(monthly)/i)
17
18
  @roll_period = $~[0].downcase.to_sym
@@ -34,17 +35,21 @@ module Lumberjack
34
35
  end
35
36
 
36
37
  def roll_file?
37
- date = Date.today
38
- if date.year > @file_date.year
39
- true
40
- elsif @roll_period == :daily && date.yday > @file_date.yday
41
- true
42
- elsif @roll_period == :weekly && date.cweek > @file_date.cweek
43
- true
44
- elsif @roll_period == :monthly && date.month > @file_date.month
38
+ if @manual
45
39
  true
46
40
  else
47
- false
41
+ date = Date.today
42
+ if date.year > @file_date.year
43
+ true
44
+ elsif @roll_period == :daily && date.yday > @file_date.yday
45
+ true
46
+ elsif @roll_period == :weekly && date.cweek > @file_date.cweek
47
+ true
48
+ elsif @roll_period == :monthly && date.month > @file_date.month
49
+ true
50
+ else
51
+ false
52
+ end
48
53
  end
49
54
  end
50
55
 
@@ -10,6 +10,7 @@ module Lumberjack
10
10
  # Create an new log device to the specified file. The maximum size of the log file is specified with
11
11
  # the <tt>:max_size</tt> option. The unit can also be specified: "32K", "100M", "2G" are all valid.
12
12
  def initialize(path, options = {})
13
+ @manual = options[:manual]
13
14
  @max_size = options[:max_size]
14
15
  if @max_size.is_a?(String)
15
16
  if @max_size.match(/^(\d+(\.\d+)?)([KMG])?$/i)
@@ -37,7 +38,7 @@ module Lumberjack
37
38
  end
38
39
 
39
40
  def roll_file?
40
- stream.stat.size > @max_size
41
+ @manual || stream.stat.size > @max_size
41
42
  rescue SystemCallError => e
42
43
  false
43
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lumberjack_aziz_light
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand