Skip to content

Commit c4ade7b

Browse files
committed
Support Crystal 1.0
1 parent 298702a commit c4ade7b

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

shard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: marmot
2-
version: 0.3.1
2+
version: 0.4.0
33

44
authors:
55
- Alexandre Morignot <erdnaxeli@cervoi.se>
66

7-
crystal: 0.35.1
7+
crystal: ">=0.35.1,<2"
88

99
license: MIT
1010

src/marmot.cr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ require "./tasks"
1111
# * when a value is available on a channel (`Marmot.on`)
1212
#
1313
# Tasks are all executed on the same fiber.
14-
# This means two things: first, you don't have to worry about concurrency
15-
# (your tasks can share objects which does not support concurrency, like
14+
# This means two things: first, you don't have to worry about concurrency
15+
# (your tasks can share objects which do not support concurrency, like
1616
# `HTTP::Client`), and second, they must not block (too much).
1717
# If you want to execute jobs concurrently, you must spawn a new fiber inside your
1818
# tasks.
@@ -38,7 +38,7 @@ require "./tasks"
3838
# Their next runs will be triggered at the time before the clock changes, but the
3939
# next ones will be correctly scheduled.
4040
module Marmot
41-
VERSION = "0.3.1"
41+
VERSION = "0.4.0"
4242

4343
alias Callback = Proc(Task, Nil)
4444

@@ -75,10 +75,10 @@ module Marmot
7575
# Runs a task every *span* at the given *day*, *hour*, *minute* and *second*.
7676
#
7777
# ```
78-
# Marmot.every(:hour, hour: 16, minute: 30, second: 30) # will run every hour at 30:30 (the hour parameter is ignored)
79-
# Marmot.every(:day, hour: 15) { ... } # will run every day at 15:00:00
80-
# Marmot.every(:month, day: 15) { ... } # will run every month at midnight
81-
# Marmot.every(:month, day: 31) { ... } # will run every month THAT HAVE a 31th day at midnight
78+
# Marmot.every(:hour, hour: 16, minute: 30, second: 30) # will run every hour at 30:30 (the hour parameter is ignored)
79+
# Marmot.every(:day, hour: 15) { ... } # will run every day at 15:00:00
80+
# Marmot.every(:month, day: 15) { ... } # will run every month at midnight
81+
# Marmot.every(:month, day: 31) { ... } # will run every month THAT HAVE a 31th day at midnight
8282
# ```
8383
def every(span : Symbol, *, day = 1, hour = 0, minute = 0, second = 0, &block : Callback) : Task
8484
Log.debug { "New task to run every #{span} at #{hour}:#{minute}:#{second}" }
@@ -115,7 +115,7 @@ module Marmot
115115
remove_canceled_tasks
116116

117117
if @@tasks.size == 0
118-
Log.debug { "No task to run! Stopping." }
118+
Log.debug { "No task to run! Stopping." }
119119
return
120120
end
121121

src/tasks.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module Marmot
2626
@callback.call(self)
2727
rescue ex : Exception
2828
self.cancel
29-
Log.error(exception: ex) { "An error occurred in task #{self}. The task have been canceled." }
29+
Log.error(exception: ex) { "An error occurred in task #{self}. The task has been canceled." }
3030
end
3131

3232
protected def start : Nil

0 commit comments

Comments
 (0)