<FromGitter>
<Blacksmoke16> to whatever class you're in
<FromGitter>
<Blacksmoke16> since you have access to the same object pretty much anywhere, you could inject the store into a HTTP handler to generate a requetID for a http request and set it on the object, then inject the store into some logger class to set that id on log that happen from that http request, or inject into a controller to add it to response headers
<FromGitter>
<Blacksmoke16> are also some other things you can do but thats the general idea
<FromGitter>
<Blacksmoke16> can also register multiple services based on the same class
olbat[m] has joined #crystal-lang
Raimondi has quit [*.net *.split]
mps has quit [*.net *.split]
<FromGitter>
<Blacksmoke16> as well as add tags to services and then get an array of services that have that tag. This would be useful for a param conversion type deal. i.e. have endpoint like `GET /syndication/partner/{partner_id}/feed`, define a custom param converter, get services tagged `feed_partner`, find the one that has that ID or throw an exception, then pass that obj into the controller
<FromGitter>
<Blacksmoke16> adding new partners would just be adding another register annotation to that clas
<FromGitter>
<watzon> Wait, did I miss Crystal adding decorators?
<FromGitter>
<Blacksmoke16> Been around for a little while
<FromGitter>
<Blacksmoke16> I can give you some links if you would like
<FromGitter>
<watzon> Added sometime in the last 6 months?
<FromGitter>
<watzon> I would love some haha
<FromGitter>
<Blacksmoke16> about a year ago
<FromGitter>
<Blacksmoke16> are one of the least documented features atm tho
<FromGitter>
<tenebrousedge> @pynixwang from that page: (but it is certainly not cryptographic: I think attack with choosen plaintext and known hashsum will succeed with little effort)
<FromGitter>
<j8r> How can we use namedtuple with heredocs?
<FromGitter>
<Blacksmoke16> assign it to a var first?
<FromGitter>
<j8r> that's ugly
<FromGitter>
<j8r> and unpractical, no better way?
<FromGitter>
<tenebrousedge> @olbat it seems to be missing the VERSION file
<FromGitter>
<tenebrousedge> copying that produces `crystal eval 'require "compiler/crystal/**"; print Config.default_target' ⏎ Error in line 1: undefined constant Config`
<FromGitter>
<Blacksmoke16> not that i can think of
<olbat>
Yup I saw that but relative to Crystal's install path on my system (Archlinux) this file would be located at /usr/lib/VERSION which does not seems right :)
<FromGitter>
<tenebrousedge> @olbat I'm pretty sure it would be looking for it in `/usr/lib/crystal/VERSION`
<olbat>
@tenebrousedge Oops, I guess I should call Crystal::Config.default_target
<olbat>
(I installed Crystal from the official arch distrib)
bars0 has quit [Ping timeout: 246 seconds]
<FromGitter>
<tenebrousedge> you may want to file a bug with the maintainers, then. The file is present in the source repository. In the meantime, you have the contents of the file available, and you can work around this error.
<olbat>
Ok that makes sense :) Do you know if the core team is maintaining this specific package?
<FromGitter>
<tenebrousedge> I do not
<olbat>
Ok I'm going to check, thank you for your help and for your time! :)
<FromGitter>
<tenebrousedge> yvw
<olbat>
Erm, I tried to do the same test on Debian as well as with the official Docker image (which is Ubuntu based) and got the same issue... Either the DEB packaging is affected by this issue as well or there is something wrong with my test...
<FromGitter>
<tenebrousedge> one or the other, for sure
sz0 has quit [Quit: Connection closed for inactivity]
<olbat>
I tried to manually create the file but now I'm running into this issue: https://pastebin.com/TBvnrVZa... Still not sure this new problem is not also packaging-related :s
<livcd>
did you guys see some of the new rubykaigi videos?
waheedi has quit [Quit: waheedi]
<FromGitter>
<mwlang> when writing Ruby gems, it's a best practice to include as first line of all source files the following: ```# encoding: utf-8``` Is this also a convention or practice with Cyrstal?
<FromGitter>
<Blacksmoke16> i havent seen it so prob not
<FromGitter>
<tenebrousedge> I don't think magic comments exist in Crystal ?
alexherbo28 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 244 seconds]
<FromGitter>
<Blacksmoke16> kinda but not like that
<FromGitter>
<Blacksmoke16> are some special things in comments, but they are mostly used for the docs command
<FromGitter>
<Blacksmoke16> like `:nodoc:`
<FromGitter>
<mwlang> ok, good to know. This on in Ruby controls the system-level encoding of strings, which primarily affects default encoding of strings read from file or IO objects.
<FromGitter>
<Blacksmoke16> all strings in crystal are utf8 anyway
<Yxhuvud>
mwlang: it used to be a best practice in ruby for a couple of versions, but then they changed the default to utf8 and made it redundant.
alexherbo285 has joined #crystal-lang
alexherbo28 has quit [Read error: Connection reset by peer]
<FromGitter>
<r00ster91> what I want to do is I want to have special properties for an array inside of an array (two-dimensional) but I don't want to have that directly in the array with the other things because then I would iterate over it too and that would require something to make that not happen which will cost some speed. I already tried storing it out of bounds which worked somewhat but that also lead to a corrupted
<FromGitter>
... instruction once so it really is unsafe. Now I maybe just add these properties to `Array` directly instead of a struct with the properties and the array seperated