RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
<travis-ci> crystal-lang/crystal#04755f9 (ci/nightly - Run nightly at midnight): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/350087752
<hightower2> Hey how would I "dump" byte-level value of a variable into a string? Like, to convert 2u32 into "\u0000\u0000\u0000\u0002"?
<FromGitter> <bew> Grr carcin doesn't want to compile anything
<FromGitter> <straight-shoota> hightower: ⏎ ⏎ ```String.build do |io| ⏎ io.write_bytes 2_u32, IO::ByteFormat::BigEndian ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5a9f394e888332ee3a09ccbd]
<FromGitter> <bew> Exactly what I tried ˆˆ but I don't think strings are the correct container for that kind of data
txdv has quit [Ping timeout: 260 seconds]
<FromGitter> <straight-shoota> hightower asked for a string...
<FromGitter> <straight-shoota> could use a IO::Memory and to_slice as well
<FromGitter> <bew> Yeah i know
<FromGitter> <bew> 'm just saying (I should stop doing multiple things at the same tile too ˆˆ)
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
txdv has joined #crystal-lang
<FromGitter> <watzon> What's the easiest way to get the base64 representation of a file?
<FromGitter> <watzon> I know I could do File.read and then Base64.strict_encode that, but what if I already have a File object
<FromGitter> <watzon> Reading data in a File object is not well documented
<hightower2> Wonderful, thanks straight-shoota, bew
snsei has joined #crystal-lang
cyberarm has quit [Ping timeout: 256 seconds]
snsei has quit [Ping timeout: 260 seconds]
cyberarm has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 256 seconds]
DTZUZU has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> @watzon a File object is just an IO, you can use all IO methods on it
DTZUZU has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
greengriminal has joined #crystal-lang
<greengriminal> What crystal web framework do people primarily use? I really like the look of Amber but also see there is a framework called lucky
<greengriminal> My understanding is that amber is a lot like rails and kemal is basically sinatra
<FromGitter> <watzon> @bew how do you read an IO object to the end though?
<FromGitter> <bew> `IO#gets_to_end`
<FromGitter> <bew> ;}
snsei has joined #crystal-lang
sz0 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <davidpatters0n> I'd like contribute to the amber project, but I'd like to confirm that my changes are working. How do I go about testing them locally. More specifically I've made a change to `cli/commands/generate.cr` and would like to confirm my change is working.
<FromGitter> <elorest> @davidpatters0n after making the change run `make` and it will compile `amber` into ./bin ⏎ ⏎ Use that binary to test what you're trying to test. There are also formal written tests as well that you'll want to add before submitting a PR.
<FromGitter> <elorest> Also there is a gitter channel specifically for amber as well.
<FromGitter> <davidpatters0n> oh snap wrong channel. Apologies. I thought this was amber.
<FromGitter> <elorest> We'd love to have you in the community.
snsei has joined #crystal-lang
<FromGitter> <aisrael> I don't suppose there's any way to freeze an `Array`?
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 245 seconds]
snsei has joined #crystal-lang
<FromGitter> <watzon> @aisrael I don't believe so, `freeze` seems to be missing everywhere
moei has quit [Quit: Leaving...]
<FromGitter> <watzon> Who runs the @CrystalLibHunt twitter?
rohitpaulk has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
snsei has quit [Remote host closed the connection]
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <bararchy> what's the right way in Crystal to `.pack(C*)` an array, should I use `.to_unsafe`? though that will give me pointer and not bytes
<FromGitter> <bararchy> or more likely `.to_slice` right?
snsei has joined #crystal-lang
_whitelogger_ has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<FromGitter> <watzon> Anyone care to give this a read over before I publish it? Wrote another article about Crystal. https://medium.com/@watzon/why-crystal-is-my-favorite-language-ee733224e6f2
<FromGitter> <bararchy> @watzon in "What dot I like" paragraph 3, you meant "pour" not "poor"
<FromGitter> <bararchy> overall a really nice articale :)
<FromGitter> <watzon> Nope, it's definitely poor haha
<FromGitter> <bararchy> LOL
<FromGitter> <watzon> Thank you though :)
<FromGitter> <bararchy> I think poor = no money, while pour means ...well.. puts somthing into something else, so when you said that manas can't spend much $ into the project I think it should be pour, as in "they can't pour money into the project", but, english ins't my mother tounghe so I might be missing something
<crystal-gh> [crystal] jhass closed pull request #5779: Add an example of an operator delegation (master...patch-1) https://git.io/vAdJo
<FromGitter> <bararchy> Can someone tell me why I keep getting `-1` from the `LibC.connect` ? looking at other implementation of the lib it seems to be the right parameters: https://github.com/bararchy/bluetooth/blob/master/spec/bluetooth_spec.cr#L16-L25
flaviodesousa has joined #crystal-lang
<FromGitter> <watzon> Lol you know what @bararchy, you were right. I was thinking I had said something about "poor communication", but I didn't. You're right about pour.
<FromGitter> <bararchy> @watzon 👍 happy I could help
<FromGitter> <aisrael> And here I thought it was just a "poor" pun (intended)
<FromGitter> <watzon> Hahaha
snsei_ has quit [Ping timeout: 245 seconds]
<travis-ci> crystal-lang/crystal#8e66045 (master - Add an example of an operator delegation): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/350208817
jsn- has quit [Ping timeout: 240 seconds]
jsn- has joined #crystal-lang
snsei has joined #crystal-lang
moei has joined #crystal-lang
<7JTADM4N8> [crystal] ysbaddaden closed pull request #5781: Fix `spawn` macro for call with receiver (master...jm/fix/spawn-receiver) https://git.io/vAd1W
<DeBot> https://github.com/crystal-lang/crystal/pull/5781 (Fix `spawn` macro for call with receiver)
<7GHAAAJI3> crystal/master 713fa33 Johannes Müller: Fix `spawn` macro for call with receiver
<7GHAAAJI3> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vAF5r
Papierkorb has joined #crystal-lang
bonemind has joined #crystal-lang
<travis-ci> crystal-lang/crystal#713fa33 (master - Fix `spawn` macro for call with receiver): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/350260193
<FromGitter> <sdogruyol> kudos @watzon great article 👍
alex`` has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
<FromGitter> <CImrie> @faustinoaq Hey, the scry 0.7.0 release seems to be an empty file - reports as 45bytes on Github and can't open
<FromGitter> <CImrie> (I noticed you bumped the version to 0.7.0 in the commit message so hope you know the right person to tell!)
hmans has quit [Ping timeout: 240 seconds]
hmans has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
<FromGitter> <faustinoaq> @CImrie Yeah, I tried to release scry v0.7.0 but... ⏎ ⏎ Referencing: https://gitter.im/crystal-scry/Lobby?at=5a9f4aba6fba1a703ad8859b ⏎ ⏎ > Hi, I'm trying to auto deploy version v0.7.0 but Travis is showing this message: ... [https://gitter.im/crystal-lang/crystal?at=5a9fe02c53c1dbb743b41bc0]
<FromGitter> <CImrie> Is it not `git push --tags` ?
<FromGitter> <CImrie> Though if a tag already exists on remote you'll need to remove it I think
<FromGitter> <faustinoaq> Yeah, I tried `--tags` as well but same happens, I'll try once more, let me recreate the tag and release v0.7.0 again
<FromGitter> <CImrie> @faustinoaq a little off track but how do I actually use scry? I've not used LSP servers before - when I run scry it doesn't do anything on my screen 😕
<travis-ci> crystal-lang/crystal#04755f9 (test-ci-1 - Run nightly at midnight): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/350297761
Ven`` has joined #crystal-lang
<FromGitter> <faustinoaq> I tried to release it again, seems that our CI script has some issue, let me fix it 😅 ⏎ ⏎ https://travis-ci.org/crystal-lang-tools/scry/jobs/350309896#L536
<FromGitter> <faustinoaq> @CImrie You don't need to run scry by yourself. You need to configure your LSP client in your favorite editor
alex`` has joined #crystal-lang
<FromGitter> <CImrie> Ok. Do I just point it to the executable with no arguments? Just because it seems to time out on the LSP plugin I've got - maybe my timeouts are too small?
<FromGitter> <faustinoaq> I put that on scry's README at the end of Installation section: https://github.com/crystal-lang-tools/scry#installation
<FromGitter> <CImrie> I promise I have read that! Probably more of a lack of documentation on the plugin setup than scry tbh
<FromGitter> <faustinoaq> > Ok. Do I just point it to the executable with no arguments? ⏎ ⏎ @CImrie It's dependes on your LSP client. On VScode and Atom you just need to set your server executable path, but in Sublime for example you need to setup some initializationOptions: ⏎ ⏎ https://github.com/crystal-lang-tools/scry/pull/51#issuecomment-370539562 [https://gitter.im/crystal-lang/crystal?at=5a9fe7570a1614b712f127c3]
<FromGitter> <faustinoaq> > Probably more of a lack of documentation on the plugin setup than scry tbh ⏎ ⏎ Yeah, I think we need to write some articles on scry wiki about that 😅
<FromGitter> <CImrie> Thank you! Sublime was what I was looking for so I'll give it a shot 🙏
<FromGitter> <alex-lairan> It's possible to use scry with atom? :)
Ven`` has quit [Ping timeout: 240 seconds]
<FromGitter> <faustinoaq> > Yeah, I think we need to write some articles on scry wiki about that  😅 ⏎ ⏎ I just opened an issue https://github.com/crystal-lang-tools/scry/issues/56 ⏎ ⏎ ^ Please take a look and share your opinions 😄 [https://gitter.im/crystal-lang/crystal?at=5a9febbbe4ff28713a048199]
<FromGitter> <faustinoaq> > It's possible to use scry with atom? ⏎ ⏎ @alex-lairan Oh yes, Atom has first-class support for LSP ⏎ ⏎ Scry is the implementation of LSP server for crystal, so it should be compatible across all LSP clients [https://gitter.im/crystal-lang/crystal?at=5a9fec648f1c77ef3a927f14]
alex`` has quit [Ping timeout: 264 seconds]
alex`` has joined #crystal-lang
<FromGitter> <alex-lairan> Thanks this, I can forget Rubymine :p
<FromGitter> <aisrael> I haven't touched Rubymine since... quite a while now. But I did pay for one more year subscription.
<FromGitter> <aisrael> With VS Code and Crystal, looks like this year will be the last year I pay for Rubymine :D
<FromGitter> <faustinoaq> < Thanks this, I can forget Rubymine ⏎ ⏎ In fact, you should be able to use scry in Rubymine 😎 ⏎ ⏎ https://github.com/gtache/intellij-lsp ... [https://gitter.im/crystal-lang/crystal?at=5a9ff013c3c5f8b90d43c3bc]
<FromGitter> <j8r> Can it be used in atom too?
<FromGitter> <alex-lairan> > > It's possible to use scry with atom? ⏎ ⏎ @alex-lairan Oh yes, Atom has first-class support for LSP ⏎ ⏎ Scry is the implementation of LSP server for crystal, so it should be compatible across all LSP clients [https://gitter.im/crystal-lang/crystal?at=5a9ff0bd0a1614b712f159ca]
<FromGitter> <alex-lairan> :)
<FromGitter> <j8r> nice :)
<FromGitter> <aisrael> Now if only we had code coverage for Crystal
<RX14> you can with kcov
<RX14> kinda
<RX14> but it's buggy
<FromGitter> <simaoneves> Good job @faustinoaq :) take a look at my comment: https://github.com/crystal-lang-tools/scry/pull/48
<FromGitter> <faustinoaq> 👍
duane has quit [Ping timeout: 260 seconds]
rohitpaulk has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
<FromGitter> <faustinoaq> Hi, I created a scry wiki: https://github.com/crystal-lang-tools/scry/wiki ⏎ ⏎ If you have tested scry successfully in some editor , please feel free to contribute to scry wiki +1
rohitpaulk has quit [Ping timeout: 264 seconds]
greengriminal has joined #crystal-lang
<FromGitter> <CImrie> @faustinoaq I'm trying to configure sublime 3 but no matter how I go about it I get: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Ran the tests for scry locally and they all passed - in particular the one for `workspace/didChangeConfiguration` [https://gitter.im/crystal-lang/crystal?at=5aa000e46f8b4b9946fcdd4f]
duane has joined #crystal-lang
greengriminal has quit [Ping timeout: 256 seconds]
greengriminal has joined #crystal-lang
<FromGitter> <faustinoaq> Let me try
<FromGitter> <faustinoaq> Oh, I'm getting same error 😟 Let me try some things
<FromGitter> <CImrie> Ok. I did try for ages because I thought it was likely just me. Happy to help if I can...!
<FromGitter> <faustinoaq> Oh, look like those settings weren't needed at all 😅
<FromGitter> <CImrie> lol
<FromGitter> <faustinoaq> I was a bit confused, because I tried so many tricks to get sublime working, now I don't know what I did 😅 lol
alex`` has quit [Ping timeout: 260 seconds]
<FromGitter> <faustinoaq> ```code paste, see link``` ⏎ ⏎ There are my settings ^ [https://gitter.im/crystal-lang/crystal?at=5aa00aace4d1c63604d21f78]
<FromGitter> <bmulvihill> Yeah looks like we might need to add additional settings options to the backend so it doesn't blow up @faustinoaq I think maybe processesLimit was causing the issue since it doesn't map
<FromGitter> <CImrie> Yeah haha. It's a bit weird that causes an error with scry though, given the `workspace/didChangeConfiguration` test case (which seems broadly the same). ⏎ ⏎ I was just about to ask! ⏎ I took away a CRYSTAL_PATH env I put in and now get: ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5aa00afe8f1c77ef3a93380a]
<FromGitter> <CImrie> Worth noting I'm using mac
<FromGitter> <bmulvihill> Which spec were you looking at the update_config_spec?
alex`` has joined #crystal-lang
<FromGitter> <CImrie> Good question: I realise now I was looking at the spec_helper (used Github search): ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ This example is then tested in message_spec ... [https://gitter.im/crystal-lang/crystal?at=5aa00c110a1614b712f2062d]
<FromGitter> <bmulvihill> yeah its nested under `crystal-ide` as well
<FromGitter> <CImrie> Yeah, I did try with crystal-ide but it made no difference to me
<FromGitter> <bmulvihill> so I think its blowing up on the JSON.mapping here https://github.com/crystal-lang-tools/scry/blob/master/src/scry/protocol/did_change_configuration_params.cr#L6
<FromGitter> <CImrie> nice find
duane has quit [Ping timeout: 240 seconds]
bonemind has quit [Quit: WeeChat 2.0.1]
duane has joined #crystal-lang
qard has joined #crystal-lang
duane has quit [Ping timeout: 264 seconds]
duane has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
alex`` has quit [Quit: WeeChat 2.0.1]
rohitpaulk has joined #crystal-lang
<FromGitter> <faustinoaq> Oh, seems like scry settings are tight coupled with VSCode extensions, we should fix that 😅
<FromGitter> <CImrie> @faustinoaq After setting my CRYSTAL_PATH env in the sublime settings I can see it starts up fine, but the debug logs show messages like: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Which is fine, but Sublime doesn't show anything like your screenshot (it just logs it and carries on). That 'expecting token' message was when I was trying to do `File.{something}` to get completion hints (again nothing showed
<FromGitter> <CImrie> Scratching my head with this one
flaviodesousa has quit [Ping timeout: 260 seconds]
<FromGitter> <faustinoaq> Oh, try putting your files inside the s ~src~ folder, looks like is a requirement right now, ⏎ ⏎ @laginha87 do you know why this happens? I thought that issue was fixed here: https://github.com/crystal-lang-tools/scry/pull/51#issuecomment-370132516 😅
<FromGitter> <CImrie> yeah i'll try on a fresh project
<FromGitter> <CImrie> thanks
<FromGitter> <CImrie> Yep seems to have an issue without CRYSTAL_PATH set in sublime ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Probably looking for that full absolute URL relative to the workspace folders? [https://gitter.im/crystal-lang/crystal?at=5aa02665f3f6d24c684aa647]
<FromGitter> <CImrie> I've just been able to set it up on vscode in about 5 minutes, so must be how it works with sublime (or how I'm using it)
duane has quit [Ping timeout: 260 seconds]
duane has joined #crystal-lang
<FromGitter> <hedgehog1029> hellooo
<FromGitter> <hedgehog1029> im getting this fun error inside crystal-db ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ which to me seems like a bit of a compiler bug, I think it's instantiating the wrong overload? [https://gitter.im/crystal-lang/crystal?at=5aa029ed888332ee3a0e7203]
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter> <straight-shoota> 👍
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Papierkorb has joined #crystal-lang
qard has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
<FromGitter> <faustinoaq> @watzon Nice 👍 ⏎ ⏎ BTW, scry v0.7.0 has been released ⏎ ⏎ Take a look! https://github.com/crystal-lang-tools/scry/releases/tag/v0.7.0 ✨ [https://gitter.im/crystal-lang/crystal?at=5aa04283e4d1c63604d37d3b]
<FromGitter> <CImrie> 🙌
<FromGitter> <bararchy> 👏 @faustinoaq
unshadow has joined #crystal-lang
<FromGitter> <faustinoaq> I'll publish it (scry v0.7.0) on our crystal networks (reddit, twitter, mailing list and crystal-ann) just let me record a nice gif using new features 😎
<FromGitter> <faustinoaq> Oh, BTW I need to publish some content on the scry wiki as well 😅
<crystal-gh> [crystal] straight-shoota opened pull request #5785: Move Time::Location spec additions to spec_helper (master...jm/fix/time-spec-helper-location) https://git.io/vAbAD
<crystal-gh> [crystal] straight-shoota opened pull request #5786: Fix boundary check in Time#add_span (master...jm/fix/time-add-span-boundary) https://git.io/vAbjV
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
unshadow has quit [Quit: leaving]
<crystal-gh> [crystal] straight-shoota opened pull request #5787: Return early in Time#add_span if arguments are zero (master...jm/feature/time-add-span-early-return) https://git.io/vANea
olbat has quit [Ping timeout: 240 seconds]
olbat has joined #crystal-lang
olbat has joined #crystal-lang
olbat has quit [Changing host]
alex`` has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
<FromGitter> <faustinoaq> I was reading https://www.reddit.com/r/crystal_programming/comments/81fbd7/crystal_db_in_production/?st=jeh9zol4&sh=5e652624 ⏎ ⏎ > My thoughts on problem 1 is that I could write my API servers as microservices which would allow me to run each binary on its own core. But the problem I see with this approach is that I don't see a way I could share the database connection pool with these binaries.
<FromGitter> ... Therefore I would need a connection pool per binary which seems less than satisfactory. Maybe this is a non-issue or someone has figured out a creative way to solve this. ⏎ ⏎ So, parallelism will make crystal faster on TFB, because right now we're opening one connection pool per process 😟 ... [https://gitter.im/crystal-lang/crystal?at=5aa0560635dd17022e32d05e]
<FromGitter> <rodrigopinto> Peeps, I researched a bit but could not find a method/class to deal with unicode data normalization like this https://docs.python.org/2/library/unicodedata.html#unicodedata.normalize in Python. Maybe I did not research enough. Is there any implementation of it in Crystal already? ⏎ ⏎ I am working around with a Hash(dict) to do the replacement.
<travis-ci> crystal-lang/crystal#3ad85aa (ci/nightly - Use SHA1 to use fixed distribution-scripts version): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/350549090
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duane has quit [Ping timeout: 264 seconds]
qard has joined #crystal-lang
hightower3 has quit [Ping timeout: 264 seconds]
betofloresbaca[m has joined #crystal-lang
<FromGitter> <bew> I think there's a shard that can do this but can't remember its name
<FromGitter> <bew> What kind of normalization do you need?
<FromGitter> <bew> In other words, what do you need it for?
<oprypin> rodrigopinto, i'm afraid there is no such thing
<oprypin> i go to https://crystal-lang.org/ and see the line pattern at the top, switch to another tab and back, and the pattern is gone entirely
<FromGitter> <rodrigopinto> @bew I would like a class/method that returns a normal form of the unicode letter, like to replace letters e.g: `ü`, `ç`, `ã` for the respective equivalents like `u`, `c`, `a`.
<FromGitter> <faustinoaq> Maybe some shard can do that already?
<FromGitter> <rodrigopinto> I am researching it. If I find anything I share.
hightower has joined #crystal-lang
<FromGitter> <straight-shoota> maybe https://github.com/akzhan/crystal-cldr can do something like that? @akzhan
<FromGitter> <straight-shoota> though it's more based on locale data
greengriminal has quit [Quit: This computer has gone to sleep]
<travis-ci> crystal-lang/crystal#2dd3a87 (ci/nightly - Run nightly on master): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/350584464
greengriminal has joined #crystal-lang