jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
Philpax has quit [Ping timeout: 244 seconds]
mkl0501 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Philpax has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
Philpax has quit [Ping timeout: 250 seconds]
Philpax has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 258 seconds]
Philpax has joined #crystal-lang
bjmllr has quit [Ping timeout: 255 seconds]
bjmllr has joined #crystal-lang
steenuil has quit [Quit: Textual IRC Client: www.textualapp.com]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
onethirtyfive has joined #crystal-lang
triangles has quit [Quit: Leaving]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 255 seconds]
Philpax has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
snsei has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
Nik736 has joined #crystal-lang
snsei has joined #crystal-lang
mark_66 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
bew78 has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
bew78 has quit [Quit: WeeChat 1.5]
bew78 has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 276 seconds]
<Tophe> hi all
<Tophe> kemal question
<Tophe> I can setup the port via Kemal.config.port = 8000
<Tophe> but Kemal.config.logging = false and Kemal.config.env = "production" don't work
<FromGitter> <sdogruyol> what's your Kemal version?
<Tophe> kemal:
<Tophe> branch: master
<Tophe> github: sdogruyol/kemal
<Tophe> name: kemal
<Tophe> version: 0.14.1
<FromGitter> <sdogruyol> Ugh
<FromGitter> <sdogruyol> You can't specify both branch and version
<FromGitter> <sdogruyol> Use branch master
<Tophe> I use master branch
<FromGitter> <sdogruyol> And for environment you need to use KEMAL_ENV= production crystal src app.cr
<FromGitter> <sdogruyol> Kemal.config.logging = false should also work
<FromGitter> <sdogruyol> You can also use logging false
<Tophe> there is also a Kemal.config.env that dont' work
<Tophe> when I use logging = false, it hang up, never serving pages
<Tophe> in the master if you look at shard.yml it sais kemal is 0.14.1
<Tophe> I made a shard update, the problem is alway here .
<Tophe> question about chanel, is it possible to have a timeout on the channel.receive (a la go).
bew78 has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> Tophe
<FromGitter> <sdogruyol> your shard declaration shouldnt have both version and branch in it
<FromGitter> <sdogruyol> like i said you should use KEMAL_ENV
<FromGitter> <sdogruyol> @tophe and channel timeout https://github.com/crystal-lang/crystal/issues/2990
Tophe has quit [Remote host closed the connection]
Tophe has joined #crystal-lang
<Tophe> sdogruyol : thank's
soveran has quit [Remote host closed the connection]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox_ has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Tophe has quit [*.net *.split]
bjmllr has quit [*.net *.split]
Davy_CC has quit [*.net *.split]
leafybasi has quit [*.net *.split]
bjmllr has joined #crystal-lang
Tophe has joined #crystal-lang
leafybasi has joined #crystal-lang
Davy_CC has joined #crystal-lang
Raimondi has quit [Quit: WeeChat 1.6-dev]
pawnbox has quit [Remote host closed the connection]
tomchapin has joined #crystal-lang
tomchapi_ has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
tilpner has quit [Quit: :wq]
tilpner has joined #crystal-lang
<crystal-gh> [crystal] amedeiros closed pull request #3226: Fixes #3107 (master...feature/#3107_html_unescape) https://git.io/viLK7
pawnbox has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> @Tophe i fixed the environment bug in master. Thanks for reporting
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/viqNB
<crystal-gh> crystal/master dcfb2b6 Ary Borenszweig: Changelog: more notes and a typo
Philpax has quit [Quit: Leaving]
Philpax has joined #crystal-lang
<travis-ci> crystal-lang/crystal#dcfb2b6 (master - Changelog: more notes and a typo): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/157080059
pawnbox has joined #crystal-lang
kulelu88 has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
soveran has quit []
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<FromGitter> <sdogruyol> @RX14 seems like we need a shard for your multipart parser
Raimondi has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kulelu88 has quit [Ping timeout: 252 seconds]
gewo has quit [Quit: WeeChat 1.0.1]
gewo has joined #crystal-lang
gewo has quit [Client Quit]
<BlaXpirit> RX14, heh, is it time to just come up with many examples to show how useful power assert is?
<RX14> you can
<RX14> i have loads of other stuff to do
<FromGitter> <sdogruyol> @BlaXpirit what's so good about it
<BlaXpirit> can i though? my brain doesnt work creatively
<FromGitter> <sdogruyol> i haven't used power assert before
<FromGitter> <sdogruyol> can you guys sell it to me :D
<RX14> BlaXpirit, at this point just getting a simple top-level macro assert into spec would be nice
<RX14> then we advocate compiler plugins
<RX14> and make power_assert one
<BlaXpirit> i have absolutely no idea how that can work
<RX14> dlopen
<BlaXpirit> naaah that will absolutely not happen
<BlaXpirit> i even dislike the idea
<BlaXpirit> "run this code with xxx and yyy plugins"
<RX14> well rust managed it
<RX14> and managed it well
<RX14> but then again their libraries are dynamic
<tilpner> Wait... are you saying Rusts compiler plugins are good?
<RX14> they're useful
<tilpner> When they work.
<tilpner> Which they usually don't.
<RX14> compiler plugins have a use in dev environments
<RX14> i.e.
<RX14> power_assert will only be used in spec
<RX14> then you have compiler plugins for coverage or fuzzing or other code analysis
<RX14> also used in dev
<RX14> i think it's useful
<RX14> i've honestly never used a rust compiler plugin
<tilpner> Rusts compiler plugins will get better, eventually settling on a model Crystal could use. Right now, they're a mess.
<RX14> or much of rust for that matter
<BlaXpirit> most people will say it's a waste of time when so much else needs to be done
<RX14> yeah, sure
<tilpner> (For the record, they're useful and awesome.)
<RX14> it is low on the priorities
<RX14> but i like the idea
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <readtimeout> When coding approach to what should be? EAFP or LBYL
<RX14> guard checks are much cheaper than exceptions
<RX14> and crystal's postfix operators makes many of them only take a single line of code
<RX14> e.x. `raise "x" if y`
<RX14> or return nil
<RX14> or whatever
<RX14> so for crystal, exceptions really should be very exceptional
<FromGitter> <readtimeout> thank you
<BlaXpirit> readtimeout, LBYL mostly
<RX14> it really depends on what you're doing
<RX14> for example, especially in filesystems EAFP can help to reduce security issues
<RX14> program design is never black and white
<BlaXpirit> it's funny because crystal has a 3rd approach - you're neither checking beforehand, nor catching exceptions afterwards
<RX14> multiple return?
<BlaXpirit> - pass a block to use in case of failure
<RX14> oh yeah
<RX14> can sometimes be applicable
g3funk has quit [Max SendQ exceeded]
<crystal-gh> [crystal] kostya opened pull request #3230: fix encoding to UTF-8 with invalid: :skip, fixed #3229 (master...io_encoding_fix) https://git.io/vimZt
g3funk has joined #crystal-lang
jamie_ca has quit [Ping timeout: 240 seconds]
jamie_ca has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
tilpner has quit [Quit: :wq]
mkl0501 has joined #crystal-lang
tilpner has joined #crystal-lang
snsei has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
tilpner has quit [Quit: :wq]
mark_66 has joined #crystal-lang
bew78 has joined #crystal-lang
bjz has joined #crystal-lang
tilpner has joined #crystal-lang
willl has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #3230: fix encoding to UTF-8 with invalid: :skip, fixed #3229 (master...io_encoding_fix) https://git.io/vimZt
bew78 has quit [Quit: WeeChat 1.5]
<FromGitter> <crisward> trying to create byte slice from i16, can find any docs on this
<BlaXpirit> crisward, you mean you want a slice of 2 uint8 ?
<FromGitter> <crisward> yes
<FromGitter> <crisward> thnks
<BlaXpirit> damn, they only work with io
<BlaXpirit> there has to be a better solution
<BlaXpirit> https://crystal-lang.org/api/0.18.7/IO/ByteFormat.html#decode%28int%3AInt16.class%2Cio%3AIO%29-instance-method
<FromGitter> <crisward> `UInt8.slice(mynum.to_i16,my_num.to_i16/256)` ugly but it works
onethirtyfive has quit [Remote host closed the connection]
<BlaXpirit> yeah, that's actually quite nice
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 250 seconds]
<RX14> i wish asterite had actually replied to my multipart PR message instead of going ahead and releasing 0.19 regardless
<BlaXpirit> 0.19 is released? T_T
<RX14> it's tagged
<RX14> but nothing else
soveran has quit [Remote host closed the connection]
<jhass> there's actually a draft with the packages uploaded
<jhass> no idea what Ary's waiting for
<FromGitter> <sdogruyol> he's probably writing a blog post and announcement
<FromGitter> <sdogruyol> :D
<FromGitter> <sdogruyol> meanwhile Kemal just passed 1000 stars on Github
<RX14> BlaXpirit, so I just had an idea
<RX14> expectations are ugly, and we want to write assertions as regular crystal code
<RX14> right?
<BlaXpirit> sure
<RX14> why not monkey-patch some common collections and matching methods when you require the "spec" library to allow the top-level expression to be debugged?
<RX14> i'm not 100% sure how it would work
<RX14> but then assert would become a simple macro
<RX14> and the output would be customised
<RX14> let me brainstorm on carc.in
<BlaXpirit> RX14, well yeah, i was thinking about things like that
<BlaXpirit> RX14, brainstorm in crystal play btw
<RX14> effort to switch workspace to a termainl :P
<BlaXpirit> ugh
<BlaXpirit> what i was thinking was some special prefix for methods that deal with asssert info
<BlaXpirit> or some wrapper
<BlaXpirit> like... class Assert(Array); def ==(other : Array); return "items differ at index 5"
<BlaXpirit> i dunno
<BlaXpirit> this doesnt work of course but i'd like to see what you come up with
<BlaXpirit> but yeah, my approach would be to make an addon that mirrors the structure, not a direct patch
<RX14> well
<RX14> hmm
<RX14> oh
<RX14> what if we just monkey patch enumerable and stuff
<RX14> array.assert_includes? "foo"
<RX14> eh
<BlaXpirit> ..........
<RX14> better than array.should include("foo")
<BlaXpirit> is it
<RX14> yes
<BlaXpirit> you made a mistake lol - it's. .should include
<BlaXpirit> no i made a mistake in pointing out mistake
<BlaXpirit> it's. .should contain
<BlaXpirit> it's that bad
<RX14> yeah i don't remmeber spec assertions
<RX14> because i havent used them in so long
<BlaXpirit> what's the future for us though? i hate writing unitests enough even without the DSLs
<RX14> keep using power_assert macro
<RX14> i guess
<BlaXpirit> power_assert really is too slow though
<BlaXpirit> and buggy
<BlaXpirit> 100 times slower is no joke
_whitelogger has joined #crystal-lang
<RX14> something like that
<BlaXpirit> could be worse
<BlaXpirit> but if you add a macro that does all the previous_def stuff...
<BlaXpirit> mmm this could be good
<BlaXpirit> but hey, it takes away freedom to write shitty DSLs!!!
<RX14> something like
<RX14> add_assert_info Enumerable(T), includes?(obj) do |obj|
<RX14> "Expected #{self} to be #{obj.foo}"
<RX14> end
<BlaXpirit> yeah, but i think it's slightly too much, could do with module Enumerable(T); add_assert_info
<RX14> yeah i guess
<RX14> BlaXpirit, see my comment on #3095
<RX14> we need a github issue linker in here
<BlaXpirit> why are notification emails delayed? :<
<RX14> read github status
<BlaXpirit> RX14, just join gitter >:)
<RX14> but that's in a browser
<RX14> i would need another chromium app window
<RX14> when i can just join a channel in hexchat
<BlaXpirit> i'm not being serious btw
<RX14> could you add some functionaity to FromGitter?
<RX14> that way it could ignore itself
<RX14> and not pass the link messages to gitter
<BlaXpirit> RX14, well it's a pure message resender bot
<RX14> yeah...
<BlaXpirit> but then again, it could be tied to the gitter room
<BlaXpirit> link to issues of the repo that's tied to the gitter room
onethirtyfive has joined #crystal-lang
<jhass> actually the github post receive hook can do issues if you enable it via the API iirc
<jhass> the github IRC notifier that is
willl has quit [Quit: Connection closed for inactivity]
<BlaXpirit> yeah it would be nice, but i think RX14 was trying to make a point that gitter users don't want those messages because they already see it linked in the original message
<RX14> i meant
<RX14> when you type #1234
<RX14> it would link issue 1234 on github
<RX14> not github notifications to IRC
<jhass> !enable Issues
<DeBot> jhass: Unknown plugin Issues.
<jhass> eh
<jhass> !enable GithubIssue
<DeBot> jhass: Unknown plugin GithubIssue.
<jhass> mh, how did I call it
<jhass> !enable GithubIssues
<DeBot> jhass: GithubIssues is already enabled.
<jhass> mh
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<jhass> !reload
<DeBot> jhass: Reloaded configuration.
<jhass> #1234
<DeBot> https://github.com/crystal-lang/crystal/pull/1234 (Fix class name generation for `crystal init`)
<BlaXpirit> jhass, yeah, but I was saying that gitter users will see the link twice
<BlaXpirit> jhass, also should we make it possible to use your bot from gitter?
<jhass> up to you, I don't care too much
<BlaXpirit> jhass, well I would say yes but I don't know a clean way
<BlaXpirit> simplest for sure would be for your bot to ignore the prefix
soveran has quit [Ping timeout: 250 seconds]
<jhass> you could also just skip the prefix on >>
<BlaXpirit> and on ! and
<BlaXpirit> RX14, yeah, this is pretty good https://carc.in/#/r/18ba
<jhass> well, ?, ! shouldn't be necessary here
<BlaXpirit> doesn't work in 0.18 though :o
<RX14> jhass, thanks
<RX14> BlaXpirit, yeah propose it as a solution on #3095
<DeBot> https://github.com/crystal-lang/crystal/issues/3095 (Replace expectations in spec with power asserts)
<RX14> say that you know it's hacky but since it's only used in dev it should be ok
<BlaXpirit> RX14, ok but what about generically overriding operations like '<'
<BlaXpirit> oh wait, that's not needed, the fallback messages will be in the assert macro
<RX14> ?
<BlaXpirit> forget it
<BlaXpirit> I mean nevermind
soveran has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
<rkeene> I thought there was some web framework for Crystal somewhere ? I can't find anything like that linked from the front page, or linked of a page from the front page
<tilpner> rkeene - kemalcr.com ?
<tilpner> Oh, maybe not a framework.
<tilpner> "micro web framework"
<jhass> there's about a dozen actually
<rkeene> Yeah, I think kemal was it -- too bad it's not discoverable from the Crystal page
<BlaXpirit> if all else fails, this assert can be put into a shard
<BlaXpirit> at least we can avoid DSLs in our projects, not such a big deal, right?
onethirtyfive has joined #crystal-lang
<BlaXpirit> RX14, what do you think about abusing $~ and stuff? its property may be just what we need
<BlaXpirit> the property that it gets exposed into the outer call
<BlaXpirit> oh no, it can interfere with normal methods setting it. forget it
<RX14> uhh
<RX14> nah
<RX14> a class var on spec is nicer
<RX14> to be honest
<BlaXpirit> but not thread safe
<RX14> make it a hash(Fiber, String?) then
<BlaXpirit> lol
<RX14> then index on current fiber in the setter
<RX14> getter
<RX14> it's the right way™
<BlaXpirit> moving on to a slightly different topic, what is the current way to introduce the same setup/teardown steps to multiple tests?
<BlaXpirit> so like this https://carc.in/#/r/18bf but it would actually be done before every test, not only before the first test
<BlaXpirit> i hear minitest does it, but ugh
<RX14> BlaXpirit, spec2
<RX14> it's like the default specs but not feature-baren
<BlaXpirit> but it still has a dsl
<RX14> for assertions?
<RX14> yeah ignore that and use power asserts
<BlaXpirit> well rather than keeping this frankenstein monster, maybe we should make a lib with parts of spec2 and this hacky assert you just invented
<RX14> it has almost the same spec dsl as the default one but with let and before/after
<RX14> well argue with waterlink to seperate the assertions
<BlaXpirit> RX14, why, if it's easier to make a different lib
<BlaXpirit> because we need a lib to put the assert in anyway
<RX14> yes
<RX14> it's own library
<RX14> with no spec DSL
<RX14> assertions and spec DSLs have NOTHING to do with each other apart from 1 exception, I don't want people to keep making shards with them together
<RX14> i want to be able to mix and mathc any assertion with any spec DSL
<BlaXpirit> RX14, well... that can't be done currently. same old "move AssertionFailed to prelude" motif
<RX14> yes, make a seperate PR for that once
<RX14> which makes a solid case
<RX14> then PR all the other spec libs to use it
<BlaXpirit> pff, ysbadadden opposes even that
<RX14> i'm pretty sure he doesn't
<RX14> or wouldn't given a good reason
<RX14> when he made the comment I think he thought that it was simply neccesary for the macro to work
<RX14> i really can't belive that anyone would oppose this change
<BlaXpirit> ruby brain damage
<BlaXpirit> writing this kind of DSL is a special kind of pleasure, u know?
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
<BlaXpirit> at this point i'm too salty
<RX14> yeah...
<RX14> true I don't like minitest but insulting ysbadden about it didn't really help you
<RX14> BlaXpirit, by the way
<RX14> the reason I extracted the reciever and args in the assert macro
<RX14> and executed them before setting assert_info to nil
<RX14> was that i wanted ONLY the central call to set the message
<RX14> because any of the subexpressions could set the assert_info too
<BlaXpirit> got it
<RX14> which is weird
<BlaXpirit> sorry
<RX14> np
<RX14> BlaXpirit, what's the error on 0.18?
<BlaXpirit> RX14, https://carc.in/#/r/18ba
<RX14> BlaXpirit, pls
<RX14> it's probably because the meth arg is parsed as a call
<RX14> and you're pasting where it accepts a method def
<BlaXpirit> uhhh sure
<BlaXpirit> but hey, it works on latest
<RX14> BlaXpirit, oh, nope
<RX14> its because meth becomes the block
<RX14> idk
<RX14> thats weird
<RX14> BlaXpirit, https://carc.in/#/r/18bs
<RX14> the block isn't being sent to the macro
<RX14> it's being parsed as part of the call
<BlaXpirit> RX14, ok but still breaks https://carc.in/#/r/18bt
<RX14> you need brackets around the includes?(obj)
<RX14> BlaXpirit, you need |obj| on the block
<BlaXpirit> well if done dirty then I don't
<RX14> you do
<BlaXpirit> this works on master
<RX14> yes
<RX14> the bug which meant you do was fixed
<RX14> i remmeber it
<BlaXpirit> RX14, another thing... considering that the checked expression is always topmost, doesn't it mean that its `Spec.assert_info =` code will be ran last? meaning that the indirection you pointed out isn't needed?
<RX14> yes
<RX14> it will be run last
<RX14> but if the top level expression doesn't set it
<RX14> it will blled through from the subexprs
<RX14> bleed*
<RX14> it's a corner case
<RX14> but it's worth fixing
<BlaXpirit> ok so change the other macro to Spec.assert_info = %res ? nil : {{yield}}
<RX14> yeah thats more compacy i guess
<RX14> compact*
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
willl has joined #crystal-lang
bew78 has joined #crystal-lang
bew78 has quit [Client Quit]
bew78 has joined #crystal-lang
fedruantine has quit [Quit: client exited: Ex-Chat]
fedruantine has joined #crystal-lang
soveran has quit [Remote host closed the connection]
bew78 has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
kulelu88 has joined #crystal-lang
kulelu88 has quit [Client Quit]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
mkl0501 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
mkl0501 has joined #crystal-lang