skade has quit [Quit: Computer has gone to sleep.]
<mbj>
solnic: have to run, cu later
mbj has quit [Quit: leaving]
jfredett-w has quit [Read error: Connection reset by peer]
jfredett-w has joined #rom-rb
jfredett-w has quit [Read error: Connection reset by peer]
snusnu has quit [Quit: Leaving.]
jfredett-w has joined #rom-rb
snusnu has joined #rom-rb
CraigBuchek has joined #rom-rb
skade has joined #rom-rb
breakingthings has quit []
breakingthings has joined #rom-rb
NemesisD has joined #rom-rb
<NemesisD>
i've got a custom type in a virtus object and i need to define a coercer for it that can optionally take a hash. what's the "right" way to do this? the coercible api does not look like it was meant to be extended to handle non "primitive" types
dkubb has quit [Read error: Connection reset by peer]
dkubb has joined #rom-rb
jfredett-w has quit [Read error: Connection reset by peer]
jfredett-w has joined #rom-rb
<dkubb>
I would love to see triage turn into something that instead of shelling out, wraps the tool and parses the output
<dkubb>
so we can do nicer things with it besides just displaying it
<dkubb>
parsing output doesn't necessarily mean parsing stdout, although it could with some tools that are completely CLI driven.. I would much rather see them using the libs directly and using the "response objects"
<mbj>
dkubb: I do the "direct call to the thing that parses ARGV" for some other reasons already.
<mbj>
dkubb: I'm under jruby / windows, and I dont have a stable setup for Kernel.system and firends.
<mbj>
dkubb: Also jruby spinup is very expensive. I can bring some of the knowlege bak to triage. For mutant I'm calling in-proces for ages already.
skade has quit [Quit: Computer has gone to sleep.]
<mbj>
dkubb: BTW hooking rake is very very dirty. You have to modify global ARGV :(, you cannot pass your own.
skade has joined #rom-rb
<mbj>
dkubb: I hate ruby tools playing the "I'll never be called from someone else, I'm the top pf the stack"
<dkubb>
you can call it with: rake mytask[1,2,3,4,5,6]
<dkubb>
replacing the numbers with the arguments
<dkubb>
but yeah, it's annoying when things cannot possibly imagine being run by something else
<dkubb>
even a rake task gets run inside shell scripts or by capistrano
<dkubb>
a pet peeve of mine is when proper exit codes aren't used because the assumption is that it'll always be run interactively
<dkubb>
as well as the obvious, not making the output pipe-able.. dumping everything in stdout instead of separating stderr and stdout
mbj has quit [Ping timeout: 272 seconds]
bf4 has joined #rom-rb
CraigBuchek has quit [Quit: CraigBuchek]
<NemesisD>
dkubb: how does one create a custom coercer? i need to upconvert hashes into domain objects in a virtus model
<NemesisD>
the examples in virtus show you can override coerce but that seems like it leaks because the "coercer" method is still used to determine success. but i realized there's no clear directions for how to write a custom coercer
<NemesisD>
i guess i should probably direct this at solnic instead since it's his library lol
mbj has joined #rom-rb
zekefast has joined #rom-rb
<dkubb>
NemesisD: yeah, I dunno. I don't really use virtus atm. your guess is as good as mine right now
<dkubb>
I would maybe check the specs to see how it does things
<dkubb>
or read through the code, searching for "coerce"
<NemesisD>
for the time being i'm just stuffing it into a .parse class method. overriding the coercers seems a bit hairy atm
<mbj>
dkubb: I missed your args comment. And I have to say I knew it.
<mbj>
dkubb: But imagine you are running some kind of a build script you run from a maven environment.
<mbj>
dkubb: So you have to start a jruby interpreter and get a ruby environment.
<mbj>
dkubb: Now you wanna call a rake task, with exactly the CLI behavior (as you'd normally do via shelling out), but we cannt for spinup and windows reasons (I'd not choose windows :D)
<mbj>
dkubb: Some of the ruby tools simply dont have the chance to run the CLI via your own ARGV
<mbj>
dkubb: And forget, I already sovled this :D
<mbj>
dkubb: Full blame on me :D, its actually very easy.
<mbj>
dkubb: But all ruby tools with clis should offer: existatus = Tool::CLI.run(%w(my --own ARGV here))
<mbj>
dkubb: Rake doesnt, but should.
martxel has quit [Quit: WeeChat 0.4.1]
<jfredett-w>
mbj: I'd much prefer all ruby tools w/ a cli provide an API to their actual domain model...
mbj has quit [Read error: Connection reset by peer]
<jfredett-w>
that, of course, predicates that every CLI tool _have_ a domain model worth hooking into. :)
<dkubb>
jfredett-w: I like it when tools provide the Tool::CLI interface that mbj outlined, so that you can just do: exit Tool::CLI.run(%w(my --own ARGV here)) .. but I agree there *should* be something even lower level that I can get to if I want