Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter>
<faustinoaq> Hey, Do we already have a github bot made in crystal? I want to create and delete tags automatically depending if an Issue or PR is closed/opened. I did a quick search but I didn't find anything: http://crystalshards.xyz/?filter=bot 😅
Yxhuvud has joined #crystal-lang
cptaffe has quit [Ping timeout: 246 seconds]
byteflame has quit [Ping timeout: 256 seconds]
Renich has quit [Ping timeout: 246 seconds]
fifr[m] has quit [Ping timeout: 240 seconds]
thunker[m] has quit [Ping timeout: 240 seconds]
olbat[m] has quit [Ping timeout: 276 seconds]
braidn[m] has quit [Ping timeout: 255 seconds]
kixune[m] has quit [Ping timeout: 255 seconds]
kp666[m] has quit [Ping timeout: 256 seconds]
<FromGitter>
<plainas> why can't class instance variables bee of any kind?
Yxhuvud has quit [Ping timeout: 260 seconds]
Yxhuvud has joined #crystal-lang
betofloresbaca[m has quit [Ping timeout: 256 seconds]
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
qard has joined #crystal-lang
qard has quit [Client Quit]
qard has joined #crystal-lang
qard has quit [Ping timeout: 246 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter>
<girng> they can can't they?
<FromGitter>
<girng> depends what type you assign to it?
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
txdv has quit [Ping timeout: 255 seconds]
moei has quit [Quit: Leaving...]
That_Guy_Anon1 has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
That_Guy_Anon has quit [Ping timeout: 265 seconds]
<crystal-gh>
[crystal] bew opened pull request #5954: Fix enum flags assigned values when a member has value 0 (master...fix-enum-flag-0) https://git.io/vpJrQ
txdv has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
rohitpaulk has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter>
<faustinoaq> Hi, how can I get the exit code of `Process.new("mycommand")` ?
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter>
<faustinoaq> Oh, ok, Thank you!, let me try 👍
hmans has quit [Ping timeout: 256 seconds]
^raz^ has joined #crystal-lang
<FromGitter>
<faustinoaq> @ezrast Nice, works perfect! ✨
raz has quit [Excess Flood]
asterite has quit [Ping timeout: 261 seconds]
asterite has joined #crystal-lang
<FromGitter>
<schoening> Good morning good people :) ⏎ I would like to know why I can pass a Proc to a function/method and assign it to a variable but not to a property. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ad572b015c9b03114048893]
<FromGitter>
<schoening> (for irc: I tried editing the code formatting coz the colouring messes up, did not work)
<FromGitter>
<faustinoaq> @schoening Class instance vars need to be typed, specially in the `initializer`
<FromGitter>
<faustinoaq> You can use generics, though
<FromGitter>
<bew> You need to tell to the compiler the type of `@p`
<FromGitter>
<bew> Generic are not always the solution, it depends on the problem :p
<FromGitter>
<faustinoaq> @bew ok 😅
<FromGitter>
<schoening> @bew I tried @faustinoaq code and it does work
<FromGitter>
<schoening> or did u edit it while I looked away
<faustinoaq>
Just a bit I replaced s/does not work/works as well/ ;)
<FromGitter>
<schoening> I read through the documentation on Generics but so uhm... Does it just tell the compiler "look extra hard here for inference" :p? Thats what the docs seem to say haha
<FromGitter>
<schoening> Anyways that is all pretty clever stuff I like it
<faustinoaq>
@schoening Yeah, also you can just specify the type of your proc
<FromGitter>
<bew> Or using the literal proc type syntax: `->` instead of `Proc(Nil)`
<FromGitter>
<bew> (a proc that takes no arguments, and returns nothing interesting)
<FromGitter>
<faustinoaq> 👍
<FromGitter>
<schoening> Cool thanks for the tips guys. I normally only work in TypeScript I was trying to see how to pass callbacks and closures and tried to implement a promises :)
<faustinoaq>
@schoening TypeScript is very nice :)
<FromGitter>
<schoening> Very nice! I use that haha
<FromGitter>
<schoening> The only problem in using TypeScript is that I find it a little cumbersome that I find errors at compile time, not while typing the code haha :D
<wuehlmaus>
i would be delighted if someone could point me to a current answer
rohitpaulk has quit [Ping timeout: 265 seconds]
<wuehlmaus>
i seem to not get Process.new really
<FromGitter>
<straight-shoota> mps, `HTTP::Server.close` will close all current sockets, so it's probably not waiting for exisiting connections to finish
<mps>
straight-shoota: docs says it will wait for active connections to shutdown, but it doesn't
duane has joined #crystal-lang
<FromGitter>
<straight-shoota> yeah, the documentation is probably wrong.
<FromGitter>
<straight-shoota> mps, I was wrong, `#close` seems to shut down gracefully as documented
<FromGitter>
<vlazar> good find, I have the same code as your original and never checked if server actually terminates connections gracefully
<FromGitter>
<vlazar> hmmm, or it's not a bug? :)
<mps>
vlazar: for me it's behavior is bug. I expect it to not close active connections
<FromGitter>
<vlazar> It will process `currently accepted requests`
<mps>
straight-shoota: yes, I looked the source and it looks ok, but doesn't work. I'm crystal newbie so can't debug it
<FromGitter>
<vlazar> I wonder what currently accepted requests mean actually
<mps>
I presume it is accepted connection by the HTTP::Server
<FromGitter>
<straight-shoota> every request that has been initialized by the request processor
<mps>
close method should signal server to stop receiving new connections
<FromGitter>
<straight-shoota> mps, in your example the program terminates because the main fiber has finished
<FromGitter>
<straight-shoota> when you call `server.close` in the signal handler, `server.listen` in the main fiber will return
<FromGitter>
<straight-shoota> just add `sleep 60.seconds` after the last line and you get your expected behaviour
<mps>
I see, should I put signal handler in the block of the HTTP::Server block
<FromGitter>
<straight-shoota> no, that won't change any thing
<FromGitter>
<straight-shoota> for a proper solution you would need to wait for each request to be finished
<mps>
But just adding 60.seconds at the end doesn't actually solve the problem
<FromGitter>
<straight-shoota> I know, see my last line
<FromGitter>
<straight-shoota> it just servers to demonstrate the problem
<wuehlmaus>
no answers to my pipe to less problem? i am really trying to do it but don't get it. Process.new has so many parameters and i just don't get it :(
<mps>
understand, tnx for the help. I thought that I don't understand how it works and the solution is simple
<mps>
I'll try to look at golang solution to implement it in crystal, of course if I managed to understand golang implementation
<FromGitter>
<straight-shoota> I'm currently working on some improvements for HTTP::Server and will try to improve the default implementation
<mps>
nice to hear :)
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter>
<Sjoerrdd> Maybe a weird question for a Crystal developer
<FromGitter>
<Sjoerrdd> but
gewo has quit [Quit: WeeChat 1.6]
<FromGitter>
<Sjoerrdd> I doubt
<FromGitter>
<Sjoerrdd> Should I use NodeJS or Crystal for a website like strawpoll.me?
gewo has joined #crystal-lang
<wuehlmaus>
straight-shoota: thanks for the answer, i try it
<FromGitter>
<bararchy> well, it's simple enough to do with any Crystal framework pretty easy
<FromGitter>
<Sjoerrdd> I made it with Amber ,3
<FromGitter>
<bararchy> oh, it's your site?
<FromGitter>
<Sjoerrdd> strawpoll.me not, but I'm building a clone
<FromGitter>
<Sjoerrdd> x)
<FromGitter>
<Sjoerrdd> school projects, I've to learn a new language or framework, I love Ruby, so I decided to choose Crystal
<FromGitter>
<Sjoerrdd> But I couldn't deploy it to my droplet
hightower2 has joined #crystal-lang
hightower3 has quit [Ping timeout: 256 seconds]
That_Guy_Anon has quit [Remote host closed the connection]
<hmans>
I end up writing a lot of functional code for Crystal (ie. modules with lots of def self.foo, or extend self) and wish Crystal had something like `defm` to create a module-level method
<hmans>
(even if it deviates from the Rubies)
<hmans>
I'm not a big fan of explicitly naming `self` or the module name as a prefix for method names, and I'm not a big fan of `extend self` as it sort of muddles the boundaries between module and instance scope
<hmans>
Ruby has `module_function` as a scope like `private`, `protected` etc.
<hmans>
Any thoughts, anything that I've missed, ...?
<FromGitter>
<bararchy> hmans do you actually preffer writing `module_function def` before each method instead of `extend self` once?
<hmans>
FromGitter: I would indeed, even though I believe `module_function` is very chatty. Overall I would prefer a special form of `def`.
<FromGitter>
<bararchy> well, what ever floats your boat I guess, I would not think many others will find that useful. ⏎ ofc, each to hes own opinion :)
<hmans>
I'm not sure about Crytal, but the problem with `extend self` in Ruby (and the primary reason why it's considered an anti-pattern) is that using it leaves methods on both the module scope and the module's instance scope, which can cause unexpected behavior when the module is intended to be included into other modules (or classes)
<hmans>
(and even if it doesn't, it's at the very least fuzzy design.)
<hmans>
Considering Crystal has `abstract`, maybe it could also have `static` (which, as a prefix to `def`, would have the same effect as Ruby's `module_function`, or `def self.foo`, etc.)
<hmans>
ie. `static def foo; "foo"; end`
<wuehlmaus>
straight-shoota: i don't get the transgression to my less pipe problem, sorry :( https://carc.in/#/r/3w6c. I think a string with 200 lines is a good example so i choosed that.
<crystal-gh>
[crystal] straight-shoota opened pull request #5958: Add spec for HTTP::Server#close (master...jm/feature/http-server-gracefully-close) https://git.io/vpTGG
alex`` has joined #crystal-lang
<livcd>
GraalVM v1.0 got released
<FromGitter>
<fridgerator> whoa, that looks cool
<livcd>
indeed
<livcd>
it's huge
<livcd>
but sadly (or fortunately for Crystal :)) truffleruby is not ready yet
<That_Guy_Anon>
considering that fibers are not real multithreading, is there any speed gain in using them, or are they just for responsiveness and doing different things concurrent.
<livcd>
looks like truffleruby is their most mature truffle language but they say it's still not usable in real world (rails)...I really wonder when we reach the point. Kinda happy about that and to see they do not have that much for python working :P
<FromGitter>
<fridgerator> @eliasjpr 🔮
<FromGitter>
<eliasjpr> 😄
_axx has joined #crystal-lang
shalmezad has quit [Quit: Leaving]
mps has quit [Quit: Lost terminal]
<crystal-gh>
[crystal] straight-shoota opened pull request #5960: Add SSLServer and HTTP::Server#bind_ssl (master...jm/feature/http-server-ssl) https://git.io/vpT0K
<FromGitter>
<sdogruyol> @straight-shoota is on a roll 🔥 💯
<FromGitter>
<straight-shoota> haha
<FromGitter>
<straight-shoota> has just been waiting for #5776