recurrent_tasks 0.0.1 → 0.0.2
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/recurrent_tasks/base_spec.rb +11 -10
- data/lib/recurrent_tasks/version.rb +1 -1
- data/lib/recurrent_tasks.rb +1 -0
- metadata +47 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb323d00f2fe6849f20f972489da0a46988c12504041fe5a2be7eaf1acf448cd
|
4
|
+
data.tar.gz: d4508f94079d3e7e52cb10d558cfe030813c5d0e8da6df036674fa5f27a993ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f357447483ec6c36ed6a258416f0c9f5169c3f664e55c5eacf9d797810dad7644e955181340891e2f70098e34af934dee2adf5fc2411e50b637f352c823deb09
|
7
|
+
data.tar.gz: 3af23b9c9489eff0b5c944b051fea6ac78bde51ac5083e9c280c8f98522fdb7fc56dcbd63f3fdd90cd99381ef80abd1f81a83b395bacecb2d4304a944d203808
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# support parsing time frequency from the tasks
|
2
2
|
time_frequency_parser = RecurrentTasks::TimeFrequencyParser.new
|
3
3
|
|
4
|
-
task_files_directory = '
|
4
|
+
task_files_directory = 'recurrent_tasks'
|
5
5
|
task_files_paths = Dir["#{task_files_directory}/**/*"]
|
6
|
-
puts "WARNING: no tasks declared in directory '#{task_files_directory}'" if task_files_paths.empty?
|
6
|
+
puts "WARNING: no recurrent tasks declared in directory '#{task_files_directory}'" if task_files_paths.empty?
|
7
7
|
|
8
8
|
task_files_paths.each do |task_file_path|
|
9
9
|
task_file = File.open task_file_path
|
@@ -12,19 +12,20 @@ task_files_paths.each do |task_file_path|
|
|
12
12
|
title = task_file_json.fetch('title', nil)
|
13
13
|
raise "The task file '#{task_file_path}' is missing a 'title' property" unless title
|
14
14
|
|
15
|
+
puts "Declaring Recurrent Tasks: #{title}"
|
15
16
|
describe title do
|
16
|
-
|
17
|
-
raise "The task file '#{task_file_path}' is missing a '
|
17
|
+
recurrent_tasks = task_file_json.fetch('recurrent_tasks', nil)
|
18
|
+
raise "The task file '#{task_file_path}' is missing a 'recurrent_tasks' list property" unless recurrent_tasks
|
18
19
|
|
19
|
-
|
20
|
-
documentation_url =
|
20
|
+
recurrent_tasks.each_pair do |recurrent_task_name, recurrent_task_metadata|
|
21
|
+
documentation_url = recurrent_task_metadata.fetch('documentation_url', "Missing 'documentation_url' property")
|
21
22
|
|
22
|
-
it "#{
|
23
|
-
frequency_string =
|
24
|
-
raise "The task '#{
|
23
|
+
it "#{recurrent_task_name} | #{documentation_url}" do
|
24
|
+
frequency_string = recurrent_task_metadata.fetch('frequency', nil)
|
25
|
+
raise "The task '#{recurrent_task_name}' inside '#{task_file_path}' is missing a 'frequency' property" unless frequency_string
|
25
26
|
|
26
27
|
frequency = time_frequency_parser.parse_frequency frequency_string
|
27
|
-
last_checked = Time.parse
|
28
|
+
last_checked = Time.parse recurrent_task_metadata['last_checked']
|
28
29
|
|
29
30
|
expect(last_checked + frequency)
|
30
31
|
.to be > Time.now, "The last time this task was done was '#{last_checked}'" \
|
data/lib/recurrent_tasks.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurrent_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Massimiliano De Vivo
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: oj
|
@@ -37,8 +37,50 @@ dependencies:
|
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '3'
|
40
|
-
|
41
|
-
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: pry-byebug
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '3'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rake
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rubocop
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1'
|
82
|
+
description: A gem that json specs to verify that manual recurrent tasks are regularly
|
83
|
+
executed
|
42
84
|
email: maxtru2005@gmail.com
|
43
85
|
executables: []
|
44
86
|
extensions: []
|
@@ -68,5 +110,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
110
|
requirements: []
|
69
111
|
rubygems_version: 3.6.2
|
70
112
|
specification_version: 4
|
71
|
-
summary:
|
113
|
+
summary: A rspec manual recurrent tasks integration
|
72
114
|
test_files: []
|