mutx 0.1.29 → 0.1.30
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 +4 -4
- data/lib/generators/templates/cron.rb.tt +6 -2
- 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: 735365a7d3b05c47e64982183c77fc0bbfd88de3
|
4
|
+
data.tar.gz: adbf95bdd2447499666f12fc3b399e5ba6c3aebb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c5f06e12b74458928b5f2ad086208d1e7d38ea59f8ff241fff33fae2ca609147796e8354816195fd103bb2c1036eae88a00aa115cec41ba6be0e7bc119a400a
|
7
|
+
data.tar.gz: beb6ec320e4f538e37ec2cf59a3f6ddf7b35e095307be817d9dc5fb285e37328a2b4511fb621b1a7b8d1c3eb086be98d67c9eccd59766b346f805f8e5d931a24
|
@@ -19,7 +19,7 @@ module Cron
|
|
19
19
|
cron_tasks_list.select{|line| cron_tasks << line if (((Time.now.utc - line[:last_exec_time].utc) + 1) >= (line[:cron_time].to_i * 60))}
|
20
20
|
cron_tasks_list = []
|
21
21
|
cron_tasks_list = cron_tasks
|
22
|
-
puts "#{cron_tasks_list.size} cronned task on time to run"
|
22
|
+
puts "#{cron_tasks_list.size} POSSIBLE cronned task on time to run"
|
23
23
|
#END# Select only cronned tasks that last_exec_time is OK to run
|
24
24
|
|
25
25
|
#BEGIN# REMOVING POSSIBLE DUPLICATED TASKS
|
@@ -44,6 +44,8 @@ module Cron
|
|
44
44
|
# TASK must be right on time to run and unique
|
45
45
|
cron_tasks_list.each do |task|
|
46
46
|
@@now_time = Time.now.hour.to_s+":"+Time.now.min.to_s
|
47
|
+
@@now_time = ("0" + @@now_time.match(/\d*/).to_s + ":" + @@now_time.match(/\:(\d*)/)[1].to_s) if @@now_time.match(/(\d*)/)[1].size.eql? 1
|
48
|
+
@@now_time = (@@now_time.match(/\d*/).to_s + ":0" + @@now_time.match(/\:(\d*)/)[1].to_s) if @@now_time.match(/\:(\d*)/)[1].size.eql? 1
|
47
49
|
@@last_exec_time = nil
|
48
50
|
@@last_exec_time = task[:last_exec_time]
|
49
51
|
# Update last_exec_time before to run (because this task is OK to run)
|
@@ -156,11 +158,13 @@ module Cron
|
|
156
158
|
elsif (((!task[:cron_time].eql? "") && (!task[:cron_time].eql? "0")) && (((Time.now.utc - @@last_exec_time.utc) + 1) >= (task[:cron_time].to_i * 60)) && (@none_day.eql? "task_with_day") && (task[:"#{@today}"].eql? "on") && (task[:start_time].empty?) && (task[:stop_time].empty?))
|
157
159
|
execute task
|
158
160
|
# If there is a day seted, and that day is today, and execution range time is seted
|
159
|
-
elsif (((!task[:cron_time].eql? "") && (!task[:cron_time].eql? "0")) && (((Time.now.utc - @@last_exec_time.utc) + 1) >= (task[:cron_time].to_i * 60)) && (@none_day.eql? "task_with_day") && (task[:"#{@today}"].eql? "on") && (task[:start_time]) && (task[:stop_time]) )
|
161
|
+
elsif (((!task[:cron_time].eql? "") && (!task[:cron_time].eql? "0")) && (((Time.now.utc - @@last_exec_time.utc) + 1) >= (task[:cron_time].to_i * 60)) && (@none_day.eql? "task_with_day") && (task[:"#{@today}"].eql? "on") && (!task[:start_time].nil?) && (!task[:stop_time].nil?) )
|
160
162
|
if task[:start_time] > task[:stop_time] #initial time is greater than stop time
|
161
163
|
check_range_time task
|
162
164
|
elsif (@@now_time.between? task[:start_time], task[:stop_time]) #stop time is greater than initial time
|
163
165
|
execute task
|
166
|
+
else
|
167
|
+
puts "Out of date range for: #{task[:name]}"
|
164
168
|
end
|
165
169
|
end#if
|
166
170
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|