Skip to content

Commit

Permalink
Release 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorfinnell committed Sep 28, 2019
1 parent 41ae6bb commit d811082
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: hqtrivia
version: 0.3.0
version: 0.4.0

authors:
- Taylor Finnell <[email protected]>

crystal: 0.29.0
crystal: 0.31.0

license: MIT

Expand Down
4 changes: 2 additions & 2 deletions spec/hqtrivia/bot_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module HqTrivia
describe Bot do
it "works" do
messages = File.read("./spec/data/new_messages").each_line.to_a
show = Model::Show.new(active: true, show_type: "hq-us", prize: 100, show_id: 666, start_time: Time.now)
show = Model::Show.new(active: true, show_type: "hq-us", prize: 100, show_id: 666, start_time: Time.local)
coordinator = LocalCoordinator.new("us")
coordinator.show = show
connection = Connection::Local.new(messages)
Expand All @@ -66,7 +66,7 @@ module HqTrivia

it "works with words" do
messages = File.read("./spec/data/words").each_line.to_a
show = Model::Show.new(active: true, show_type: "hq-us", game_type: "words", prize: 100, show_id: 666, start_time: Time.now)
show = Model::Show.new(active: true, show_type: "hq-us", game_type: "words", prize: 100, show_id: 666, start_time: Time.local)
coordinator = LocalCoordinator.new("us")
coordinator.show = show
connection = Connection::Local.new(messages)
Expand Down
12 changes: 6 additions & 6 deletions spec/hqtrivia/show_coordinator_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module HqTrivia
it "yields if show is active and no game type is set" do
coordinator = LocalCoordinator.new("us")
coordinator.show = Model::Show.new(active: true, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us")
start_time: Time.utc, prize: 666, show_type: "hq-us")

show_coord = ShowCoordinator.new(coordinator)
show_coord.on_show do |show|
Expand All @@ -16,7 +16,7 @@ module HqTrivia
it "yields if show is active and game type matches trivia" do
coordinator = LocalCoordinator.new("us", game_type: "trivia")
coordinator.show = Model::Show.new(active: true, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us", game_type: "trivia")
start_time: Time.utc, prize: 666, show_type: "hq-us", game_type: "trivia")

show_coord = ShowCoordinator.new(coordinator)
show_coord.on_show do |show|
Expand All @@ -27,7 +27,7 @@ module HqTrivia
it "yields if show is active and game type matches words" do
coordinator = LocalCoordinator.new("us", game_type: "words")
coordinator.show = Model::Show.new(active: true, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us", game_type: "words")
start_time: Time.utc, prize: 666, show_type: "hq-us", game_type: "words")

show_coord = ShowCoordinator.new(coordinator)
show_coord.on_show do |show|
Expand All @@ -38,7 +38,7 @@ module HqTrivia
it "does not yield if game_type does not match" do
coordinator = LocalCoordinator.new("us", game_type: "trivia")
coordinator.show = Model::Show.new(active: true, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us", game_type: "words")
start_time: Time.utc, prize: 666, show_type: "hq-us", game_type: "words")

show_coord = ShowCoordinator.new(coordinator)
show_coord.on_show(blocking: false) do |show|
Expand All @@ -49,7 +49,7 @@ module HqTrivia
it "yields the show if it is active" do
coordinator = LocalCoordinator.new("us")
coordinator.show = Model::Show.new(active: true, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us", game_type: "words")
start_time: Time.utc, prize: 666, show_type: "hq-us", game_type: "words")

show_coord = ShowCoordinator.new(coordinator)
show_coord.on_show(blocking: false) do |show|
Expand All @@ -60,7 +60,7 @@ module HqTrivia
it "does not yield the show if it is inactive" do
coordinator = LocalCoordinator.new("us")
coordinator.show = Model::Show.new(active: false, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us", game_type: "words")
start_time: Time.utc, prize: 666, show_type: "hq-us", game_type: "words")

show_coord = ShowCoordinator.new(coordinator)
show_coord.on_show(blocking: false) do |show|
Expand Down
4 changes: 2 additions & 2 deletions spec/hqtrivia_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe HqTrivia do
it "yields active shows" do
coordinator = HqTrivia::LocalCoordinator.new("us")
coordinator.show = HqTrivia::Model::Show.new(active: true, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us", game_type: "trivia")
start_time: Time.utc, prize: 666, show_type: "hq-us", game_type: "trivia")

HqTrivia.on_show(coordinator) do |show|
show.should be_a(HqTrivia::Model::Show)
Expand All @@ -14,7 +14,7 @@ describe HqTrivia do
it "does not yield inactive shows" do
coordinator = HqTrivia::LocalCoordinator.new("us")
coordinator.show = HqTrivia::Model::Show.new(active: false, show_id: 123,
start_time: Time.utc_now, prize: 666, show_type: "hq-us", game_type: "trivia")
start_time: Time.utc, prize: 666, show_type: "hq-us", game_type: "trivia")

HqTrivia.on_show(coordinator, blocking: false) do |show|
raise "should not have yielded"
Expand Down
2 changes: 1 addition & 1 deletion src/hqtrivia/model/raw_web_socket_message.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module HqTrivia
Model::{{msg.camelcase.id}}.from_json({{json}})
{% end %}
else
Model::UnknownMessage.new({{json}}, Time.utc_now)
Model::UnknownMessage.new({{json}}, Time.utc)
end
rescue jme : JSON::MappingError
HqTrivia.logger.error("Failed to parse json: #{{{json}}}")
Expand Down
2 changes: 1 addition & 1 deletion src/hqtrivia/version.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module HqTrivia
# Current HqTrivia version
VERSION = "0.3.0"
VERSION = "0.4.0"
end

0 comments on commit d811082

Please sign in to comment.