symphony-metronome 0.2.1 → 0.3.0

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.
metadata CHANGED
@@ -1,95 +1,169 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symphony-metronome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
- - Mahlon E. Smith <mahlon@martini.nu>
7
+ - Mahlon E. Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDbDCCAlSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQ8wDQYDVQQDDAZtYWhs
14
- b24xFzAVBgoJkiaJk/IsZAEZFgdtYXJ0aW5pMRIwEAYKCZImiZPyLGQBGRYCbnUw
15
- HhcNMTUwMzI3MjIwNzQ0WhcNMTYwMzI2MjIwNzQ0WjA+MQ8wDQYDVQQDDAZtYWhs
16
- b24xFzAVBgoJkiaJk/IsZAEZFgdtYXJ0aW5pMRIwEAYKCZImiZPyLGQBGRYCbnUw
17
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDpXGN0YbMVpYv4EoiCxpQw
18
- sxKdyhlkvpvENUkpEhbpnEuMKXgUfRHO4T/vBZf0h8eYgwnrHCRhAeIqesFKfoj9
19
- mpEJk5JUuADOAz18aT+v24UqAtJdiwBJLuqhslSNB6CFXZv3OOMny9bjoJegz0hI
20
- Fht9ppCuNmxJNd+L3zAX8lD01RUWNRC+8L5QLCjViJtjFDDCFfh9NCirs+XnTCzo
21
- AJgFbsZIzFJtSiXUtFgscKr4Ik8ruhRbPbYbmx9rf6W74aTMPxggq/d3gj0Eh32y
22
- WsXsQ5giVnmkbsRkBNu3QyZ8Xr5+7mvy5AWyqXKOrcW7lnYaob6Z9x/MGXGNeD6j
23
- AgMBAAGjdTBzMAkGA1UdEwQCM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03-21 00:00:00.000000000 Z
34
38
  dependencies:
35
39
  - !ruby/object:Gem::Dependency
36
- name: symphony
40
+ name: sequel
37
41
  requirement: !ruby/object:Gem::Requirement
38
42
  requirements:
39
43
  - - "~>"
40
44
  - !ruby/object:Gem::Version
41
- version: '0.9'
45
+ version: '5.66'
42
46
  type: :runtime
43
47
  prerelease: false
44
48
  version_requirements: !ruby/object:Gem::Requirement
45
49
  requirements:
46
50
  - - "~>"
47
51
  - !ruby/object:Gem::Version
48
- version: '0.9'
52
+ version: '5.66'
49
53
  - !ruby/object:Gem::Dependency
50
- name: sequel
54
+ name: sorted_set
51
55
  requirement: !ruby/object:Gem::Requirement
52
56
  requirements:
53
57
  - - "~>"
54
58
  - !ruby/object:Gem::Version
55
- version: '4'
59
+ version: '1.0'
56
60
  type: :runtime
57
61
  prerelease: false
58
62
  version_requirements: !ruby/object:Gem::Requirement
59
63
  requirements:
60
64
  - - "~>"
61
65
  - !ruby/object:Gem::Version
62
- version: '4'
66
+ version: '1.0'
63
67
  - !ruby/object:Gem::Dependency
64
68
  name: sqlite3
65
69
  requirement: !ruby/object:Gem::Requirement
66
70
  requirements:
67
71
  - - "~>"
68
72
  - !ruby/object:Gem::Version
69
- version: '1.3'
73
+ version: '1.6'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '1.6'
81
+ - !ruby/object:Gem::Dependency
82
+ name: symphony
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '0.14'
88
+ type: :runtime
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '0.14'
95
+ - !ruby/object:Gem::Dependency
96
+ name: yajl-ruby
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '1.4'
70
102
  type: :runtime
71
103
  prerelease: false
72
104
  version_requirements: !ruby/object:Gem::Requirement
73
105
  requirements:
74
106
  - - "~>"
75
107
  - !ruby/object:Gem::Version
76
- version: '1.3'
108
+ version: '1.4'
109
+ - !ruby/object:Gem::Dependency
110
+ name: rake-deveiate
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '0.22'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '0.22'
77
123
  - !ruby/object:Gem::Dependency
78
124
  name: rspec
79
125
  requirement: !ruby/object:Gem::Requirement
80
126
  requirements:
81
127
  - - "~>"
82
128
  - !ruby/object:Gem::Version
83
- version: '3.3'
129
+ version: '3.12'
84
130
  type: :development
85
131
  prerelease: false
86
132
  version_requirements: !ruby/object:Gem::Requirement
87
133
  requirements:
88
134
  - - "~>"
89
135
  - !ruby/object:Gem::Version
90
- version: '3.3'
136
+ version: '3.12'
137
+ - !ruby/object:Gem::Dependency
138
+ name: rdoc-generator-sixfish
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '0.3'
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: '0.3'
91
151
  - !ruby/object:Gem::Dependency
92
152
  name: simplecov
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '0.22'
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: '0.22'
165
+ - !ruby/object:Gem::Dependency
166
+ name: timecop
93
167
  requirement: !ruby/object:Gem::Requirement
94
168
  requirements:
95
169
  - - "~>"
@@ -103,45 +177,49 @@ dependencies:
103
177
  - !ruby/object:Gem::Version
104
178
  version: '0.9'
105
179
  - !ruby/object:Gem::Dependency
106
- name: timecop
180
+ name: pry
107
181
  requirement: !ruby/object:Gem::Requirement
108
182
  requirements:
109
183
  - - "~>"
110
184
  - !ruby/object:Gem::Version
111
- version: '0.7'
185
+ version: '0.14'
112
186
  type: :development
113
187
  prerelease: false
114
188
  version_requirements: !ruby/object:Gem::Requirement
115
189
  requirements:
116
190
  - - "~>"
117
191
  - !ruby/object:Gem::Version
118
- version: '0.7'
119
- description: "\t\tMetronome is a scheduler and task runner. It can be used locally
120
- as a\n\t\tcron replacement, or as a network-wide job executor. Events are stored\n\t\tvia
121
- simple database rows, and optionally managed via AMQP events.\n\t\tInterval/time
122
- values are expressed with reasonably intuitive English\n\t\tphrases, ie.: 'at 2pm',
123
- or 'Starting in 20 minutes, run every 10 seconds\n\t\tand then finish in 2 days'.\n"
124
- email: mahlon@martini.nu
125
- executables:
126
- - metronome-exp
192
+ version: '0.14'
193
+ description: |
194
+ Metronome is a scheduler and task runner. It can be used locally as a
195
+ cron replacement, or as a network-wide job executor. Events are stored
196
+ via simple database rows, and optionally managed via AMQP events.
197
+ Interval/time values are expressed with reasonably intuitive English
198
+ phrases, ie.: 'at 2pm', or 'Starting in 20 minutes, run every 10 seconds
199
+ and then finish in 2 days'.
200
+ email:
201
+ - mahlon@martini.nu
202
+ executables: []
127
203
  extensions: []
128
204
  extra_rdoc_files: []
129
205
  files:
130
- - README.rdoc
131
- - bin/metronome-exp
206
+ - History.md
207
+ - README.md
132
208
  - data/symphony-metronome/migrations/20140419_initial.rb
133
209
  - data/symphony-metronome/migrations/20141028_lastrun.rb
134
210
  - lib/symphony/metronome.rb
135
211
  - lib/symphony/metronome/intervalexpression.rb
136
- - lib/symphony/metronome/intervalexpression.rl
137
212
  - lib/symphony/metronome/mixins.rb
138
213
  - lib/symphony/metronome/scheduledevent.rb
139
214
  - lib/symphony/metronome/scheduler.rb
140
215
  - lib/symphony/tasks/scheduletask.rb
141
- homepage: http://projects.martini.nu/ruby-modules
216
+ homepage: https://code.martini.nu/fossil/symphony-metronome
142
217
  licenses:
143
- - BSD
144
- metadata: {}
218
+ - BSD-3-Clause
219
+ metadata:
220
+ homepage_uri: https://code.martini.nu/fossil/symphony-metronome
221
+ documentation_uri: https://martini.nu/docs/symphony-metronome
222
+ changelog_uri: https://martini.nu/docs/symphony-metronome/History_md.html
145
223
  post_install_message:
146
224
  rdoc_options: []
147
225
  require_paths:
@@ -150,16 +228,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
228
  requirements:
151
229
  - - ">="
152
230
  - !ruby/object:Gem::Version
153
- version: 2.0.0
231
+ version: '0'
154
232
  required_rubygems_version: !ruby/object:Gem::Requirement
155
233
  requirements:
156
234
  - - ">="
157
235
  - !ruby/object:Gem::Version
158
- version: 2.0.3
236
+ version: '0'
159
237
  requirements: []
160
- rubyforge_project:
161
- rubygems_version: 2.2.2
238
+ rubygems_version: 3.4.1
162
239
  signing_key:
163
240
  specification_version: 4
164
- summary: A natural language scheduling and task runner.
241
+ summary: A natural language scheduling and task runner for Symphony.
165
242
  test_files: []
metadata.gz.sig CHANGED
Binary file
data/README.rdoc DELETED
@@ -1,207 +0,0 @@
1
-
2
- = metronome
3
-
4
- == Description
5
-
6
- Metronome is an interval scheduler and task runner. It can be used
7
- locally as a cron replacement, or as a network-wide job executor.
8
-
9
- Events are stored via simple database rows, and optionally managed
10
- via AMQP events. Interval/time values are expressed with intuitive
11
- English phrases, ie.: 'at 2pm', or 'Starting in 20 minutes, run every 10
12
- seconds and then finish in 2 days', or 'execute 12 times during the next
13
- minute'.
14
-
15
- It includes an executable under bin/:
16
-
17
- metronome-exp::
18
- A simple tester for trying out interval expression parsing.
19
-
20
-
21
- == Synopsis
22
-
23
- Here's an example of a cron clone:
24
-
25
- require 'symphony/metronome'
26
-
27
- Symphony.load_config
28
-
29
- Symphony::Metronome.run do |opts, id|
30
- Thread.new do
31
- pid = fork { exec opts.delete('command') }
32
- Process.waitpid( pid )
33
- end
34
- end
35
-
36
-
37
- And here's a simplistic AMQP message broadcaster, using existing
38
- Symphony connection information:
39
-
40
- require 'symphony/metronome'
41
-
42
- Symphony.load_config
43
-
44
- Symphony::Metronome.run do |opts, id|
45
- key = opts.delete( :routing_key ) or next
46
- exchange = Symphony::Queue.amqp_exchange
47
- exchange.publish( 'hi from Metronome!', routing_key: key )
48
- end
49
-
50
-
51
- == Adding Actions
52
-
53
- There are two primary components to Metronome -- getting schedules into
54
- its database, and performing some task with those actions when the time
55
- is appropriate.
56
-
57
- By default, Metronome will start up an AMQP listener, attached to your
58
- Symphony exchange, and wait for new scheduling messages. There are two
59
- events it will take action on:
60
-
61
- metronome.create::
62
- Create a new scheduled event. The payload should be a hash. An
63
- 'expression' key is required, that provides the interval description.
64
- Anything additional is serialized to 'options', that are passed to the
65
- block when the interval fires. You can populate it with anything
66
- your task requires to execute.
67
-
68
- metronome.delete::
69
- The payload is the row ID of the action. Metronome removes it from
70
- the database.
71
-
72
-
73
- If you'd prefer not to use the AMQP listener, you can put actions into
74
- Metronome using any database methodology you please. When the daemon
75
- starts up or receives a HUP signal, it will re-read and schedule out
76
- upcoming work.
77
-
78
-
79
- == Performing Work
80
-
81
- Calling 'run' on the Metronome class is a blocking call, waking up upon
82
- a scheduled event. The run method expects a ruby block, and it receives
83
- the payload and the database ID of the scheduled event. Metronome is
84
- unopinioned, what you do within this block is entirely up to you. See
85
- the Synopsis section above for some examples.
86
-
87
-
88
- == Options
89
-
90
- Metronome uses
91
- Configurability[https://rubygems.org/gems/configurability] to determine
92
- behavior. The configuration is a YAML[http://www.yaml.org/] file. It
93
- shares AMQP configuration with Symphony, and adds metronome specific
94
- controls in the 'metronome' key.
95
-
96
- metronome:
97
- splay: 0
98
- listen: true
99
- db: sqlite:///tmp/metronome.db
100
-
101
-
102
- === splay
103
-
104
- Randomize all start times for actions by this many seconds on either
105
- side of the original execution time. Defaults to none.
106
-
107
- === listen
108
-
109
- Start up an AMQP listener using Symphony configuration, for remote
110
- administration of schedule events. Defaults to true.
111
-
112
- === db
113
-
114
- A {Sequel}[https://rubygems.org/gems/sequel] connection URI. Currently,
115
- Metronome is tested under SQLite and PostgreSQL. Defaults to a SQLite
116
- file at /tmp/metronome.db.
117
-
118
-
119
- == Scheduling Examples
120
-
121
- Note that Metronome is designed as an interval scheduler, not a
122
- calendaring app. It doesn't have any concepts around phrases like "next
123
- tuesday", or "the 3rd sunday after christmas". If that's what you're
124
- after, check out the {chronic}[http://rubygems.org/gems/chronic]
125
- library instead.
126
-
127
- Here are a small set of example expressions. Feel free to use the
128
- +metronome-exp+ utility to get a feel for what Metronome anticipates.
129
-
130
- in 30.5 minutes
131
- once an hour
132
- every 15 minutes for 2 days
133
- at 2014-05-01
134
- at 2014-04-01 14:00:25
135
- at 2pm
136
- starting at 2pm once a day
137
- start in 1 hour from now run every 5 seconds end at 11:15pm
138
- every other hour
139
- run every 7th minute for a day
140
- once a day ending in 1 week
141
- run once a minute for an hour starting in 6 days
142
- 10 times a minute for 2 days
143
- run 45 times every hour
144
- 30 times per day
145
- start at 2010-01-02 run 12 times and end on 2010-01-03
146
- starting in an hour from now run 6 times a minute for 2 hours
147
- beginning a day from now, run 30 times per minute and finish in 2 weeks
148
- execute 12 times during the next 2 minutes
149
- once a minute beginning in 5 minutes
150
-
151
- In general, you can use reasonably intuitive phrasings. Capitalization,
152
- whitespace, and punctuation doesn't matter. When describing numbers,
153
- use digit/integer form instead of words, ie: '1 hour' instead of 'one
154
- hour'.
155
-
156
-
157
- == Installation
158
-
159
- gem install symphony-metronome
160
-
161
-
162
- == Contributing
163
-
164
- You can check out the current development source with Mercurial via its
165
- {project page}[http://bitbucket.org/mahlon/symphony-metronome].
166
-
167
- After checking out the source, run:
168
-
169
- $ rake
170
-
171
- This task will run the tests/specs and generate the API documentation.
172
-
173
- If you use {rvm}[http://rvm.io/], entering the project directory will
174
- install any required development dependencies.
175
-
176
-
177
- == License
178
-
179
- Copyright (c) 2015, Mahlon E. Smith
180
- All rights reserved.
181
-
182
- Redistribution and use in source and binary forms, with or without
183
- modification, are permitted provided that the following conditions are met:
184
-
185
- * Redistributions of source code must retain the above copyright notice,
186
- this list of conditions and the following disclaimer.
187
-
188
- * Redistributions in binary form must reproduce the above copyright notice,
189
- this list of conditions and the following disclaimer in the documentation
190
- and/or other materials provided with the distribution.
191
-
192
- * Neither the name of the author/s, nor the names of the project's
193
- contributors may be used to endorse or promote products derived from this
194
- software without specific prior written permission.
195
-
196
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
197
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
198
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
199
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
200
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
201
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
202
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
203
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
204
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
205
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
206
-
207
-
data/bin/metronome-exp DELETED
@@ -1,33 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # vim: set nosta noet ts=4 sw=4:
3
- #
4
- # Simplistic interval expression tester.
5
- #
6
-
7
- require 'symphony/metronome'
8
-
9
- loop do
10
- begin
11
- exp = gets.chomp
12
- next if exp.empty?
13
-
14
- begin
15
- parsed = Symphony::Metronome::IntervalExpression.parse( exp )
16
- puts "OK:"
17
- puts "\tvalid | %s" % [ parsed.valid ]
18
- puts "\trecurring | %s" % [ parsed.recurring ]
19
- puts "\tstarting | %s" % [ parsed.starting ]
20
- puts "\tinterval | %s" % [ parsed.recurring ? parsed.interval : '-' ]
21
- puts "\tending | %s" %
22
- [ parsed.ending ? parsed.ending : (parsed.recurring ? 'never' : '-') ]
23
-
24
- rescue => err
25
- puts "NOPE: (%s) %s" % [ exp, err.message ]
26
- end
27
-
28
- puts
29
-
30
- rescue Interrupt
31
- exit 0
32
- end
33
- end