Commit the pile of initial work. Largely taken from company internal
repos, allowed to be newly released. Portions already in production, coverage still needs to be boosted. Enjoy. FossilOrigin-Name: 0f17fa483f55467bdf9e8f99dace58e6a90f5a8a7e595bdd79dfda5c92d16b7f
This commit is contained in:
commit
b18647f6a5
23 changed files with 2639 additions and 0 deletions
33
bin/metronome-exp
Executable file
33
bin/metronome-exp
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env ruby
|
||||
# vim: set nosta noet ts=4 sw=4:
|
||||
#
|
||||
# Simplistic interval expression tester.
|
||||
#
|
||||
|
||||
require 'symphony/metronome'
|
||||
|
||||
loop do
|
||||
begin
|
||||
exp = gets.chomp
|
||||
next if exp.empty?
|
||||
|
||||
begin
|
||||
parsed = Symphony::Metronome::IntervalExpression.parse( exp )
|
||||
puts "OK:"
|
||||
puts "\tvalid | %s" % [ parsed.valid ]
|
||||
puts "\trecurring | %s" % [ parsed.recurring ]
|
||||
puts "\tstarting | %s" % [ parsed.starting ]
|
||||
puts "\tinterval | %s" % [ parsed.recurring ? parsed.interval : '-' ]
|
||||
puts "\tending | %s" %
|
||||
[ parsed.ending ? parsed.ending : (parsed.recurring ? 'never' : '-') ]
|
||||
|
||||
rescue => err
|
||||
puts "NOPE: (%s) %s" % [ exp, err.message ]
|
||||
end
|
||||
|
||||
puts
|
||||
|
||||
rescue Interrupt
|
||||
exit 0
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue