<FromGitter>
<j8r> It feels strange to have my name in the commit stats...
<FromGitter>
<dscottboggs_gitlab> congrats @j8r
<FromGitter>
<dscottboggs_gitlab> has anybody run into an error when parsing YAML and JSON that just says `error {stack trace} instantiating 'allocate()'`?
<FromGitter>
<Blacksmoke16> Mm can't say I have
<FromGitter>
<dscottboggs_gitlab> that's weird you've done a lot with serialization
<FromGitter>
<Blacksmoke16> Got an example?
<FromGitter>
<dscottboggs_gitlab> Only in context
<FromGitter>
<dscottboggs_gitlab> I've seen it before, but never been able to create a minimal example
<FromGitter>
<Blacksmoke16> Fair enough
<FromGitter>
<dscottboggs_gitlab> I'll try again
<FromGitter>
<dscottboggs_gitlab> oh shit I think I got it actually
<FromGitter>
<dscottboggs_gitlab> damn, it's giving me a different error, but you can get the idea from here https://carc.in/#/r/64cg
<FromGitter>
<dscottboggs_gitlab> oh actually that's not what I have either
<FromGitter>
<dscottboggs_gitlab> and it works fine when I put it like I have it in my code https://carc.in/#/r/64cj
<FromGitter>
<Blacksmoke16> Why the nested classes?
<FromGitter>
<dscottboggs_gitlab> just makes it easier to reason about I gues
<FromGitter>
<dscottboggs_gitlab> I suppose I could get rid of that, and include YAML::Serializable directly on the class, then add annotations everywhere..
<FromGitter>
<dscottboggs_gitlab> ...but crystal's annotations are so ugly...haha
DTZUZO has quit [Ping timeout: 268 seconds]
<FromGitter>
<dscottboggs_gitlab> I guess FileMetadata is a really big class and I was just trying to atomize it a bit
<FromGitter>
<Blacksmoke16> Wouldn't modules work better?
<FromGitter>
<dscottboggs_gitlab> Sorry, I don't see how `include`ing a module with a serializer class would change anything? or do you mean with manual serialization in the module?
<FromGitter>
<dscottboggs_gitlab> oh, actually, I can't include Serializable directly onto the class, because the data that's being serialized is only a partial state, it's merged in on top of existing data, and you can't create a `FileMetadata` solely from the information stored in the config file.
<FromGitter>
<dscottboggs_gitlab> I guess I could use some aliases and NamedTuples since they have a`{#to,.from}_yaml`
<FromGitter>
<Blacksmoke16> hmm
<FromGitter>
<Blacksmoke16> just not used to seeing that nested class pattern
return0e has quit [Remote host closed the connection]
DTZUZO has joined #crystal-lang
<FromGitter>
<dscottboggs_gitlab> Really? I use it a lot in crystal, just to like dry up or partition a set of related attributes. It doesn't do anything weird to the code does it? I just figured it nested a namespace under it
<FromGitter>
<Blacksmoke16> yea thats normally what id use a module for, just namespacing related code
<FromGitter>
<dscottboggs_gitlab> but modules are functional namespaces
<FromGitter>
<vladfaust> I just wanted to share an idea of Crystal shard manager -- shaman. That's simple, but allows to stick to a legend and nice shamanise design with Voodoo and stuff :)
<FromGitter>
<kevinelliott> @vladfaust beyond what `shards` already does?
<FromGitter>
<vladfaust> I'm talking about central repository, ofc
<FromGitter>
<kevinelliott> @vladfaust I am working with @straight-shoota on a platform similar to RubyToolbox
<FromGitter>
<vladfaust> More or less, yes
eisque has joined #crystal-lang
<FromGitter>
<vladfaust> Shardbox, btw. I have this username on github, can give it to you
<eisque>
How do you extend a module from library and add additional macros to it?
<FromGitter>
<kevinelliott> @vladfaust Cool, thanks for the offer. I can discuss with @straight-shoota β¦ we are considering *toolbox/*box naming, but want to chat with the RubyToolbox guys first and get their blessing if we do go that route. FWIW, `shardbox` is definitely different enough that I donβt think it would impose to seriously on their name
<FromGitter>
<vladfaust> It's absolutely different :)
<FromGitter>
<vladfaust> Shardbox is like jewelry box, and toolbox is with hammers and wrenches
<FromGitter>
<hanneskaeufler> Does anyone have good examples for the `pretty_print` module? Trying to achieve printing a block of text to the console that is at most 80 chars wide and wraps at spaces between words. Somehow I struggle with this.
ternarysolo has joined #crystal-lang
<FromGitter>
<mavu> take 80 chars, go backwards to first space you find, remove from beginning to that point and print it, repeat with the rest?
<jokke>
any lucky devs around? is it currently possible to have array columns?
<FromGitter>
<mavu> Quick question: If I start a fiber with spawn do, and fork after that, that fiber gets forked too, and I have 2 running, right?
<FromGitter>
<hanneskaeufler> @FromIRC jokke, no, that's not a supported column type out of the box right now.
<FromGitter>
<bew> @mavu 2 fibers + the ones already running (the current one, and another one created by the stdlib at beginning of your program iirc)
<jokke>
alright
<FromGitter>
<mavu> @bew ok, thanks
moei has joined #crystal-lang
<FromGitter>
<mavu> @hanneskaeufler I jsut tried, and I can't get it to work either.
<jokke>
@hanneskaeufler: where should i put more complex application logic in lucky? something like service objects
<FromGitter>
<mavu> Pretty prints obj into io with the given width as a limit and starting with the given indentation. β https://play.crystal-lang.org/#/r/64lq
<FromGitter>
<mavu> Does not seem to work as advertized :P
<FromGitter>
<hanneskaeufler> exactly, thought I was just not understanding correctly
<FromGitter>
<hanneskaeufler> will probably file a bug ... :D
<z64>
i don't think PrettyPrint is intended to wrap strings like that
<FromGitter>
<mavu> @z64 well, then the documentation could use a clarification, but one of the 2 is definitely off.
<jokke>
hm i think a form will do fine for my logic
<jokke>
a virtual form that is
<jokke>
another question: are forms run in transactions?
<jokke>
specific case: i have a create action that allows me to submit nested data. for me to make the associations i'd need the created record.
<jokke>
if something goes wrong with creating the associated records the whole thing should roll back
<z64>
@mavu if you see the pretty printer specs, like here for example https://github.com/crystal-lang/crystal/blob/master/spec/std/pretty_print_spec.cr#L248-L264, the printer is designed to wrap "breakable" elements. it is an elements job to describe to the printer how it can be broken up by implementing `def pretty_print(pp)`, and if you see Strings implementation, the only "breakable" element is a newline
<FromGitter>
<hanneskaeufler> Btw there is a "Lucky" chat room as well, you might get more specific answers there jokke: https://gitter.im/luckyframework/Lobby
<jokke>
oh, right
<jokke>
sorry
<z64>
PrettyPrinter docs references the ruby implementation, which has a disclaimer that "actual outputs may overflow maxwidth if long *non-breakable* texts are provided"
<Jenz>
Nice, crystal .27 is listed as a significant update in Alpine Linux 3.9 release, together with Linux, GCC and similar
<FromGitter>
<j8r> mps do you know why contributors are sorted alphabetically, vs. in commits number?
<Jenz>
One commit *can* be much more than a dozen
<Jenz>
I.e. the number of commits don't neccesarily say much about how much work has been done in them. I guess they can be misleading
<FromGitter>
<j8r> sure, it certainly means more than the name of the guy
<FromGitter>
<j8r> usually top committers are more involved in the project - not always
<mps>
j8r: first version was by number of commit and looked as some kind of ranking, most commits at the top and least at bottom
<mps>
but changed to alphabetical order in 'last minute' because it doesn't reflect real contribution
<mps>
it is hard, if actually is possible, to measure contribution on such project
<mps>
Jenz is right
<mps>
for example, one can make some number of cosmetical changes and every change in separate commit so count of his commits grows by large
<mps>
and someone can make a big job in important subsystem with just one commit, so you understand why the list in alpha order
<mps>
Jenz: I thought that crystal upgrade to 0.27 is important for crystal community so we added it. Thought to ask here last night should we add it in list, when the release notes outlined but didn't had enough time
<FromGitter>
<j8r> this isn't about ranking
<FromGitter>
<j8r> it's about sorting
<Jenz>
mps: Hehe, it's awesome. Love how Crystal is slowly but surely gaining the reputation it deserves
<mps>
j8r: first version looked as some kind of ranking
<FromGitter>
<j8r> so why specifying commits numbers then?
<FromGitter>
<j8r> or, being able to sort ourself by name or by commit in client side - two columns
<mps>
I also have split mind about it, not sure if these numbers should be there but they doesn't hurt at the end
<mps>
looks little strange, but I don't care
<FromGitter>
<j8r> then having the ++additions and --deletion? Don't know, I think they will better be in a separated "stats" page
<FromGitter>
<j8r> I always use alpine@latest with alpne@edge repo added only for crystl and shards
<FromGitter>
<j8r> jemc crystal 0.27.1 will be out soon
<mps>
jemc: you are welcome
<jemc>
j8r: I don't necessarily care about having the latest and greatest in every case, and would prefer to have reproducible. The only reason I had to use edge here was because I found a lot of typechecking broke for me in this project when I downgraded to whatever older version was on alpine 3.8
<mps>
j8r: well, I had a hope that the 0.27.1 will be released last month to add it, but it is not.
<FromGitter>
<j8r> alpine stable and crystal stable will never be synced - that's normal
<FromGitter>
<j8r> why using crystal@edge won't be reproducible jemc?
<jemc>
I'm not informed enough to say for sure - maybe it is. I just took the approach of assuming that I should increment versions manually
<jemc>
particularly, I want to make sure that I notice if a different version of LLVM is used to build crystal, because I have to use the same LLVM version to build pony in that image for things to play nicely together
<FromGitter>
<r00ster91> oooh yes, sorry. Doing that with a fiber is an awful idea. Of course with something like this and then when you want to get the time, divide the constant by the current time