Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:26
    straight-shoota closed #12561
  • 22:26
    straight-shoota closed #12562
  • 22:26
    straight-shoota edited #12562
  • 22:25
    straight-shoota closed #12560
  • 22:25
    straight-shoota closed #12563
  • 22:25
    straight-shoota milestoned #12563
  • 22:25
    straight-shoota milestoned #12563
  • 15:08
    asterite synchronize #12563
  • 15:01
    straight-shoota milestoned #12562
  • 15:01
    straight-shoota milestoned #12562
  • 14:53
    asterite edited #12563
  • 14:50
    asterite opened #12563
  • 14:50
    asterite labeled #12563
  • 14:50
    asterite labeled #12563
  • 14:49
    asterite assigned #12560
  • 14:36
    asterite labeled #12562
  • 14:36
    asterite labeled #12562
  • 14:36
    asterite opened #12562
  • 14:35
    asterite assigned #12561
  • 13:38
    straight-shoota labeled #12559
From IRC (bridge bot)
@FromIRC
<mfiano> Ok yeah I noticed shardbox tracks ~1k, and the (now down) crystalshards.xyz had ~6k
Benjamin Wade
@RespiteSage
Yeah. And for whatever reason the language-constrained search on GitHub also rarely works for me.
George Dietrich
@Blacksmoke16
shardbox is curated as is awesome-crystal, others just scrape GH
From IRC (bridge bot)
@FromIRC
<mfiano> the * search on github rarely works good ;⁠)
Benjamin Wade
@RespiteSage
Lol.
Also, @Blacksmoke16, my usual pattern for applications was initially inspired by the scry entry point file.
George Dietrich
@Blacksmoke16
only for the reason to make it more obs what the entrypoint file is?
Benjamin Wade
@RespiteSage
Yeah, basically. I also like splitting out the driver and configuration logic from the rest of the application logic. Though that does make it hard to test the driver and configuration logic.
My discryb src/ might be the only example of my own that's publicly-available.
From IRC (bridge bot)
@FromIRC
<mfiano> to be fair, my first project was actually going to be a library, so maybe i should have clarified before asking :⁠)
George Dietrich
@Blacksmoke16
@RespiteSage take a look at oq_cli.cr
might be easier to test
Benjamin Wade
@RespiteSage
Yeah, libraries bypass those considerations.
George Dietrich
@Blacksmoke16
i.e. use option parser to process the args and create an instance of the actual type, passing in those args
From IRC (bridge bot)
@FromIRC
<mfiano> Doubtful, as all the new kids seem to prefer vscode, but anyone using vim/nvim for crystal?
Benjamin Wade
@RespiteSage
I am one of those new kids, but I know I've seen people talk about using vim/nvim (and at least one or two other terminal editors) when writing Crystal.
From IRC (bridge bot)
@FromIRC
<mfiano> I guess one of the questions I have is editor agnostic...is crystalline the preferred LSP server?
George Dietrich
@Blacksmoke16
thats what i hear yes
Yeah, Scry has been around longer, but Crystalline seems to have more features and be more actively maintained.
From IRC (bridge bot)
@FromIRC
<mfiano> Great thanks
<mfiano> I'm happy to see vim-based does take a nice second place on that pie chart :⁠)
Benjamin Wade
@RespiteSage
You may already have this info, but there was a thread that includes some links to a vim plugin.
George Dietrich
@Blacksmoke16
From IRC (bridge bot)
@FromIRC
<mfiano> crystalline seems to support jumping to definition just fine. keeping a tags database seems un-needed just yet
Benjamin Wade
@RespiteSage
@Blacksmoke16 Just looked at oq_cli.cr. That's a solid pattern. It reminds me of factories in Java, just with less bloat.
George Dietrich
@Blacksmoke16
kinda yea, works quite well as the lib itself is decoupled from the CLI context
From IRC (bridge bot)
@FromIRC
<mfiano> That project seems to be structured well and very easy to read
<mfiano> (and nicely documented)
George Dietrich
@Blacksmoke16
i try :smiley:
From IRC (bridge bot)
@FromIRC
<mfiano> at least as a first real project I've seen
Jason Waldrip
@jwaldrip
Getting some weird behavior...
class Psykube::Generator::Podable < ::Psykube::Generator
  alias Resource = Pyrite::Api::Apps::V1::Deployment | Pyrite::Api::Batch::V1beta1::CronJob | Pyrite::Api::Batch::V1::Job | Pyrite::Api::Apps::V1::StatefulSet | Pyrite::Api::Apps::V1::DaemonSet | Pyrite::Api::Core::V1::Pod

  protected def result : Resource
    case manifest.type
    when "Deployment"
      Deployment.result(self)
    when "Cron"
      CronJob.result(self)
    when "Job"
      Job.result(self)
    when "StatefulSet"
      StatefulSet.result(self)
    when "DaemonSet"
      DaemonSet.result(self)
    when "Pod"
      Pod.result(self)
    else
      raise "Invalid type: `#{manifest.type}`"
    end
  end
end
given that... I am getting a strange error
George Dietrich
@Blacksmoke16
manifest.type should be an enum :)
Jason Waldrip
@jwaldrip
❯ shards build && mv bin/psykube `which psykube` --error-trace
Dependencies are satisfied
Building: psykube
Error target psykube failed to compile:
Showing last frame. Use --error-trace for full trace.

In src/cli/commands/concerns/kubectl.cr:139:20

 139 | spec = podable.spec
                      ^---
Error: undefined method 'spec' for Pyrite::Api::Admissionregistration::V1::MutatingWebhookConfiguration (compile-time type is Pyrite::Kubernetes::Object+)
George Dietrich
@Blacksmoke16
got a link to the code?
Jason Waldrip
@jwaldrip
ya, let me push
George Dietrich
@Blacksmoke16
does that spec method exist on all those types in the union?
Jason Waldrip
@jwaldrip
Let me double check
George Dietrich
@Blacksmoke16
it seems the type of that union is being collapsed into their parent Pyrite::Kubernetes::Object+ type which doesn't have that method
https://github.com/crystal-lang/crystal/issues/2661#issuecomment-877286921 is prob similar to what's going on ^ if i had to guess
Jason Waldrip
@jwaldrip
Which is strange... the return type method ensures the proper type is returned
or at least it should
George Dietrich
@Blacksmoke16
but you're doing a .as(Psykube::Generator::Podable::Resource)
where Resource is an alias to a union of other types
Jason Waldrip
@jwaldrip
so really I would have to case over each type in the union to get what I want
George Dietrich
@Blacksmoke16
or make use of overloads for specific types
Jason Waldrip
@jwaldrip
ya, let me see what I can do
Alex Kampa
@alex-kampa
Now here's a bit of a surprise: