straight-shoota has quit [Ping timeout: 240 seconds]
<FromGitter>
<Blacksmoke16> oprypin: think imma end up just doing `--file NAME`
<FromGitter>
<Blacksmoke16> given i only really support one file at a time its probably fine
<FromGitter>
<Blacksmoke16> nvm
deavmi has quit [Ping timeout: 260 seconds]
<FromGitter>
<Blacksmoke16> oo, how about `./bin/oq --input=yaml -r --arg chart stolon --arg version 1.5.10 '$version' --- data1.yml data2.yml`
<FromGitter>
<Blacksmoke16> i could live with `---`
deavmi has joined #crystal-lang
<FromGitter>
<drinkmorewaters> Can anyone tell me at a quick glance if there is anything 'wrong' with this code, it works but just want to make sure i'm not doing things incorrectly. Thanks! ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ea8e04f97338850a2d60b85]
<FromGitter>
<Blacksmoke16> :thinking:
<FromGitter>
<Blacksmoke16> dont need to do assign all those ivars, using the `@type : String` syntax does that for you
<FromGitter>
<drinkmorewaters> Oh right.
<FromGitter>
<drinkmorewaters> Didn't know that
<FromGitter>
<Blacksmoke16> also whats the reason for using a hash as `Car`?
<FromGitter>
<drinkmorewaters> Coming from JS used to this.type
<FromGitter>
<Blacksmoke16> like cant you just get rid of that method
<FromGitter>
<drinkmorewaters> Used the hash as i wasn't sure how to get the output of the type, price etc.
<FromGitter>
<Blacksmoke16> also `return` isnt needed in those cases, last value in the method is used as the return value
<FromGitter>
<drinkmorewaters> Oh, right. Will note that.
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<william-inf> new to crystal, im trying to figure out why logger has been deprec for log, is there any notes on this? i cannot see any in release notes
<FromGitter>
<Afront> Is spawning a fiber without the `-Dpreview_mt` flag the same thing as spawing a fiber with `same_thread: true `?
<FromGitter>
<Blacksmoke16> i want to say yes, as without `-Dpreview-mt`, there's only one thread, and if you do use that flag and always use `same_thread` then they would also only go on one thread?
<FromGitter>
<tenebrousedge> @drinkmorewaters use a record / struct
<straight-shoota>
@bestwebua You're reading the API docs for a rather old release. `Time.now` has been removed, it's now either `Time.local` or `Time.utc`. Please refer to the current API docs at https://crystal-lang.org/api/0.34.0/Time.html
<FromGitter>
<bestwebua> Thank you so much, noticeable!)
alexherbo2 has joined #crystal-lang
<FromGitter>
<j8r> @bestwebua lol, you're looking at the 0.20.0 version of the API
<raz>
thanks :D but finding them is the smaller part of the challenge ;))
<FromGitter>
<Blacksmoke16> finding them?
<raz>
a tarball of them
<raz>
basically what i want is ^space (alfred), "api cook", enter - and the cookie docs in front of me
<FromGitter>
<Blacksmoke16> ah, i mean well that would be essentially a copy of the API docs
<FromGitter>
<Blacksmoke16> put it somewhere on pc and add a bookmark
<raz>
you are thinking windows 95. i'm thinking... neurolink!
<FromGitter>
<tenebrousedge> what OS?
<raz>
the one with the vegetable
<FromGitter>
<tenebrousedge> on Linux it would be possible, on macOS probably not
<FromGitter>
<tenebrousedge> unless
<FromGitter>
<tenebrousedge> you could probably write a utility called api
<raz>
yea, i could likely be scripted... but prob not as fast and smooth as i need.
<FromGitter>
<tenebrousedge> well write it in Crystal and use ElasticSearch
<raz>
when crystal gets a good OSX gui library i might actually give it a shot
<FromGitter>
<tenebrousedge> why not just have it open in the browser?
<raz>
just needs some advanced api's for global kbd shortcut, popping up a searchbar (like alfred) etc.
<raz>
because that's not an improvement over what i have now - where i end up with dozens of api tabs, many on he same page, at the end of the day
<raz>
anyway, 1st world problems.... i will survive
<FromGitter>
<naqvis> won't ES will be an overkill for such task? Probably something small indexing capability should be sufficient for such number of docs.
<raz>
yes very much.
<FromGitter>
<j8r> I think he was kidding :)
<raz>
but could actually be the lesser evil, given that crystal prob doesn't have bindings to embeddable indexers yet
<FromGitter>
<naqvis> oops, my bad sense of humor lol
<raz>
the line between humor and despair is thin. cf. electron :P
<FromGitter>
<naqvis> ROFL
<raz>
"jesus, guis are hard. let's just bundle... an entire frickin browser"
<FromGitter>
<naqvis> they know HDs are cheap so no one cares 😆
<FromGitter>
<j8r> @naqvis was it you asking for written bytes count in IOs the last day?
<raz>
oprypin: all good, it's not a big deal for me (also i've learned to glance a the url-bar first thing). SEO is a royal pita, thanks to everyone who suffers for us to improve it ;)
<FromGitter>
<Blacksmoke16> can also just emit the version and redirects to latest
<FromGitter>
<Blacksmoke16> or just use `master` and call it a day
<raz>
yea i thought that might work as well. just redirect to latest by default. in the rare case one really wants to see an old version they can do the extra click (at least for me that wouldn't be a big deal)
ht_ has joined #crystal-lang
_ht has quit [Ping timeout: 246 seconds]
ht_ is now known as _ht
alexherbo26 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo26 is now known as alexherbo2
alexherbo2 has quit [Client Quit]
alexherbo2 has joined #crystal-lang
<FromGitter>
<jwaldrip> Is there a way to detect when the compiler is in release mode or not?
<Deuns>
one more information though: it works on debian and does not work from openbsd
<Deuns>
so teh IO waiting might be a track to follow
<FromGitter>
<Blacksmoke16> yea could be something specific to openbsd's libc bindings, but thats just a guess :shrug:
<FromGitter>
<Blacksmoke16> i dont really have any ideas
<Deuns>
any thing I could do to ease on debugging ? (exporting traces or something similar ?)
<FromGitter>
<Blacksmoke16> reproducible code would be the big one
<FromGitter>
<Blacksmoke16> ideally simple code
<Deuns>
thanks Blacksmoke16
<Deuns>
hum... the code path is not the same on linux and openbsd. linux goes through the decoder...
<FromGitter>
<Blacksmoke16> might be a clue?
<FromGitter>
<Blacksmoke16> openbsd doesnt have CI so is totally possible there is a bug somewhere
zorp has joined #crystal-lang
<FromGitter>
<naqvis> Deuns are you trying to access the same URL on both boxes?
<FromGitter>
<naqvis> info you have given is showing that on one box, contents have encoding/charset info, while on the other it doesn't
<FromGitter>
<naqvis> default encoding is UTF-8
<Deuns>
naqvis: yep
<Deuns>
it is the exact same example
<FromGitter>
<naqvis> try to log to console `IO#encoding` on both boxes and see, if you find any difference in output
<FromGitter>
<naqvis> if both are showing the default UTF-8, then as Blacksmoke16 mentioned, might be some bug as there is no CI on openbsd or some other binding issues
<Deuns>
can you elaborate on "log to console `IO#encoding`" ?
<FromGitter>
<naqvis> you provided details that you have tracked down the issue to `IO` class, so either check in debugger the `encoding` property or do some output in code by calling `io.encoding` where `io` is the var via which you have reached to this point
<FromGitter>
<watzon> I wonder, does anyone have experience with OpenSSL RSA?
<FromGitter>
<watzon> I need to import an RSA instance from an existing private key, but I can't figure out how to do that
<FromGitter>
<wout> I'm wondering, is there already a consensus about which channel we are using? Will it now be Gitter + Slack? Or will we eventually move to Slack?
<FromGitter>
<tenebrousedge> there is no consensus
<FromGitter>
<wout> Shouldn't someone make a choice?
<FromGitter>
<wout> It's confusing to have two...
<FromGitter>
<tenebrousedge> welcome to open source :/
<FromGitter>
<wout> 😂️
<robacarp>
oh there's a slack now?
<FromGitter>
<wout> @robacarp Yes there is.
<FromGitter>
<tenebrousedge> yeah, if you search you can find the invite link
<FromGitter>
<tenebrousedge> oh, um search gitter that is
<FromGitter>
<Blacksmoke16> esp some of the articles at the top might help
<raz>
hum, i use mock classes for testing all the time, but never needed something extra (they'd just have the same interface as the regular class)
<jhass>
heh, and there I thought the entire point of DI is that the class does not decide which concrete implementation it gets but instead an external provider does
<FromGitter>
<Blacksmoke16> thats the jist of it for testing yea, the container just abstracts where those dependencies come from
<raz>
hm ah i see. yea true, i guess i usually have it always in a way where the "class that does the work" gets passed in as an argument anyway
<FromGitter>
<tenebrousedge> yes, that's another way to do DI
<FromGitter>
<Blacksmoke16> factory versus container type of deal
<FromGitter>
<Blacksmoke16> similar idea tho
<jhass>
in your blog example I don't see the benefit to @writer : Writer = S3Writer.new
<jhass>
def initialize(..that..) I mean of course
<FromGitter>
<Blacksmoke16> just means the worker is now tightly coupled to the S3Writer
<FromGitter>
<Blacksmoke16> versus being more so based on the writer interface
<jhass>
> If we wanted to make the worker write to Redis instead, just change `s3_writer` to `redis_writer` and done.
<jhass>
talking about this part
<jhass>
IMO worker shouldn't make that decision but an external dependency tree/provider or whatever should.
<jhass>
so given that mechanic I don't see how it's any less coupled
<jhass>
but that's essentially why for example dagger goes through all this incomprehensible mess of modules, components and subcomponents
<FromGitter>
<Blacksmoke16> how wouldnt it be less coupled? its coupled to the interface, the class is determining which instance of the writer is injected hto
<FromGitter>
<Blacksmoke16> the new version allows defining like aliases to the interface, i.e. like a default implemention if typed to the interface
<jhass>
how is def initialize(@writer : Writer = S3Writer.new) any more coupled?
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
DTZUZU2 is now known as DTZUZU
<FromGitter>
<mattrberry> Hey, I saw some recent posts about this, but I'm still a little confused. I'm trying to install CrSFML, and I'm running into the issue `Missing "v2.2.0:shard.yml" for "crsfml"` while installing. I have SFML 2.5.1 installed, and I believe I've set the necessary environment vars. Is there something else I'm missing?
<FromGitter>
<Blacksmoke16> Try pinning the version
<FromGitter>
<Blacksmoke16> Issue is fixed for next shards release iirc
<FromGitter>
<mattrberry> Sorry, could you please elaborate? Should I install a different version of shards?
<FromGitter>
<Blacksmoke16> like are you specifying a version?
<FromGitter>
<mattrberry> A version of what? shards? crsfml?