<FromGitter>
<Blacksmoke16> TIL you can send the response obj back to the client then do other stuff
<FromGitter>
<Blacksmoke16> makes sense since its just an IO i guess, but never really thought about it
<FromGitter>
<Blacksmoke16> any other useful events i should implement?
<FromGitter>
<Blacksmoke16> currently i have ⏎ ⏎ 1) request - after a route has been resolved ⏎ 2) action_arguments - after the controller's action's arguments have been resolved ⏎ 3) response - after the controller's action has been executed ... [https://gitter.im/crystal-lang/crystal?at=5ddf137c6a85195b9eba201b]
<FromGitter>
<Blacksmoke16> was thinking maybe one more between response and terminate that includes the controller action's response value?
<FromGitter>
<Blacksmoke16> which could be used for like writing the return value to the response, say based on what format the response should be etc, whicher listener sets it first is it
<raz>
hmm, is there a sane way to make an Enum json-serialize to strings (and back)?
<FromGitter>
<watzon> Provide to_json and from_json methods for it
<FromGitter>
<watzon> Or actually I think you may need `new(json : JSON::PullParser)` rather than `from_json`
<raz>
i guess i'm just not sure how to map the names back in from_json
<raz>
gonna experiment a bit
<FromGitter>
<Blacksmoke16> MyEnum
<FromGitter>
<Blacksmoke16> .parse?
<raz>
you mean invent my own enum macro?
<raz>
i generally just want it for one specific enum and preferably without too much black magic ;)
<raz>
if it's too complicated i'll prob just stick with an int in the json
<FromGitter>
<Blacksmoke16> no i mean define a `from_json` method and do like `MyEnum.parse? json.read_string` or something like that
<FromGitter>
<Blacksmoke16> can even make the module like `EnumConverter(MyEnum)` then `T.parse? json read_string`
<raz>
hmm gonna try, thx!
<FromGitter>
<Daniel-Worrall> Can't you just use a converter
<FromGitter>
<Blacksmoke16> That's what I was suggesting
<FromGitter>
<Blacksmoke16> I don't think one exists in the std lib
<FromGitter>
<Daniel-Worrall> Yeah make one yourself and specify it on the serialize stuff
hightower4 has quit [Ping timeout: 252 seconds]
Human_G33k has quit [Ping timeout: 265 seconds]
Human_G33k has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 250 seconds]
<FromGitter>
<Blacksmoke16> mhm
<FromGitter>
<christopherzimmerman> Anyone come across a shard for reading hd5?
<FromGitter>
<Blacksmoke16> whats the reasoning for having `Exception`, but naming everything `*Error`?
<FromGitter>
<Blacksmoke16> `ArgumentError` vs `ArgumentException`
<FromGitter>
<Blacksmoke16> er i guess because it represents and argument error but is of type `Exception`
yukai has joined #crystal-lang
chachasmooth has quit [Ping timeout: 246 seconds]
chachasmooth has joined #crystal-lang
ht_ has joined #crystal-lang
ht_ has quit [Quit: ht_]
yukai has quit [Ping timeout: 265 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #crystal-lang
dwdv has joined #crystal-lang
FromGitter has quit [Read error: Connection reset by peer]
FromGitter has joined #crystal-lang
hightower3 has joined #crystal-lang
alexherbo21 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
<FromGitter>
<vlazar> Anybody here on MacOS? Something very weird happens with Crystal for me locally. ⏎ ⏎ ```if rand(2) > 0 ⏎ my_string = "hello world" ⏎ end ⏎ ⏎ puts my_string``` ⏎ ⏎ And it happily compiles and runs without any errors. ... [https://gitter.im/crystal-lang/crystal?at=5ddfb58b6a85195b9ebe6c98]
<FromGitter>
<vlazar> I've noticed it when I've changed var name `my_string` to `greeting` and was confused why there was no compile time error.
<FromGitter>
<igor-alexandrov> It works for me too
<FromGitter>
<vlazar> I've tried using `my_string` and Crystal did shonw a comile time error.
<FromGitter>
<vlazar> ANd now it just always runs.
<FromGitter>
<vlazar> @igor-alexandrov Work as in it incorrectly compiles and runs?
<FromGitter>
<vlazar> Maybe it's not an issue with compiler, but incorrect example.
<FromGitter>
<vlazar> Oh, it's actually funnier that that. I've tested it before in carcin and it was showing a compile time error for me. Now it also works similarly to how it was a compile time error before for me locally and now it always runs with no error.
<FromGitter>
<vlazar> Ignore me guys, lost the `.upcase` part in code
<FromGitter>
<igor-alexandrov> :)
<FromGitter>
<vlazar> time for some sleep I guess :D
<FromGitter>
<vlazar> still, I'm workin on presentation, and that's a plus
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Remote host closed the connection]
DTZUZO has joined #crystal-lang
erdnaxeli has quit [Remote host closed the connection]
tleydxdy has quit [Write error: Connection reset by peer]
olbat[m] has quit [Remote host closed the connection]
ternarysolo has quit [Remote host closed the connection]
beepdog has quit [Write error: Connection reset by peer]