dynarex_cron 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4bc6248c6383a0e442b18f9a9dab91e8c9e01001
4
+ data.tar.gz: 04abe4552fef512ef4258144067bd1d9f29f717b
5
+ SHA512:
6
+ metadata.gz: 58b9e52e7ca6f5696bd25f88d4bd02d127725fd8073bb280045b998758e10ba53ca629162911238506f8404d0802a3686933baf9e8c6afaa9827a07a41e36622
7
+ data.tar.gz: e3aff16a3a6c920066d2c9e7aaf83962865d146aefc900ce41cfc70adc173a331d3f45a23bc0130ee1bfc2a7c797d7d1d3af2472719a1e90a4ec4715a85d9ecb
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
@@ -0,0 +1 @@
1
+ R��Vi ���W�eV�ӎ5S�50Ϫ[p�=�ا��!�\�yI�8
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: dynarex_cron.rb
4
+
5
+ require 'run_every'
6
+ require 'dynarex'
7
+ require 'chronic_cron'
8
+
9
+ TF = "%Y-%m-%d %H:%M"
10
+
11
+ class DynarexCron
12
+
13
+ def initialize(dynarex_file)
14
+ @dynarex = Dynarex.new dynarex_file
15
+ @dynarex.to_h.each {|h| h[:cron] = ChronicCron.new(h[:expression]) }
16
+ end
17
+
18
+ def start
19
+
20
+ RunEvery.new.minute do
21
+ @dynarex.to_h.each do |h|
22
+ if h[:cron].to_time.strftime(TF) == Time.now.strftime(TF) then
23
+ run(h[:job])
24
+ h[:cron].next
25
+ end
26
+ end
27
+ end
28
+
29
+ end
30
+
31
+ private
32
+
33
+ def run(job)
34
+ puts eval job
35
+ end
36
+
37
+ end
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dynarex_cron
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
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Wi4XyX+wHvAn0cO7VAiTytnOi+Bq9s+bruJyI
28
+ A8N3FzDjxegv6ZZ2NORdbx6wsps5SFnkTTfWy4dZJOAPkNRhLRbAz+itQxIYDs1N
29
+ rk6MsD+E5knixQJt9sDmiZXYSATnedTTqZZUk/5bldmc0EaroNto6bbJtJkREzEs
30
+ jDUHPta+VDE8L5m+7zH/Leu5dfmim/nFNQNNkDVqChq7nCf9UyRNmP5r5bQvePSb
31
+ y6cNz+NnybgoQfG28NcwV1e/31NTJk5VqdKHKnTfPcp/y35T9YoElNn5cSs93qc5
32
+ U5VVkvsVQudaZw==
33
+ -----END CERTIFICATE-----
34
+ date: 2013-07-08 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: dynarex
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ - !ruby/object:Gem::Dependency
51
+ name: run_every
52
+ requirement: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ - !ruby/object:Gem::Dependency
65
+ name: chronic_cron
66
+ requirement: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description:
79
+ email:
80
+ executables: []
81
+ extensions: []
82
+ extra_rdoc_files: []
83
+ files:
84
+ - lib/dynarex_cron.rb
85
+ homepage:
86
+ licenses: []
87
+ metadata: {}
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 2.0.0.rc.2
105
+ signing_key:
106
+ specification_version: 4
107
+ summary: dynarex_cron
108
+ test_files: []
metadata.gz.sig ADDED
Binary file