Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:16
    hugopl closed #12062
  • May 17 20:20
    Blacksmoke16 synchronize #12044
  • May 17 18:19
    straight-shoota edited #11947
  • May 17 18:19
    straight-shoota milestoned #11947
  • May 17 18:18
    straight-shoota closed #11971
  • May 17 18:18
    straight-shoota closed #11970
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil opened #12063
  • May 17 16:29
    HertzDevil labeled #12062
  • May 17 13:50
    hugopl opened #12062
  • May 17 13:50
    hugopl labeled #12062
  • May 16 19:05
    lbguilherme synchronize #11947
  • May 16 17:29
    straight-shoota milestoned #11971
  • May 16 17:15
    straight-shoota closed #12038
  • May 16 17:15
    straight-shoota closed #12036
  • May 16 17:14
    straight-shoota edited #12038
  • May 16 13:47
    straight-shoota closed #12051
  • May 16 13:47
    straight-shoota closed #12050
Daniel Worrall
@Daniel-Worrall
This works since it is truthy when not nil
I'm unsure how this works with compile type of Bool | Nil, but I guess it would be true only in the first branch and false | nil in the second
George Dietrich
@Blacksmoke16
what do you have in the rescue portion tho?
sounds like you're just not handling the case where an exception is raised
Ali Naqvi
@naqvis
@alex-kampa For your specified use-case, i would suggest to go with JSON::Serializable and create a general class, which consumes any json string and returns Hash representation.
https://play.crystal-lang.org/#/r/bf2g
Daniel Worrall
@Daniel-Worrall
While recommendations are appreciated, the nilable hash and original has nothing to do with that. fyi
Chris Watson
@watzon
You know how in Crystal you can use a generic like T and then use T.class to say that you want the class rather than an instance of that class? Any idea how to accomplish the same in Typescript?
Gabor Szabo
@szabgab
I have been lurking here for a while, but I guess I should say hi, before I start asking questions. I have been learning Crystal in the last couple of weeks. I started to create a web site collecting data about shards, but then straight-shoota pointed at his shardbox an already existing (and much better looking) system. We then had a live coding session in which he explained about the shardbox and then we even created a small change. Anyway, I keep learning Crystal and I guess I'll ask some questions here. I hope it is ok even though they will be probably very basic.
George Dietrich
@Blacksmoke16
o/
Chris Watson
@watzon
Welcome @szabgab
Benjamin Clos
@ondreian
is everyone just using minimal Travis image these days since the language: crystal doesn't work?
George Dietrich
@Blacksmoke16
pretty no one is using travis anymore and just switched to GH Actions
From IRC (bridge bot)
@FromIRC
<jhass> or whatever else, just stopped using travis. They got bought out and basically none of the original open source folks is there anymore
Benjamin Clos
@ondreian
I see. crystal init still generates a .travis.yml file
George Dietrich
@Blacksmoke16
it wont starting next release
Benjamin Clos
@ondreian
cool deal, it had been awhile since I needed to init a new project but was kind of :corn: fused about what was going on. Thanks.
Gabor Szabo
@szabgab
@ondreian , there is this nice form that helps generating a minimal config file for GitHub Actions: https://crystal-lang.github.io/install-crystal/configurator.html
From IRC (bridge bot)
@FromIRC
<straight-shoota> Great to have you here, szabgab =)
Rishav Sharan
@rishavs
Has anyone here used google sign in for their sites? Would you know what "data-nonce" is?
Is it the secret string that we need to match with the google response to make sure it is our own request?
Gabor Szabo
@szabgab
When I run "crystal spec" is there a way to tell it to stop on the first error?
From IRC (bridge bot)
@FromIRC
<straight-shoota> @szabgab Yes --fail-fast
<straight-shoota> In 1.1 this will actually be in the output of crystal spec --help. Because it's a runtime option, you currently only get the help by building and runnning the spec (crystal spec -- --help)
From IRC (bridge bot)
@FromIRC
<hightower2> Are there some articles on multitenant http-based apps with Crystal?
Gabor Szabo
@szabgab
@straight-shoota thanks
Gabor Szabo
@szabgab
Is there a web site collecting videos about Crystal? Similar (or not) to https://pyvideo.org/ ?
George Dietrich
@Blacksmoke16
i doubt it
Taupiqueur
@alexherbo2
is there an equivalent to File.fnmatch from Ruby?
I want to test a glob string matches a file
Taupiqueur
@alexherbo2
thanks o/
George Dietrich
@Blacksmoke16
is there a way to call a parent classes implementation of a method from a different method and when that parent method is also redefined in the child?
i.e. cant just do self.parent_method and super wont work because its not the same method
maybe ::parent_method would do it?
George Dietrich
@Blacksmoke16
nope
super.parent_method doesnt work either
George Dietrich
@Blacksmoke16
Jonathan Silverman
@mixflame
I have a problem with a bridge bot i'm trying to add SSL to
```
one sec
```
Unhandled exception in spawn: Closed stream (IO::Error)
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/io.cr:118:5 in 'check_open'
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/io/buffered.cr:100:5 in 'peek'
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/io.cr:622:37 in 'gets'
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/io.cr:595:5 in 'gets'
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/io.cr:565:5 in 'gets'
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/io.cr:564:3 in 'gets'
  from src/lib/irc.cr:160:5 in 'get_response'
  from src/lib/irc.cr:33:9 in 'initialize'
  from src/lib/irc.cr:22:3 in 'new'
  from config/application.cr:83:3 in '->'
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/primitives.cr:255:3 in 'run'
  from /home/jonathan/.asdf/installs/crystal/1.0.0/share/crystal/src/fiber.cr:92:34 in '->'
  from ???
any ideas would be appreciated
George Dietrich
@Blacksmoke16
looks like you're trying to read from a closed IO
Jonathan Silverman
@mixflame
before, it was nil errors
alright, i got it to connect, now im just back to the refusal to send bug
Jonathan Silverman
@mixflame
ERROR :Closing link: (97KAAAAEC@c-107-2-145-228.hsd1.co.comcast.net) [Registration timeout]
something to do with flush()?
George Dietrich
@Blacksmoke16
https://gist.github.com/mixflame/4e81d9083a02c9859ccc59c623b4d3c9#file-irc-cr-L79 is prob closing the socket so that when the other fibers execute it's closed