JuliaCon / JuliaCon.jl

JuliaCon. Everywhere.
MIT License
75 stars 9 forks source link

Add a dispatch option to now, today, and juliacon2021 #16

Closed Azzaare closed 3 years ago

Azzaare commented 3 years ago

Add a dispatch option to now, today, and juliacon2021 to return a string instead of printing in the terminal

The behavior of those 3 functions is not changing unless we call them with the keyword arg output=:text So no breaking changes!

The goal of this PR is to have JuliaCon.jl be usable by external packages such as the chatbot HoJBot.jl that we are developing there: https://github.com/Humans-of-Julia/HoJBot.jl As we would like to have the bot running before the incoming JuliaCon, it would be nice to have the PR merged quickly and a new version tag!

EDIT: I could probably recycle some part of the code for today ... but it can be done in another PR

Azzaare commented 3 years ago

@crstnbr Sorry for the delay, I was caught up with other things!

Here is a cleaner version that includes your previous review's requested changes.

There is the possibility to use ReferenceTests.jl in the test file, but I think it might be overkill (and needs a custom Project.toml for tests).

codecov-commenter commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@75f1a7a). Click here to learn what that means. The diff coverage is 98.46%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #16   +/-   ##
=========================================
  Coverage          ?   86.80%           
=========================================
  Files             ?        5           
  Lines             ?      288           
  Branches          ?        0           
=========================================
  Hits              ?      250           
  Misses            ?       38           
  Partials          ?        0           
Impacted Files Coverage Δ
src/schedule.jl 91.81% <98.38%> (ø)
src/tshirtcode.jl 85.71% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 75f1a7a...d95ee78. Read the comment docs.

carstenbauer commented 3 years ago

I refactored things a bit as this seemed simpler than requesting changes (I hope you don't mind). Please check that the final output of now and today with output=:text is what you had in mind originally. If so, I'll merge this and tag a new release soon after.

Azzaare commented 3 years ago

The output is exactly what I expect. Thank you!