recurrent_tasks 0.0.1 → 0.0.3

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
  SHA256:
3
- metadata.gz: e6d16e2cec9fcb506c751bf4483ec471cd44325fbcdd7719f60ed54dbd01d673
4
- data.tar.gz: b506a3615fc54f07d09369472469f3b00dcd534546117aa6f9f360d945d22d3f
3
+ metadata.gz: 4e981260e37b997c2d8e4a004a442423166b4b6e892aba3d8cbccf4a986df33c
4
+ data.tar.gz: c82ae330d69b16dc11b4ab78d128af97d71fe8bca124f56c5ff82260c0f2c414
5
5
  SHA512:
6
- metadata.gz: bee20d9ec4b5ba0e11d2b832cddce65d1bfa12ac89d39c6ec76b0d964eae4833a4f6124e0e48dbb96fa87fb8e755034e7dbb486d0bbb8769737d2f30bbfa8a65
7
- data.tar.gz: 9830ede8e79eae6dfbae50190bebe92f203911298bedd45c1c266bbc2d0df0e4b206ae046681ce583e07200a8a6dc36aac65b0aa32098bf638e1186c08d65bf9
6
+ metadata.gz: 2f20b83b2f1f4da0e9ca328abcea4b9a988019b390f432c4edd21a2b7c97de69ad417535251b058c04151a71a192a8b42ba6533115f03f67cd2c27a1afb79e0a
7
+ data.tar.gz: 94cf40800800edf84225829bb7f486c53a1f0186cc983852fc266a7f7af817ea2b29fee899c2c3ed6b8414ba427236b5ce23031f2728e5c3e6135977aa4c5d67
@@ -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 = 'tasks'
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
- describe title do
16
- tasks = task_file_json.fetch('tasks', nil)
17
- raise "The task file '#{task_file_path}' is missing a 'tasks' list property" unless tasks
15
+ puts "Declaring Recurrent Tasks: #{title}"
16
+ describe "#{title} | " do
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
- tasks.each_pair do |task_name, task_metadata|
20
- documentation_url = task_metadata.fetch('documentation_url', "Missing 'documentation_url' property")
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 "#{task_name} | #{documentation_url}" do
23
- frequency_string = task_metadata.fetch('frequency', nil)
24
- raise "The task '#{task_name}' inside '#{task_file_path}' is missing a 'frequency' property" unless frequency_string
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 task_metadata['last_checked']
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}'" \
@@ -1,3 +1,3 @@
1
1
  module RecurrentTasks
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -6,3 +6,4 @@ module RecurrentTasks
6
6
  end
7
7
 
8
8
  require_relative 'recurrent_tasks/base_spec'
9
+ require_relative 'recurrent_tasks/version'
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.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Massimiliano De Vivo
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-08 00:00:00.000000000 Z
10
+ date: 2025-02-26 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
- description: A gem that uses that fetches recurrent tasks jsons in "rspec" verify
41
- their manual regularity execution
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: Hola!
113
+ summary: A rspec manual recurrent tasks integration
72
114
  test_files: []