Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:29
    gballet synchronize #9847
  • 09:28
    gballet synchronize #9847
  • 03:01
    Blacksmoke16 synchronize #11126
  • 01:04
    postmodern edited #11518
  • 01:03
    postmodern edited #11518
  • 00:56
    postmodern labeled #11518
  • 00:56
    postmodern opened #11518
  • Nov 30 23:58
    caspiano opened #11517
  • Nov 30 23:14
    HertzDevil labeled #11516
  • Nov 30 23:14
    HertzDevil labeled #11516
  • Nov 30 23:14
    HertzDevil labeled #11516
  • Nov 30 23:14
    HertzDevil opened #11516
  • Nov 30 23:12
    HertzDevil synchronize #11496
  • Nov 30 22:28
    straight-shoota synchronize #11512
  • Nov 30 22:18
    HertzDevil synchronize #11496
  • Nov 30 21:44
    straight-shoota opened #11515
  • Nov 30 21:44
    straight-shoota labeled #11515
  • Nov 30 21:39
    straight-shoota labeled #11514
  • Nov 30 21:39
    straight-shoota opened #11514
  • Nov 30 21:36
    HertzDevil synchronize #11298
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
ryanprior
@ryanprior:matrix.org
[m]
I'd like to write data to sqlite & read it back again from query results, all without writing custom serialization code. I like how JSON::Serializable works and would like something similar. Any suggestions?