<FromGitter>
<wwselleck> Trying to get into crystal by writing a simple HTTP server using no 3rd party shards. Before I go writing this functionality myself, there's no built in path variable functionality, right? Something that matches `/foo/1/bar/2` to `/foo/:idFoo/bar/:idBar`?
<FromGitter>
<wwselleck> Or anything like that
chemist69 has quit [Ping timeout: 250 seconds]
chemist69 has joined #crystal-lang
juturnas has joined #crystal-lang
ht_ has joined #crystal-lang
_whitelogger has joined #crystal-lang
gangstacat has joined #crystal-lang
_whitelogger has joined #crystal-lang
juturnas has quit [Remote host closed the connection]
<FromGitter>
<Blacksmoke16> @wwselleck nothing built in. would have to write a router, or at least use a shard that handles the routing for you
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
Welog has joined #crystal-lang
<Welog>
hello I create objects and put them in an array. when I do not need one object anymore, I deleted it from the array. I guess the object is still allocated in memory but I didn't need it anymore... How can I deal with this point ? Should I use GC.free each time I deleted an object entry from my array of objects ? thanks for your tips/help :)
sorcus has quit [Ping timeout: 245 seconds]
<FromGitter>
<Blacksmoke16> pretty sure the GC should handle it for you
Pistos has joined #crystal-lang
hypercore has quit [Ping timeout: 260 seconds]
<Pistos>
(new to Crystal) Is there a centralized package repo? Or at least, an official(ish) list of the most popular decentralized packages? Or is there a lack on purpose?
<FromGitter>
<Blacksmoke16> packages are just retrieved from github/gitlab
<FromGitter>
<yxhuvud> Pistos: There is a lack on purpose as running and developing a package repository takes resources that could be used for other things. Might it be the case that someone at some points add a repo? Sure, but I don't see it happening unless we grow out of the current model. Which might not happen. I expect Go to show the way there as they (IIRC) have a similar model.
<FromGitter>
<asterite> @Blacksmoke16 that wiki page is waaaaaaaaaaay outdated :-(
<FromGitter>
<Blacksmoke16> 😬
<FromGitter>
<asterite> actually, maybe not that outdated
<FromGitter>
<asterite> just some names changed but the basic idea is the same
<FromGitter>
<asterite> :-)
<FromGitter>
<Blacksmoke16> thats good at least
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
<Pistos>
yxhuvud: Okay, so it's by design. So, what does a typical Crystal developer do when they don't know if a given library exists, but want to search for the most popular one(s) that the Crystal community tends to use? Common stuff like DB interfacing, ORMs, networking (HTTP, REST), stuff like that. Just websearch?
<FromGitter>
<Blacksmoke16> awesome-crystal, google, or ask here would prob be your best bet
<FromGitter>
<Blacksmoke16> or search github
<Pistos>
Blacksmoke16: Okay. Thanks for your responses, by the way.
<FromGitter>
<Blacksmoke16> np, looking for anything in particular?
<Pistos>
No, I'm just gauging the language and ecosystem as a whole.
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<yxhuvud> TBH, I can't remember ever looking at the npm or rubygem websites for discovering libraries either. repositories have other upsides, but discovery seems a very limited part of that.
sorcus has joined #crystal-lang
<jhass>
mh, rubygems.org I used a lot for that, pypi.org just the other day even
<Pistos>
Hm. Well, what can I say; I use npm's site almost exclusively for module searches, and rubygems.org for occasional searching (in addition to plain websearching).
<FromGitter>
<Blacksmoke16> another thing to take into consideration is there are prob much much much more npm modules than crystal shards
<FromGitter>
<Blacksmoke16> so id imagine most people are aware of the more popular ones that still work
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
<FromGitter>
<Blacksmoke16> on another note, did something change with fiber/http server works?
HumanG33k has joined #crystal-lang
<FromGitter>
<Blacksmoke16> i used to have a method ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ that would run a server in a fiber, then test it using the yielded client, however now it errors with `Connection refused` [https://gitter.im/crystal-lang/crystal?at=5d8b84b7bae2907f6c363aec]
<FromGitter>
<Blacksmoke16> the server is deff running, i can get the correct response via postman if i add in some more sleeps
<FromGitter>
<alehander42> this doesnt work on my machine
<FromGitter>
<alehander42> leads to "siganture not available"
<FromGitter>
<alehander42> W: GPG error: https://dist.crystal-lang.org/apt crystal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 09617FD37CC06B54
<FromGitter>
<Blacksmoke16> so guess ill just have to do the `run_server` within each it block vs having one globally available, or just make the client a constant or something
<FromGitter>
<jwoertink> Anyone know if there's a way to fire a callback function when an HTTP::Server closes?
<FromGitter>
<jwoertink> Or maybe there's a better way to do this....
<FromGitter>
<jwoertink> Ok, so my issue is, I'm running specs on LuckyFlow which boots up a chromedriver instance. When the specs are done, chromedriver process is still active
<FromGitter>
<jwoertink> I have a `at_exit { }` block in my spec_helper, but it seems that in crystal 0.31, that now runs before the specs are done
<FromGitter>
<jwoertink> and `Spec` doesn't have any way to call when all specs are done running
<FromGitter>
<jwoertink> My thought was that when the specs are done, the http server closes itself somehow. Maybe there's a way to hook in to that? But I'm not seeing anything
<FromGitter>
<Blacksmoke16> Reopen close and add some code?
<FromGitter>
<jwoertink> I tried reopening `Spec.run` so I could add it in there
<FromGitter>
<jwoertink> but I get that `Module validation failed` bug
Pistos has left #crystal-lang ["WeeChat 2.4"]
<FromGitter>
<jwoertink> unless I run specs with `--no-debug`
<FromGitter>
<jwoertink> Is there a way to set that flag programatically? 😅
<FromGitter>
<didactic-drunk> pistos: shards.info. It dependency info similar to rubygems.org.
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.6]
rohitpaulk has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 240 seconds]
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
<FromGitter>
<bew> @jwoertink yes, it looks like that now specs are only gathered (not executed) when you define them, and they all execute from an at_exit handler (to make sure they are run after all spec it blocks are defined)..
<FromGitter>
<bew> As a consequence, if your `require "spec"` (it installs its at_exit handler) then you add yours, they will be executed in reverse order, first yours then Spec's..
<FromGitter>
<asterite> we need to add Spec.after(:suite) or something
<FromGitter>
<jwoertink> ^ that for sure 😂
<FromGitter>
<jwoertink> Anyone here have some experience using travis ci?
<FromGitter>
<Blacksmoke16> a bit, been switching my stuff to GH actions tho
<FromGitter>
<jwoertink> My specs fail because of "undefined method", but that method exists...
<mps>
I asked straight_shoota about that but looks like he is busy or not online
<mps>
I prepared build and everything is ready to upgrade to 0.31.0, just missing this commit hash for version
<jhass>
I think having the commit there is rather optional, especially for release builds, it's easy to figure out from the version. So just setting it empty should be legit
<mps>
jhass: I thought just that, but was not sure because straight_shoota posted that merge request
<jhass>
also if you just not set it now it should no longer appear
<FromGitter>
<bew> (@barachy you found it first :P)
<FromGitter>
<repromancer_gitlab> I’ve been reading up on `abstract def` and return type restrictions. Is there ⏎ any way I could achieve something like the following? E.g. Count would be ⏎ required to return Count::Output. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8bfcfbf8b2736b3877be78]
<FromGitter>
<Blacksmoke16> not if its a class method
<FromGitter>
<Blacksmoke16> less you do some macro magic
<FromGitter>
<Blacksmoke16> @repromancer_gitlab
<FromGitter>
<repromancer_gitlab> @Blacksmoke16 yeah, I've been thinking it may require a macro, which smells like I probably should just do something else for now, lol
<FromGitter>
<Blacksmoke16> abstract defs are only for instance methods, would be nice if you could define abstract class methods, or interface for them but :shrug:
<FromGitter>
<repromancer_gitlab> oh, you can
<FromGitter>
<Blacksmoke16> hm?
<FromGitter>
<repromancer_gitlab> oh, I left the `self` in by accident
<FromGitter>
<repromancer_gitlab> meant to have a simpler example with instance methods