Skip to content

Commit

Permalink
Merge pull request #3 from lagerfeuer/master
Browse files Browse the repository at this point in the history
Update for Crystal 1.0.0
  • Loading branch information
lagerfeuer authored Jun 22, 2021
2 parents 54691be + de20a15 commit 8e4665a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Add this to your application's `shard.yml`:
dependencies:
cute:
github: Papierkorb/cute
version: ~> 0.4.0
```
## Usage
Expand Down
9 changes: 8 additions & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
name: cute
version: 0.3.1
version: 0.4.0

description: |
An event-centric publisher/subscribe model for objects inspired by the Qt framework.
authors:
- Stefan Merettig <[email protected]>
- Lukas Deutz <[email protected]>

dependencies:
future:
github: crystal-community/future.cr

crystal: ">= 0.35, < 2.0.0"

license: MPL-2
1 change: 1 addition & 0 deletions spec/spec_helper.cr
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require "spec"
require "../src/cute"
require "future"
4 changes: 2 additions & 2 deletions spec/timed_buffer_sink_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ describe Cute::TimedBufferSink do
subject.notify 9
subject.notify 0

start = Time.now
start = Time.utc
Fiber.yield # We're not hitting the time constraint, right?
(start - Time.now).should be < 10.milliseconds
(start - Time.utc).should be < 10.milliseconds

emits.should eq [ [ 1, 2, 3 ], [ 4, 5 ], [ 6, 7 ], [ 8, 9, 0 ] ]

Expand Down
8 changes: 4 additions & 4 deletions src/cute/signal.cr
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ module Cute

def on(sink : Cute::Sink(U)) forall U
if sink.is_a?(Cute::Sink(Nil))
on{ sink.notify(nil.as(U)) }
on{ sink.notify(nil.as(U)).as(U) }
else
{% if call.args.empty? %}
on{ sink.notify(nil.as(U)) }
on{ sink.notify(nil.as(U)).as(U) }
{% elsif call.args.size == 1 %}
on{|arg| sink.notify(arg.as(U))}
on{|arg| sink.notify(arg.as(U)).as(U)}
{% else %}
on{|{{ call.args.map(&.var.id).splat }}| sink.notify({ {{ call.args.map(&.var.id).splat }} }.as(U))}
on{|{{ call.args.map(&.var.id).splat }}| sink.notify({ {{ call.args.map(&.var.id).splat }} }.as(U)).as(U)}
{% end %}
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/cute/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Cute
VERSION = "0.3.1"
VERSION = "0.4.0"
end

0 comments on commit 8e4665a

Please sign in to comment.