ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
alex``` has quit [Quit: WeeChat 2.4]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ashirase has joined #crystal-lang
<FromGitter> <watzon> Typically an instance of the `pp` macro breaking something wouldn't actually be because of the macro, but because of the variable the macro is attempting to print. You'd probably have the same problem with `puts` or any other operation performed on the variable.
<FromGitter> <sdogruyol> Hey everyone πŸ‘‹ Have a great week πŸŽ‰
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ashirase has quit [Ping timeout: 258 seconds]
ashirase has joined #crystal-lang
<FromGitter> <pynixwang> `Array(Int64 | String)` or `Array(Int64) | Array(String) `?
<FromGitter> <pynixwang> confused.
<FromGitter> <wernerj> I’d say it depends whether the array itself can contain elements of mutiple types or it’s either an array of strings or an array of integers.
<FromGitter> <j8r> Yes, that either a single array that can have a mix of T and U. ⏎ Or, either an Array of T or an Array of U
<FromGitter> <j8r> If you have the choice, the latest one is simpler to deal with: you can do a `if array.is_a? Array(Int64)` and no more union
<FromGitter> <pynixwang> topics - Array: An array of values which must each appear in the log entries. The order is important, if you want to leave topics out use null, e.g. [null, '0x12...']. You can also pass an array for each topic with options for that topic e.g. [null, ['option1', 'option2']]
<FromGitter> <pynixwang> a little complex
<FromGitter> <pynixwang> use JSON::Any?
<FromGitter> <pynixwang> or alias Topic::Any = Array(Topic::Any | String | Nil )
laaron has quit [Remote host closed the connection]
<FromGitter> <pynixwang> I hate type .
laaron has joined #crystal-lang
<FromGitter> <j8r> do you hate having types when using a library?
<FromGitter> <pynixwang> yes.
<FromGitter> <j8r> That's tremendously useful, that's a nightmare in Python
<FromGitter> <j8r> we never know what's returned, what we can do. We cross the fingers not to have runtime exceptions
<FromGitter> <j8r> thankfully with type annotations, the situation improves a bit
<FromGitter> <j8r> For JSON here, you can use `JSON::Serializable`
duane has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <vladfaust> Hi! Need some Linux help. I'd like to run a Crystal script under root, but execute some shell scripts from that Crystal process logged in as another user. Is that possible? Given that `su` is not a real shell session, and I need a real one -- with restrictions and `/run/user/<id>`
<FromGitter> <yxhuvud> depending on linux variant, I think there is a config file somewhere where you can configure ways to get elevated rights, on a per user level. .
<FromGitter> <mavu> @vladfaust the way that is usually done is to fork the process and drop root privileges in the child branch, while continuing / keeping root in the main one.
<FromGitter> <vladfaust> @mavu you're suggesting to `Process.fork` and then `unshare`?
<FromGitter> <mavu> i have never done this myself, its just "the way things are done" (tm)
<FromGitter> <mavu> you basically just fork, and in the child call setuid with the new one.
<FromGitter> <mavu> (I think)
<FromGitter> <mavu> if you need to be extra well behaved, you also setgid.
<FromGitter> <mavu> and apparently it matters in which order you do it? (like I said, never done that, but I think that should be it)
<FromGitter> <vladfaust> Thank you, @mavu! That should work
<FromGitter> <mavu> you're welcome
duane has quit [Ping timeout: 246 seconds]
<FromGitter> <vladfaust> I guess, Crystal doesn't have `setuid` function yet?
<FromGitter> <vladfaust> Bummer that I can't use it now
duane has joined #crystal-lang
<FromGitter> <vladfaust> Actually, I can. I just copy-paste code from https://github.com/crystal-lang/crystal/pull/7822 into my program πŸŽ‰
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<FromGitter> <Prutheus> I often get a SSL_write: I/O error from my HTTP::Client - has nothing to do with the endpoint, it just crashes ... why? is it a bug in crystal?
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
alex`` has joined #crystal-lang
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
mistergibson has quit [Quit: mistergibson]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
alex`` has quit [Ping timeout: 248 seconds]
alex`` has joined #crystal-lang
<RX14> finally finished with exams so hope to be getting back to crystal work!
<FromGitter> <Blacksmoke16> grats :p
<FromGitter> <Blacksmoke16> welcome back
duane has quit [Ping timeout: 258 seconds]
alex`` has quit [Ping timeout: 248 seconds]
alex`` has joined #crystal-lang
jcs has joined #crystal-lang
rohitpaulk has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <dscottboggs_gitlab> http://crystal-shards.xyz/ seems to be down
<FromGitter> <r00ster91> don't you mean https://crystalshards.xyz/?
<FromGitter> <dscottboggs_gitlab> I see.
<FromGitter> <dscottboggs_gitlab> whoops
<FromGitter> <Blacksmoke16> :p
<FromGitter> <watzon> There's also crystalshards.org
<FromGitter> <r00ster91> seems like the same thing but a different theme
<FromGitter> <watzon> It pretty much is. Hosted in a different place though, so if one goes down the other should still be up
duane has joined #crystal-lang
<FromGitter> <sam0x17> flag to tell if we are in `crystal spec` mode vs `shards build` mode?
<FromGitter> <sam0x17> I could define a flag in my spec_helper.cr file but was wondering if there is some built in way
<FromGitter> <r00ster91> I'd try `flag?(:spec)`
<FromGitter> <sam0x17> I'll try that thanks
<FromGitter> <Blacksmoke16> i dont think thats a thing
<FromGitter> <Blacksmoke16> you can define your own flags tho
<FromGitter> <Blacksmoke16> i.e. `crystal spec -Dspec`
<FromGitter> <Blacksmoke16> which would allow you to use `flag?(:spec)`
<FromGitter> <j8r> @sam0x17 probably you are doing something wrong if you need this type of flags...
<FromGitter> <j8r> Perhaps your code isn't flexible enough
<FromGitter> <j8r> RX14: don't feel forced to work on Crystal – please us and take some vacation :)
<RX14> haha there's plenty of holidays coming
<RX14> i'll be fine, thanks for worrying :)
duane has quit [Ping timeout: 248 seconds]
maxpowa has quit [Ping timeout: 252 seconds]