fugit 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fugit might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc33b35a4bb7439ed60f41718f593510bea10954
4
- data.tar.gz: a5a278375d35f1529567f7da6786a5541bf2dab3
3
+ metadata.gz: cf9112604503de8154a134544a4a30a8a5faee5f
4
+ data.tar.gz: 648f1f1215a0609b22afeed98849e9f2741f98d3
5
5
  SHA512:
6
- metadata.gz: 0a4e85d3a60f3126758ab3d51b9b9ac14d25896008cfed895b7fdf1fad9da6f37d9ca2ae9fa019691ceaca271d29c30308d4a4bb9593dc1fbc89a89af356a4e5
7
- data.tar.gz: 1e30b5b2e717cadd18e0596d7ebcdbcc037254a280a9fc8297cdf1d9394efeeb0943b5ba69843e419e4c7c1f9c9c13a96875c241c1e364daf8a89eba97102b8f
6
+ metadata.gz: 0e0d0983c4bf016caf168a02a666f3de7ba516073e6610133bcf5324f6ddf37f3e48e410d439a8834c65af098c642e0e9ed45e11268ab00ac880abc789c35341
7
+ data.tar.gz: b960fddc42f5ef1eabffac55a6f54b316e9eecc878d703a1a4b4248f2d3b381c18877b2896015f793dd4177a082ea6283835aa4bbf020029fc1682eb5f75da2f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # fugit CHANGELOG.md
3
3
 
4
4
 
5
+ ## fugit 1.1.3 released 2018-06-21
6
+
7
+ * Silenced Ruby warnings (Utilum in gh-4)
8
+
9
+
5
10
  ## fugit 1.1.2 released 2018-06-20
6
11
 
7
12
  * Added Fugit::Cron#seconds (Tero Marttila in gh-3)
data/CREDITS.md CHANGED
@@ -1,8 +1,10 @@
1
1
 
2
2
  # fugit credits
3
3
 
4
+ * Utilum https://github.com/utilum silenced Ruby warnings
4
5
  * Tero Marttila https://github.com/SpComb added missing Cron#seconds
5
6
  * Harry Lascelles https://github.com/hlascelles timezone reminder
7
+ * John Mettraux https://github.com/jmettraux author and maintainer
6
8
 
7
9
 
8
10
  ## rufus-scheduler credits
data/Makefile CHANGED
@@ -19,6 +19,9 @@ gemspec_validate:
19
19
  name: gemspec_validate
20
20
  @echo "$(NAME) $(VERSION)"
21
21
 
22
+ cw:
23
+ find lib -name "*.rb" -exec ruby -cw {} \;
24
+
22
25
  build: gemspec_validate
23
26
  gem build $(NAME).gemspec
24
27
  mkdir -p pkg
@@ -28,5 +31,5 @@ push: build
28
31
  gem push pkg/$(NAME)-$(VERSION).gem
29
32
 
30
33
 
31
- .PHONY: build push
34
+ .PHONY: build push cw
32
35
 
data/lib/fugit.rb CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Fugit
3
3
 
4
- VERSION = '1.1.2'
4
+ VERSION = '1.1.3'
5
5
  end
6
6
 
7
7
  require 'time'
data/lib/fugit/cron.rb CHANGED
@@ -28,7 +28,6 @@ module Fugit
28
28
 
29
29
  return s if s.is_a?(self)
30
30
 
31
- original = s
32
31
  s = SPECIALS[s] || s
33
32
 
34
33
  return nil unless s.is_a?(String)
@@ -94,8 +93,8 @@ module Fugit
94
93
  def inc_min; inc(60 - @t.sec); end
95
94
 
96
95
  def inc_sec(seconds)
97
- if s = seconds.find { |s| s > @t.sec }
98
- inc(s - @t.sec)
96
+ if sec = seconds.find { |s| s > @t.sec }
97
+ inc(sec - @t.sec)
99
98
  else
100
99
  inc(60 - @t.sec + seconds.first)
101
100
  end
@@ -123,7 +122,7 @@ module Fugit
123
122
 
124
123
  return true if @weekdays.nil?
125
124
 
126
- wd, hsh = @weekdays.find { |wd, hsh| wd == nt.wday }
125
+ wd, hsh = @weekdays.find { |d, _| d == nt.wday }
127
126
 
128
127
  return false unless wd
129
128
  return true if hsh.nil?
@@ -328,37 +327,38 @@ module Fugit
328
327
  arr.sort!
329
328
  end
330
329
 
331
- def determine_seconds(a)
332
- @seconds = (a || [ 0 ]).inject([]) { |a, r| a.concat(expand(0, 59, r)) }
330
+ def determine_seconds(arr)
331
+ @seconds = (arr || [ 0 ]).inject([]) { |a, s| a.concat(expand(0, 59, s)) }
333
332
  compact(:@seconds)
334
333
  end
335
334
 
336
- def determine_minutes(a)
337
- @minutes = a.inject([]) { |a, r| a.concat(expand(0, 59, r)) }
335
+ def determine_minutes(arr)
336
+ @minutes = arr.inject([]) { |a, m| a.concat(expand(0, 59, m)) }
338
337
  compact(:@minutes)
339
338
  end
340
339
 
341
- def determine_hours(a)
342
- @hours = a.inject([]) { |a, r| a.concat(expand(0, 23, r)) }
343
- @hours = @hours.collect { |h| h == 24 ? 0 : h }
340
+ def determine_hours(arr)
341
+ @hours = arr
342
+ .inject([]) { |a, h| a.concat(expand(0, 23, h)) }
343
+ .collect { |h| h == 24 ? 0 : h }
344
344
  compact(:@hours)
345
345
  end
346
346
 
347
- def determine_monthdays(a)
348
- @monthdays = a.inject([]) { |a, r| a.concat(expand(1, 31, r)) }
347
+ def determine_monthdays(arr)
348
+ @monthdays = arr.inject([]) { |a, d| a.concat(expand(1, 31, d)) }
349
349
  compact(:@monthdays)
350
350
  end
351
351
 
352
- def determine_months(a)
353
- @months = a.inject([]) { |a, r| a.concat(expand(1, 12, r)) }
352
+ def determine_months(arr)
353
+ @months = arr.inject([]) { |a, m| a.concat(expand(1, 12, m)) }
354
354
  compact(:@months)
355
355
  end
356
356
 
357
- def determine_weekdays(a)
357
+ def determine_weekdays(arr)
358
358
 
359
359
  @weekdays = []
360
360
 
361
- a.each do |a, z, s, h| # a to z, slash and hash
361
+ arr.each do |a, z, s, h| # a to z, slash and hash
362
362
  if h
363
363
  @weekdays << [ a, h ]
364
364
  elsif s
@@ -128,7 +128,7 @@ module Fugit
128
128
 
129
129
  def inflate
130
130
 
131
- h =
131
+ params =
132
132
  @h.inject({ sec: 0 }) { |h, (k, v)|
133
133
  a = KEYS[k]
134
134
  if a[:I]
@@ -139,7 +139,7 @@ module Fugit
139
139
  h
140
140
  }
141
141
 
142
- self.class.allocate.init(@original, {}, h)
142
+ self.class.allocate.init(@original, {}, params)
143
143
  end
144
144
 
145
145
  # Round float seconds to 9 decimals when deflating
@@ -184,9 +184,9 @@ module Fugit
184
184
 
185
185
  def opposite
186
186
 
187
- h = @h.inject({}) { |h, (k, v)| h[k] = -v; h }
187
+ params = @h.inject({}) { |h, (k, v)| h[k] = -v; h }
188
188
 
189
- self.class.allocate.init(nil, {}, h)
189
+ self.class.allocate.init(nil, {}, params)
190
190
  end
191
191
 
192
192
  alias -@ opposite
@@ -201,9 +201,9 @@ module Fugit
201
201
 
202
202
  def add_duration(d)
203
203
 
204
- h = d.h.inject(@h.dup) { |h, (k, v)| h[k] = (h[k] || 0) + v; h }
204
+ params = d.h.inject(@h.dup) { |h, (k, v)| h[k] = (h[k] || 0) + v; h }
205
205
 
206
- self.class.allocate.init(nil, {}, h)
206
+ self.class.allocate.init(nil, {}, params)
207
207
  end
208
208
 
209
209
  def add_to_time(t)
@@ -312,10 +312,10 @@ module Fugit
312
312
 
313
313
  t
314
314
  .subgather(nil)
315
- .inject({}) { |h, t|
316
- v = t.string; v = v.index('.') ? v.to_f : v.to_i
315
+ .inject({}) { |h, tt|
316
+ v = tt.string; v = v.index('.') ? v.to_f : v.to_i
317
317
  # drops ending ("y", "m", ...) by itself
318
- h[t.name] = (h[t.name] || 0) + v
318
+ h[tt.name] = (h[tt.name] || 0) + v
319
319
  h
320
320
  }
321
321
  end
data/lib/fugit/nat.rb CHANGED
@@ -49,7 +49,7 @@ module Fugit
49
49
  end
50
50
  end
51
51
  h[:min] ||= [ 0 ]
52
- h[:dow].sort_by! { |a, z| a || 0 }
52
+ h[:dow].sort_by! { |d, _| d || 0 }
53
53
 
54
54
  Fugit::Cron.allocate.send(:init, nil, h)
55
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fugit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-20 00:00:00.000000000 Z
11
+ date: 2018-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: raabro