<FromGitter>
<Sija> same for brainy househusbands! ermm… sorry, “houseworkers” (when did this term arrive into the language?)
<FromGitter>
<HarrisonB> sorry, not houseworker--homemaker
<FromGitter>
<Sija> wow, excuse my ignorance but it's like… a person who makes houses? ;)
<FromGitter>
<j8r> anyway, all of this to say: docs are missing for advanced Crystal? yes @talbergs , PRs welcome
<FromGitter>
<Sija> to be honest I still have problems with washing-machine manuals at a times, they can be confusing as hell (or I’m too dumb to grok ‘em) :P
<FromGitter>
<PlayLights_twitter> Hello everyone! Do you know how to define a instance variable on Crystal Specs? Im getting `can't use instance variables at the top level` but i can't user `let` method since it doesn't exist yet on Crystal Spec
<FromGitter>
<HarrisonB> Hi @PlayLights_twitter, can you give a bit more context on what you'd like to achieve?
<FromGitter>
<Sija> atm you can't scope 'em to the given block, they'll be run for *every* `it`, everywhere
<FromGitter>
<PlayLights_twitter> So instead of that, each `it`should have an array of before and after blocks that are concatenated from each describe parent before_each block, This said, I have no idea how to implement that 🙄
<FromGitter>
<Sija> there was a discussion regarding that (see #5094), perhaps it's a time to re-evaluate the final decision made in there… (I'd love that!)
<FromGitter>
<Sija> @asterite's comment from the end of '17 seems welcoming (well, sort of ;)): ⏎ ⏎ > If someone wants to implement this, please do so and send a PR. It should support kind of like instance variables, similar to what you can do in `rspec` or `spec2.cr` or `minitest`, otherwise it's pretty pointless. ⏎ > ⏎ > Good luck 😉 [https://gitter.im/crystal-lang/crystal?at=5c5f7459d0d640667f42e840]
<FromGitter>
<HarrisonB> @Sija yea, perhaps i misread an earlier PR. sorry for misrepresenting!
<FromGitter>
<Sija> @HarrisonB no worries :)
<FromGitter>
<maiha> Hmm, there seems to be a case that `HTTP::Client` can not handle `gzip` and `chunked` response correctly. Does someone have similar experiences?
<FromGitter>
<maiha> Actual data is `[gzip(chunk1)][gzip(chunk2)]...` , but for example, crystal may handle it as `gzip([chunk1][chunk2]..)`.
<FromGitter>
<maiha> I'll make the minimum code and the issue, when I have a time.
<FromGitter>
<Sija> @maiha sorry, I don't know what to make of this… :/
<FromGitter>
<Sija> maybe `diff`-ing those 2 file would be of some help, dunno...
<FromGitter>
<maiha> yep! :)
<FromGitter>
<iambudi> Sorry to ask shards here. In crystal-db how to use WHERE IN clausa? Using `"SELECT.. WHERE field IN ?", ary` does not work
<FromGitter>
<iambudi> Looks like need to join the array as string with comma separator
<FromGitter>
<Blacksmoke16> yes, you'd have to build it out yourself iirc
<FromGitter>
<Blacksmoke16> if they are strings you'd also have to use `'` the values
<FromGitter>
<Blacksmoke16> but numbers you just need to join them with comma
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 268 seconds]
ashirase_ has joined #crystal-lang
jemc has quit [Ping timeout: 272 seconds]
_whitelogger has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
<FromGitter>
<iambudi> Yes, just wondering if any builtin funcion in crystal to escape string? let say to prevent sql injection?
cyberarm has quit [Ping timeout: 244 seconds]
cyberarm has joined #crystal-lang
<FromGitter>
<HarrisonB> You may not need to escape depending on the context, but `crystal-pg` has `PG::EscapeHelper` for manual escaping if needed
marmotini_ has joined #crystal-lang
<FromGitter>
<iambudi> Thanks. I need to escape since i use string interpolation to set the value for WHERE IN clausa.
<FromGitter>
<r00ster91> do you mean this string interpolation: `"#{123}"`? This sting interpolation doesn't work at runtime. Doing this will result in `#{123}`
marmotini_ has quit [Ping timeout: 245 seconds]
marmotini_ has joined #crystal-lang
<FromGitter>
<bararchy> Thanks for the workaround @Sija
marmotini_ has quit [Ping timeout: 268 seconds]
sagax has quit [Ping timeout: 246 seconds]
sagax has joined #crystal-lang
_whitelogger has joined #crystal-lang
ashirase has quit [Ping timeout: 240 seconds]
ashirase_ has quit [Ping timeout: 268 seconds]
ashirase has joined #crystal-lang
ashirase_ has joined #crystal-lang
marmotini_ has joined #crystal-lang
<FromGitter>
<iambudi> @r00ster91 Yes that interpolation. ⏎ `ary = “(‘a’,’b’,’c')”` ⏎ `SELECT * FROM table WHERE id IN #{ary}`.
<FromGitter>
<iambudi> ary actually come from somewhere as array value and then joined.
<FromGitter>
<Sija> @maiha Did you managed to find out what's the problem with borked gzip output?
jemc has quit [Ping timeout: 250 seconds]
<FromGitter>
<maiha> Not yet. It is difficult to clarify the problem. However, I need the function in business in a hurry. Therefore, I created a binding of `libcurl` first.
<FromGitter>
<bew> Hmm using `Hash` instead of `M` makes it work, maybe an issue with alias in this case?
Groogy has joined #crystal-lang
<FromGitter>
<johanalkstal> Is there a command to quit/stop a command line application programmatically?
<FromGitter>
<talbergs> `exit`
<FromGitter>
<johanalkstal> Sweet and simple. :) Thanks
Groogy has quit [Quit: WeeChat 2.3]
Groogy has joined #crystal-lang
DTZUZO has quit [Ping timeout: 245 seconds]
g- has joined #crystal-lang
<FromGitter>
<talbergs> @bew You think I should open an issue, as if it should work the way I expected?
<FromGitter>
<j8r> ouch recursive aliases
<FromGitter>
<j8r> you can do like JSON::Any and use a struct which has itself as a getter
<FromGitter>
<j8r> IIRC this is a hot topic to keep/remove them - they are known issues
DTZUZU has quit [Quit: WeeChat 2.2]
<FromGitter>
<talbergs> Thanks, I looked at JSON::Any src, and now seems that implementing my own type this way, fits to my problem. I wonder what is the top argument *against* a working/quick recursive hashvalue alias that I tried..
<FromGitter>
<Blacksmoke16> that it kinda defeats the purpose of static typed lang
<FromGitter>
<talbergs> Ok, then we can toss it, providing, a note in docs on that no recursive types supported because of that and here is an example on how to walk around it.
<FromGitter>
<Blacksmoke16> well i mean its not that they *arent* supported, just kind frowned upon
<FromGitter>
<talbergs> Is there an argument to keep it?
<FromGitter>
<Blacksmoke16> as are prob better ways to handle it
<FromGitter>
<talbergs> And if this support puts on extra maintenance burden ... another reason to toss it.
<FromGitter>
<talbergs> > frowned upon ⏎ But there is a case where is needed. Like the json ... cmon is using json now wrong? :o
<FromGitter>
<Blacksmoke16> ;)
<FromGitter>
<talbergs> But this imho is heavy argument "maintenance burden" is the most legit reason ;)
<FromGitter>
<talbergs> Do not exhaust, this language has to win that market!