ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <wwalker> anyone using crystal to push bulk docs into elasticsearch? If so, which of the shards are you using? (Before I go write code, test, and benchmark the 8 top hits ...)
<FromGitter> <revskill10> Hi, all , could you help me rewrite this Ruby in Crystal ? (I want to puts method as argument to another method) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=63daffbf0c9327234707b95d]
quazimodo has quit [Ping timeout: 248 seconds]
quazimodo has joined #crystal-lang
<FromGitter> <Blacksmoke16> uhh
<FromGitter> <wwalker> That is a succinct response. ⏎ ⏎ I had to open irb to see how that worked in ruby...
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ is what i came up with [https://gitter.im/crystal-lang/crystal?at=63db3f4c5fb4132b5d9bed40]
wwalker has left #crystal-lang [#crystal-lang]
<FromGitter> <Blacksmoke16> @revskill10
ur5us has quit [Ping timeout: 255 seconds]
_whitelogger has joined #crystal-lang
uncomfy has joined #crystal-lang
uncomfy has quit [Quit: uncomfy]
_ht has joined #crystal-lang
ur5us has joined #crystal-lang
Sankalp has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
Sankalp has joined #crystal-lang
ur5us has quit [Ping timeout: 248 seconds]
<FromGitter> <revskill10> @Blacksmoke16 Thanks for the partial trick. Is it to currying a method ?
hightower2 has quit [Ping timeout: 248 seconds]
jmdaemon has quit [Ping timeout: 252 seconds]
Sankalp has quit [Ping timeout: 256 seconds]
Sankalp has joined #crystal-lang
hightower2 has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 248 seconds]
quazimodo has quit [Ping timeout: 248 seconds]
<FromGitter> <Blacksmoke16> im not too familiar with what that means
brycek has joined #crystal-lang
<brycek> am i holding something wrong? trying to work with a `IO::Memory | File` and it keeps flattening into a `IO` and losing the `size` method
<FromGitter> <Blacksmoke16> got some example code?
<brycek> alias IOBuf = IO::Memory | File
<brycek> typeof(IO::Memory.new.as(IOBuf))
<brycek> (working on a bigger reproducer)
<FromGitter> <Blacksmoke16> right, but whats the use case you need a union of those two?
<brycek> conditionally reading the output of a process from stdout buffered in the memory buffer or from a file on disk
<brycek> got a workaround where there's a getter that returns the union type but it's gonna bug me still
<FromGitter> <Blacksmoke16> pretty sure thats just the compile time type, and could still use overloads of `is_a?` checks to handle it
<FromGitter> <Blacksmoke16> overloads or*
<brycek> so the compiler finds a common ancestor as an optimization or something?
<FromGitter> <Blacksmoke16> deff would be easier to just base your implementation on `IO` tho
<brycek> the other half is i'm trying to figure out the `size` which doesn't make sense for, like, an fd or socket
<FromGitter> <Blacksmoke16> what are you using the size for?
<brycek> killing the subprocess if it goes past the output limit
<FromGitter> <Blacksmoke16> related: https://github.com/crystal-lang/crystal/issues/9050
<FromGitter> <Blacksmoke16> can you just leverage https://crystal-lang.org/api/master/IO/Sized.html ?
<FromGitter> <Blacksmoke16> to just have it stop reading once a certain amount is read
<brycek> possibly? i'm a bit fuzzy with how that works with an `IO::Memory` on a subprocess's stdout
<brycek> how that'd work, rather
<brycek> this was mostly a curiosity question tbqh
<FromGitter> <Blacksmoke16> do you have to use the `IO::Memory`? iirc theres a block version of `Process.run` that exposes the output of the process as its happening
<brycek> the destination for the buffer's the database, so it's going to linger around in an io::memory anyways (the process dies afterwards so using a memory buffer is less risk of filling up the disk)
fifr_ has quit [Read error: Connection reset by peer]
fifr_ has joined #crystal-lang
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ something like this? [https://gitter.im/crystal-lang/crystal?at=63dbdf25a24223243864c053]
<FromGitter> <Blacksmoke16> creates a string of the processes output up to size n, terminating the process once that size is reached
<brycek> still need to write the tests for that heh
fifr- has joined #crystal-lang
fifr_ has quit [Ping timeout: 248 seconds]
fifr- has quit [Read error: Connection reset by peer]
fifr_ has joined #crystal-lang
fifr- has joined #crystal-lang
fifr_ has quit [Ping timeout: 252 seconds]
fifr- has quit [Read error: Connection reset by peer]
fifr_ has joined #crystal-lang
fifr- has joined #crystal-lang
fifr_ has quit [Ping timeout: 268 seconds]
jmdaemon has joined #crystal-lang
__ht has joined #crystal-lang
__ht has quit [Client Quit]
_ht has quit [Ping timeout: 268 seconds]
_ht has joined #crystal-lang
Sankalp has quit [Ping timeout: 252 seconds]
Sankalp has joined #crystal-lang
ur5us has joined #crystal-lang
_ht has quit [Quit: _ht]
_ht has joined #crystal-lang
ua_ has quit [Ping timeout: 252 seconds]
ur5us has quit [Ping timeout: 255 seconds]
ua_ has joined #crystal-lang
ur5us has joined #crystal-lang
taupiqueur1 has joined #crystal-lang
taupiqueur has quit [Ping timeout: 252 seconds]
taupiqueur1 has quit [Ping timeout: 248 seconds]
taupiqueur1 has joined #crystal-lang
taupiqueur2 has joined #crystal-lang
taupiqueur1 has quit [Ping timeout: 248 seconds]
taupiqueur2 has quit [Ping timeout: 248 seconds]
taupiqueur2 has joined #crystal-lang
_ht has quit [Quit: _ht]
quazimodo has joined #crystal-lang
Sankalp- has joined #crystal-lang
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp- is now known as Sankalp