Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:54
    Blacksmoke16 labeled #11549
  • 19:47
    kalinon labeled #11549
  • 19:47
    kalinon opened #11549
  • 18:14
    straight-shoota labeled #11532
  • 18:13
    straight-shoota edited #11532
  • 18:11
    straight-shoota synchronize #11532
  • 17:58
    straight-shoota milestoned #11545
  • 17:58
    straight-shoota milestoned #11379
  • 17:56
    neatorobito synchronize #11543
  • 17:22
    oprypin milestoned #11534
  • 16:18
    straight-shoota edited #11177
  • 16:17
    straight-shoota milestoned #11475
  • 15:06
    straight-shoota review_requested #11475
  • 15:04
    straight-shoota synchronize #11475
  • 15:03
    straight-shoota synchronize #11475
  • 14:01
    straight-shoota closed #11523
  • 13:35
    straight-shoota demilestoned #11515
  • 13:24
    beta-ziliani unlabeled #11529
  • 13:21
    beta-ziliani demilestoned #11454
  • 13:21
    beta-ziliani demilestoned #11513
From IRC (bridge bot)
@FromIRC
<mfiano> Oh hmm...and where would that macro form go?
George Dietrich
@Blacksmoke16
first line of debug.cr
From IRC (bridge bot)
@FromIRC
<mfiano> Aha!
From IRC (bridge bot)
@FromIRC
<mfiano> I like that better. It probably means I have to explicitly require debug.cr before other requires for this to work properly, rather than an arbitrary *...or I could be wrong
George Dietrich
@Blacksmoke16
i would advise against using like require "./**"
From IRC (bridge bot)
@FromIRC
<mfiano> Yeah I would too
<mfiano> Though I must be doing something wrong here.
<mfiano> i did shards install, but get undefined constant Debug
George Dietrich
@Blacksmoke16
oh well you need to require the lib
require "debug" or whatever it's called
From IRC (bridge bot)
@FromIRC
<mfiano> Yeah I suppose that would help a tiny bit
<mfiano> Well there may be a problem with my crystalline setup or something
George Dietrich
@Blacksmoke16
i never used it so :shrug:
From IRC (bridge bot)
@FromIRC
<mfiano> I get editor error, saying it can't find file 'debug' on the line with require "debug", however, 'crystal run' works fine
George Dietrich
@Blacksmoke16
wonder if its conflicting with that file you just made
oh, or maybe it just doesnt know how to resolve deps like that? i never used it so ill defer to someone else
From IRC (bridge bot)
@FromIRC
<mfiano> That's out of the require path, in src. without a relative path it should only be looking in the stdlib or "lib"
<mfiano> so hmm
<mfiano> Ha you're right
George Dietrich
@Blacksmoke16
:ok_hand:
From IRC (bridge bot)
@FromIRC
<mfiano> and shards install makes a lib/debug/...
<mfiano> Renaming the above gist to debug2.cr and it works
<mfiano> how odd
<mfiano> I just have to keep in mind that I shouldn't have local files with the same name as 3rd party library directories or something
George Dietrich
@Blacksmoke16
pretty much yea
From IRC (bridge bot)
@FromIRC
<mfiano> nah that actually works fine. it seems to be a bug in that the errors in nvim's LSP are cached and not properly invalidated, even across restarts...
Jason Waldrip
@jwaldrip
Why would @type.subclasses return an empty list?
require "json"
require "yaml"

module Pyrite::Kubernetes
  abstract class Spec
    include ::JSON::Serializable
    include ::YAML::Serializable

    macro def_parser
      macro finalized
        {% if @type.abstract? %}
          {% puts @type.subclasses %}
          def self.new(pull : JSON::PullParser)
            location = pull.location

            {% begin %}
              string = pull.read_raw
              {% for subtype in @type.subclasses %}
                begin
                  return {{type}}.from_json(string)
                rescue JSON::ParseException
                  # Ignore
                end
              {% end %}
              raise JSON::ParseException.new("Couldn't parse #{self} from #{string}", *location)
            {% end %}
          end
        {% end %}
      end
    end

    macro inherited
      def_parser
    end

    def_parser
  end
end
is there a point in compilation where I have access to the subclasses?
George Dietrich
@Blacksmoke16
Try adding a \
\{% puts @type.subclasses %}
Jason Waldrip
@jwaldrip
there we go
Jason Waldrip
@jwaldrip
ya, i am very familiar... just been awile
too much time in elixir lately
❯ psykube status --cluster dev
NAME                    STATUS     RESTARTS    AGE
api-665c77fbb9-2dlk9    Running    0           23h2m
api-665c77fbb9-nwmx8    Running    0           23h1m
api-665c77fbb9-rjp6k    Running    0           23h1m
there we go
Jason Waldrip
@jwaldrip
Are there good examples of how the with syntax works with blocks
the docs are pretty bare on it
George Dietrich
@Blacksmoke16
def foo(&)
  with -1 yield
end

foo do
  puts abs # => 1
end
which is similar to
def foo(&)
  yield -1
end

foo do |v|
  puts v.abs
end
Jason Waldrip
@jwaldrip
Whats the ETA on 1.1.0 docker containers?
George Dietrich
@Blacksmoke16
technically you could prob just use nightly in the meantime
if you'd be ok with it being rebuilt every night ofc
Jason Waldrip
@jwaldrip
what about the 1.1-dev?
George Dietrich
@Blacksmoke16
mm that might be the pre-release? id go with that