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 joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
nakilon has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
<adam12> Anybody know if there is a way to `exec` in Crystal - replace the current process with a new process
<FromGitter> <jwoertink> you mean something like `Process.run` ?
<adam12> @jwoertink I don't believe so.
<FromGitter> <jwoertink> Oh, you're talking about ruby's `Kernel.exec`?
<FromGitter> <jwoertink> something in crystal like that?
dannluciano has joined #crystal-lang
<adam12> @jwoertink Yes. I'd like to *replace* the current process. fork and exec, if you know that pattern.
dannluciano has quit [Ping timeout: 260 seconds]
<FromGitter> <jwoertink> Well, you could use `Process.fork` and the `system` method. I've never really used that pattern though, so I'm not sure if that's the same or not
snsei has joined #crystal-lang
<FromGitter> <jwoertink> Hey all, I have my first iteration of Fez just about done. https://github.com/jwoertink/fez I'd like to get some feedback on it. If anyone has a project to start, let me know if you run in to errors. Feel free to post in issues.
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
willl has quit [Quit: Connection closed for inactivity]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
nakilon has quit [Ping timeout: 244 seconds]
snsei has joined #crystal-lang
snsei_ has quit [Ping timeout: 240 seconds]
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 240 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 258 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Read error: Connection reset by peer]
onethirtyfive has joined #crystal-lang
soveran has joined #crystal-lang
dannluciano has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
snsei_ has joined #crystal-lang
dannluciano has quit [Ping timeout: 240 seconds]
snsei has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
ome has joined #crystal-lang
soveran has quit []
<FromGitter> <sdogruyol> @jwoertink
<FromGitter> <sdogruyol> Gonna try it
soveran has joined #crystal-lang
ponga has joined #crystal-lang
<BlaXpirit> jwoertink, have you found a solution? if not, at the very you could maybe bind http://linux.die.net/man/3/execvp
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
xaxes` has quit [Ping timeout: 250 seconds]
zodiak_ has joined #crystal-lang
zodiak has quit [Ping timeout: 240 seconds]
xaxes` has joined #crystal-lang
Ven_ has joined #crystal-lang
mark_661 has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
xaxes` has quit [Ping timeout: 250 seconds]
matp has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
xaxes` has joined #crystal-lang
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 250 seconds]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14> we have it binded in LibC
<RX14> process.run already forks and calls execvp
trapped has joined #crystal-lang
<RX14> it's a bit clunky to use
<BlaXpirit> the thing is they do not want to fork
<RX14> so?
<RX14> i showed that code as an example of how to use exec() in crystal
<RX14> you don't need to fork, it just happens that that example does
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Ven_ has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 250 seconds]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
Philpax has joined #crystal-lang
soveran has joined #crystal-lang
<FromGitter> <sdogruyol> can i use JSON.mapping for hashed?
<FromGitter> <sdogruyol> hashes*
soveran has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <sdogruyol> I'm trying to do something like fetch user_id and cast it to Int32 if it exists or return ""
<FromGitter> <sdogruyol> ```transaction.fetch("user_id", "").as(Int32)```
<FromGitter> <sdogruyol> is this the correct approach?
Ven_ has joined #crystal-lang
<BlaXpirit> sdogruyol, what, it's supposed to return either a number or an empty string???
triangles has joined #crystal-lang
<FromGitter> <sdogruyol> yep
Philpax has quit [Read error: Connection reset by peer]
<FromGitter> <sdogruyol> if it exists it should cast to Int32
<FromGitter> <sdogruyol> eitherwise empty string
Philpax has joined #crystal-lang
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 258 seconds]
Oliphaunte has joined #crystal-lang
matp has joined #crystal-lang
<RX14> thats weird
<RX14> why not nil
<FromGitter> <sdogruyol> Nil is also ok
<FromGitter> <sdogruyol> My question remains the same :)
dannluciano has joined #crystal-lang
<BlaXpirit> no it doesnt
<FromGitter> <sdogruyol> How?
<BlaXpirit> sdogruyol, https://carc.in/#/r/14u5
soveran has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vK7VL
<crystal-gh> crystal/master d422f32 Ary Borenszweig: Compiler: removed unused `scope` property of Const
<crystal-gh> crystal/master 84ae5cd Ary Borenszweig: Compiler: more code simplifications...
soveran has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<travis-ci> crystal-lang/crystal#84ae5cd (master - Compiler: more code simplifications): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/147468308
Oliphaunte has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
Oliphaunte has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vK79K
<crystal-gh> crystal/master e592bc8 Ary Borenszweig: Improve error message when finding a comma in a macro expression. Fixes #3048
<travis-ci> crystal-lang/crystal#e592bc8 (master - Improve error message when finding a comma in a macro expression. Fixes #3048): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/147493072
Ven_ has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vK7bt
<crystal-gh> crystal/master 82fcf2b Ary Borenszweig: Fixed #3050: preserves order of instance vars
Ven_ has joined #crystal-lang
Redfoxmoon has quit [Changing host]
Redfoxmoon has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#82fcf2b (master - Fixed #3050: preserves order of instance vars): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/147504218
soveran has quit [Remote host closed the connection]
<FromGitter> <jwoertink> @BlaXpirit Thanks for the suggestion on the exec, @adam12 was looking for something like ruby's Kernel.exec. Looks like Process.run would work
<adam12> @jwoertink I am pretty sure Process.run already uses execvp under the hood. Not sure what the change would be to convert it into Kernel.exec style.
<FromGitter> <jwoertink> I'm not too sure either. I've never had a reason to use it. Are you trying to write something like spork?
<adam12> @jwoertink Something like Godrb, if you are from Ruby land.
<FromGitter> <jwoertink> oh so process monitoring?
<FromGitter> <jwoertink> yup, I grew up in ruby land :D
<adam12> @jwoertink Yeah, I need something to replace runit for my Ruby apps. I thought I'd roll my own non-memory-leaking-Godrb. LOL.
<FromGitter> <jwoertink> LOL! Yeah, I was gonna say, god really didn't work that well. I usually use monit, (which also has a ton of issues)
<FromGitter> <jwoertink> plus, trying to google for "god kill workers" was really tough
<adam12> @jwoertink I use monit as well, but not for running applications. I feel like I want something similar to `pm2` from node land, but without node :) Something where Joe-user can manage processes themselves. No sudo, no systemd, no upstart, etc.
<adam12> That accepts a Procfile and knows what to do with it, but isn't full on Docker/Dokku/whatever.
<FromGitter> <jwoertink> so like foreman?
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
<adam12> Foreman is closer? But I want to daemonize it and then communicate over sockets.
<adam12> And maybe support multiple apps. I dunno.
<FromGitter> <jwoertink> that would be nice. Foreman has a tendency to not release ports when stopped
<FromGitter> <jwoertink> multiple apps is already supported
<FromGitter> <jwoertink> In foreman, you can link to other procfiles from a main one
<adam12> I didn't know that. I woudl say foreman is close, but pm2 likely closer.
<FromGitter> <jwoertink> `bar: PORT=3001 RAILS_ENV=development RACK_ENV=development foreman start -f ./bar/Procfile`
<FromGitter> <jwoertink> that's from an app that my company has
mark_661 has quit [Quit: Leaving.]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vK5fV
<crystal-gh> crystal/master c9bc500 Ary Borenszweig: Compiler: fix (regular) assignment of proc to C struct/union
<crystal-gh> crystal/master 8ab7321 Ary Borenszweig: Compiler: removed unused instance variable
Philpax has quit [Ping timeout: 252 seconds]
globalkeith has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomchapin has joined #crystal-lang
<travis-ci> crystal-lang/crystal#8ab7321 (master - Compiler: removed unused instance variable): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/147522380
ponga has quit [Quit: Connection closed for inactivity]
<BlaXpirit> i just had a thought, why are `===` and `=~` separate things?
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
willl has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox_ has quit [Remote host closed the connection]
iamstef_ is now known as iamstef
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
kulelu88 has joined #crystal-lang
kulelu88 has joined #crystal-lang
kulelu88 has quit [Changing host]
kulelu88 has quit [Quit: Leaving]
kulelu88 has joined #crystal-lang
<FromGitter> <jwoertink> Because one returns boolean, and one uses regex?
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5797a833d155b0294e0bf7c6]
<BlaXpirit> >> {"a" =~ /a/, "a" === /a/}
<DeBot> BlaXpirit: # => {0, false} - https://carc.in/#/r/14um
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
<crystal-gh> [crystal] asterite opened pull request #3051: Add `@[Extern]` attribute (master...feature/extern2) https://git.io/vK5uc
Oliphaunte has joined #crystal-lang
rolha has quit [Quit: Textual IRC Client: www.textualapp.com]
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
globalkeith has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Oliphaunte has quit [Remote host closed the connection]
dannluci1no has joined #crystal-lang
dannluciano has quit [Ping timeout: 265 seconds]
<tilpner> Is there something prettier than items = entry_xml.children.map { |x| Item.new x }? How can I pass Item.new to map as a block?
<BlaXpirit> tilpner, I don't think there is. wanted it myself many times
<BlaXpirit> >> [1,2,3].map &->UInt8.new(Int32)
<DeBot> BlaXpirit: # => [1, 2, 3] - https://carc.in/#/r/14uu
<BlaXpirit> pretty sure this is not inlined
<tilpner> Huh, that's not as pretty... &->Item.new(XML::Node) works, but is hardly any better.
<tilpner> Thanks though. :/
<FromGitter> <jwoertink> Not sure what Item is, but you could do something like how rails works with models, and do `items = Item.new(entry_xml.children)`
<FromGitter> <jwoertink> make it take an array or a single element
<FromGitter> <jwoertink> and because crystal is awesome and does method overloading, you can have two initialize :D
fryguy9 has joined #crystal-lang
fryguy9 has quit [Client Quit]
<asterite> I don't think `{ |x| Item.new x }` is ugly
<asterite> and if you try to make it prettier it'll probably turn uglier
<willl> https://carc.in/#/r/14uw makes it a little prettier, but I don't think it's worth it
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
Raimondii has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Raimondi^1 has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii has quit [Ping timeout: 240 seconds]
Raimondi^1 is now known as Raimondi
Raimondi is now known as Raimondii
<crystal-gh> [crystal] Exilor opened pull request #3052: IO#encoding fix (master...patch-1) https://git.io/vK57W
Raimondii is now known as Raimondi
soveran has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] Exilor opened pull request #3053: IO#encoding specs (master...patch-2) https://git.io/vK5b8
<crystal-gh> [crystal] Exilor closed pull request #3053: IO#encoding specs (master...patch-2) https://git.io/vK5b8
rolha has joined #crystal-lang
matp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
matp has joined #crystal-lang
nakilon has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
globalkeith has joined #crystal-lang
globalkeith has quit [Client Quit]
onethirtyfive has quit [Remote host closed the connection]
rolha has quit [Remote host closed the connection]
rolha has joined #crystal-lang
onethirtyfive has joined #crystal-lang
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vKdIT
<crystal-gh> crystal/master bc29cf0 Ary Borenszweig: Parser: check duplicate block argument names. Related to #3054
<crystal-gh> crystal/master 443572e Ary Borenszweig: Fixed #3054: ignore underscore block arguments in codegen
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
<travis-ci> crystal-lang/crystal#443572e (master - Fixed #3054: ignore underscore block arguments in codegen): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/147623193