Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1299561
date.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 18, 11:00 PM
Size
764 B
Mime Type
text/x-ruby
Expires
Thu, Nov 20, 11:00 PM (5 h, 7 m)
Engine
blob
Format
Raw Data
Handle
292732
Attached To
rWEBDNS WebDNS (edet4)
date.rb
View Options
module
Strategies
module
Date
module_function
# Generate a new date based serial.
#
# A serial is generate based on the current date where 2 digits
# are held as a counter for changes that happen in the same date.
# We also make sure that the new serial is larger than the previous
# one.
#
# current_serial - The current zone zone serial.
#
# Returns the new serial.
def
generate_serial
(
current_serial
)
# Optimization for the case that current_serial is a lot larger
# than the generated serial
new
=
[
Time
.
now
.
strftime
(
'%Y%m%d00'
)
.
to_i
,
current_serial
].
max
# Increment until we find a spot
new
+=
1
while
new
<=
current_serial
new
end
end
end
Event Timeline
Log In to Comment