<FromGitter>
<mwlang> Looking for a solid strategy to DRY that up as I don't want double the integration test scenarios just because I have two different services. The API endpoints of each will vary some, but perhaps 90% of the APIs are the same between the two.
<FromGitter>
<mwlang> thanks, @watzon. I took a look, but spectator doesn't seem to support shared groups/contexts. Definitely is a lot closer to Rspec than the built-in spec runner, though.
<FromGitter>
<watzon> Can you setup multiple logging backends?
<FromGitter>
<watzon> Nvm, found the BroadcastBackend
<Andriamanitra>
how do i collect from an iterator?
<Andriamanitra>
surely there's something similar to ruby's #collect method
<Andriamanitra>
err i mean ruby's #to_a, python's collect()
<FromGitter>
<naqvis> you can call `to_a` terminal operator as well
<Andriamanitra>
i ended up side-stepping the problem by doing seq[1..].zip(seq) instead
<Andriamanitra>
would be nice if each_cons could be combined with other nice things, i'm still a bit confused why it needs to be what you call "terminal operator"
<Andriamanitra>
oh wait each_cons_pair is the only weird one? each_cons(2) also works just fine
<FromGitter>
<HertzDevil> to be precise, when you call `.each_cons` without a block you end up calling the method from `Iterable` instead of `Enumerable`
<FromGitter>
<HertzDevil> that method in turn is simply an alias of `.each.cons`
<FromGitter>
<HertzDevil> otoh `Iterable` does not define the block-less `#each_cons_pair`
<Andriamanitra>
is that intended? seems unnecessarily confusing
<FromGitter>
<HertzDevil> there were talks to remove `Iterable` altogether because all the methods there are simply wrappers around the block-less `.each`
<FromGitter>
<HertzDevil> `#each`
repo has quit [Ping timeout: 240 seconds]
repo has joined #crystal-lang
<Andriamanitra>
interesting, thanks
<FromGitter>
<HertzDevil> and everywhere it's used for method overloading, the same methods also take `Iterator`s
<FromGitter>
<HertzDevil> and there are only two: `Iterator.chain` and `Enumerable#zip(?)`
<FromGitter>
<mwlang> Is WebMock, and specifically the `after_live_request` callback still working? I am finding that the response.body is always an empty string, yet I can see body_io has bytes. If I don't use Webmock, the body is populated.
<FromGitter>
<mwlang> @KevinSjoberg that one line of regex's is rather long, esp. relative to the others below it. Perhaps consider treating module, class, and methods on separate lines. A little less DRY, but more readable/maintainable over the long-run.
<FromGitter>
<KevinSjoberg> @mwlang fair point. I'll update it. 👍
<FromGitter>
<Blacksmoke16> bit diff style but is essentially syntax sugar to `Spec` module
mistergibson has joined #crystal-lang
<FromGitter>
<asterite> WebMock should be part of the std so it doesn't fall out of sync
<FromGitter>
<asterite> Same for timecop
skrzyp has joined #crystal-lang
<FromGitter>
<Blacksmoke16> a simpler thing related to time could be like `Time.set_test_now 2020, 12, 8, ...`
<FromGitter>
<Blacksmoke16> just make `Time.utc` and `Time.local` return that static time
<FromGitter>
<HertzDevil> should we allow setters as macro names?
<FromGitter>
<HertzDevil> right now `macro foo=; end` isn't parsed properly but `macro []=(k, v); end` actually works
<FromGitter>
<HertzDevil> for context this is about crystal-lang/crystal#10022
duane has quit [Ping timeout: 260 seconds]
<FromGitter>
<asterite> It should be disallowed but it doesn't matter much
<FromGitter>
<HertzDevil> fine by me
<FromGitter>
<HertzDevil> taking this a step further i think we don't need any of the operator macros either, except `[]`
<FromGitter>
<HertzDevil> did a simple regex check and `[]` is the only one crystal itself uses
<FromGitter>
<anapsix> greetings! ⏎ I was making a YAML parser for `Time::Span`, and wondering is there is a better way of turning `Time::Span` into a string than checking for increasingly smaller time units, and using them as a base measurement for string `{amount}.{measurement}` ⏎ https://play.crystal-lang.org/#/r/a3dm
<FromGitter>
<Blacksmoke16> could you just turn it into an object with start and end times?
<FromGitter>
<anapsix> it's not as much of problem of converting from yaml, as it is to yaml
<FromGitter>
<anapsix> unless I misunderstand what you mean
<FromGitter>
<Blacksmoke16> nvm, span doesnt really have a specific start/end datetime
<FromGitter>
<Blacksmoke16> couldnt you just store the total ms or something?
<FromGitter>
<anapsix> yeah.. settling on a base measurement would help
<FromGitter>
<Blacksmoke16> mhm
<FromGitter>
<anapsix> seconds or milliseconds seems reasonble
<FromGitter>
<erdnaxeli:cervoi.se> this is with `crystal play`
<kevinsjoberg>
I'm really stuck at p2 for day 10. I just feel that there's a clever way of solving it and I'm not seeing it. I guess my lack of a formal degree in cs and nonexistent math skills (was bullied through most of school) is really shining through.
<FromGitter>
<tenebrousedge> eh. I'm a couple of days behind at this point. I wouldn't feel too bad
<FromGitter>
<tenebrousedge> the point is just to be coding, to take on the challenge
<FromGitter>
<j8r> Little image of my DE and tabs at the end, nothing private :)
<FromGitter>
<watzon> Giving me AoE vibes so far
<FromGitter>
<watzon> Or StarCraft
<FromGitter>
<j8r> yes, that's will be a strategy game
<FromGitter>
<watzon> Awesome
<FromGitter>
<j8r> But it aims to be simpler, and more strategy oriented
<FromGitter>
<j8r> No tech tree, so no "the one fastest to reach the most optimized techs wins"
<FromGitter>
<j8r> only units vs units, pure tactics :)
<FromGitter>
<j8r> of course, backend in Crystal :)
<FromGitter>
<watzon> Online multiplayer?
<FromGitter>
<j8r> yep!
<FromGitter>
<Daniel-Worrall> What's the frontend in?
<FromGitter>
<watzon> Cool! can't wait to see it
<FromGitter>
<j8r> JavaScript
<FromGitter>
<Daniel-Worrall> ah, browser?
<FromGitter>
<j8r> and HTML/DOM used, no canvas
<FromGitter>
<j8r> It has a huge advantage of portability
<FromGitter>
<j8r> and is plenty performant enough for such game
<FromGitter>
<j8r> When closed-alpha ready, for those interested, I'll invite them to test and give feedbacks (I'll submit a Forum post). ⏎ Expect, maybe 1-3 months (I prefer to be large)
<FromGitter>
<j8r> @watzon thanks :D
<hightower4>
Awesome j8r !
<FromGitter>
<j8r> thx!
<hightower4>
@bew what was your reason for implementing terminfo parsing lib manually after you already created bindings for unibilium ?