<nakilon>
how would you render 11d11h if you are told to round it to 3 most significant digits?
<nakilon>
and what is better? "1 mon 3 weeks" or "7 weeks 2 days" or "51 days"?
KramerC_ has joined #ruby
KramerC has quit [Quit: Leaving]
KramerC_ is now known as KramerC
<leftylink>
hmm, maybe someone will complain "1 month is variable number of days"
<nakilon>
but if you see "41 weeks" or "287 days" won't you waste your time thinking how much months is that?
<leftylink>
that is true
<nakilon>
I'm thinking about reducing by [significant digits, string length]
<nakilon>
so it would be 51 days and 41 weeks
CrazyEddy has quit [Ping timeout: 245 seconds]
<nakilon>
"9 months 2 days" would be the same sig digits but bigger str len
<nakilon>
than 41 weeks
<nakilon>
but then the 9 m 10 d + 1day becomes 9 m 11 d and here is the question of rounding again it it was told to round to 2 digits
<nakilon>
I could hardcode that you can't round by 10d and 10h
<nakilon>
and it should be [significant digits, all digits displayed, string length] to judge "41 weeks" to be better than "290 days" otherwise they are equal
TomyWork has joined #ruby
va5c0 has joined #ruby
patrick has quit [Quit: WeeChat 3.0.1]
Rounin has joined #ruby
<nakilon>
or rather [all digits displayed, string length] and disallow to discard minutes in 2h00m if N>=3 since it covers them
CrazyEddy has joined #ruby
<nakilon>
I guess it should work, gotta render the table for all N and every second to see for sure
patrick has joined #ruby
goldfish has joined #ruby
<nakilon>
hm, bad thing is that you 1h01m, not 1h1m, but you write 1y9m, not 1y09m
<nakilon>
I guess
<nakilon>
orrrrr you can write 1h1m but imagining it as 101 to have N=3 be already used under the hood
<nakilon>
not sure though it the "string length" metric then should measure 1h1m or 1h01m
<nakilon>
*if
goldfish has quit [Ping timeout: 265 seconds]
<wnd>
FWIW in most scenarios I find it harmful to use "x ago" dates. Not only do they make it harder to figure out the actual date or time, but also tend to hide information and be vague. I get it that "ago" dates may make it easier put events on a /relative/ timeline, but only if you have context. It's a can of worms.
<wnd>
Let's take "2 months ago". When was that? 59 days ago? 88 days ago? Without other dates you can't tell if that's exact, or if the "10 days" was omitted. How many days are "1 month 5 days" and "3 months 20 days" apart? It only gets worse with short representation, e.g. "5m ago". Is that minutes or months? Sometimes there's no context. Then there are weeks. I really hate weeks. Week 40. When is that? 20 weeks ago? What month is that, even?
<nakilon>
timestamps and distance between them are different data types though
<nakilon>
they aren't supposed to replace each other
Oxfuxxx has quit [Quit: never underestimate the power of the butt...ON]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
va5c0 has quit [Ping timeout: 245 seconds]
va5c0 has joined #ruby
kiki_lamb has joined #ruby
perrierjouet has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
gr33n7007h has quit [Ping timeout: 252 seconds]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
crankharder has joined #ruby
gr33n7007h has quit [Client Quit]
motherr has joined #ruby
maria_elis has joined #ruby
noa has joined #ruby
noa has quit [Client Quit]
reset has joined #ruby
noa has joined #ruby
kiki_lamb has joined #ruby
gr33n7007h has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
va5c0 has quit [Ping timeout: 265 seconds]
kiki_lamb has joined #ruby
va5c0 has joined #ruby
kiki_lamb has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
kiki_lamb has joined #ruby
teclator has joined #ruby
kiki_lamb has quit [Ping timeout: 260 seconds]
crankharder has quit [Ping timeout: 260 seconds]
crankharder has joined #ruby
jocke has quit [Quit: Client closed]
ccapndave has joined #ruby
<ccapndave>
Hey everyone - I have a Ruby script and I want it to call another script and then quit (but leave the new script running). What's the best way to approach that?
<nakilon>
exec
<nakilon>
IIRC it immediatelly replaces itself with new process
<ccapndave>
nakilon: Thanks very much (sorry, my internet went down for some reason)
kiki_lamb has quit [Ping timeout: 260 seconds]
<nakilon>
don't do exec in your router ..D
<ccapndave>
Do you think environment variables sent to the Ruby script will get passed through? e.g. I'm calling it with `NAME=dave ./myrubyscript` and I want `NAME` to be available to the script I call with `exec` too
<ccapndave>
How do you mean?
<nakilon>
launch irb, do ENV["XXX"]="YYY"; exec 'ruby -e "p ENV.sort"'
<nakilon>
you'll XXX somewhere in the end
<nakilon>
*you'll see
<nakilon>
so it should work
noa has quit [Quit: Konversation terminated!]
<ccapndave>
It does work :)#
<ccapndave>
Very good
gggpkm__ has quit [Ping timeout: 260 seconds]
ccapndave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
kiki_lamb has joined #ruby
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
walez has joined #ruby
kiki_lamb has quit [Ping timeout: 265 seconds]
ccapndave has joined #ruby
ccapndave has quit [Client Quit]
CrazyEddy has quit [Ping timeout: 260 seconds]
gggpkm has joined #ruby
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 265 seconds]
jocke has joined #ruby
va5c0 has quit [Ping timeout: 252 seconds]
TCZ has joined #ruby
va5c0 has joined #ruby
kiki_lamb has joined #ruby
jocke has quit [Quit: Client closed]
goepsilongo has joined #ruby
kiki_lamb has quit [Ping timeout: 260 seconds]
Oxfuxxx has joined #ruby
TomyWork has quit [Quit: Leaving]
bit4bit has joined #ruby
kiki_lamb has joined #ruby
gggpkm has quit [Ping timeout: 252 seconds]
va5c0 has quit [Ping timeout: 265 seconds]
kiki_lamb has quit [Ping timeout: 252 seconds]
woink has joined #ruby
va5c0 has joined #ruby
bit4bit has quit [Ping timeout: 252 seconds]
TCZ has quit [Quit: ...]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 265 seconds]
va5c0 has quit [Quit: WeeChat 3.2]
moeSizlak has joined #ruby
<moeSizlak>
any idea if/how i can redirect stderr to syslo
<moeSizlak>
*syslog
_ht has joined #ruby
Oxfuxxx has quit [Quit: never underestimate the power of the butt...ON]
<adam12>
moeSizlak: Re-assign $stderr to something that quacks like an IO object but actually sends to Syslog?
<weaksauce>
it's always been kinda a shit way to get docs imo
<adam12>
I started one, kinda. gemdocs.org
<adam12>
Only launched it a few weeks ago, experimental.
Starfoxxes has quit [Ping timeout: 260 seconds]
<nakilon>
adam12 do you add manually?
<adam12>
nakilon: I backfilled manually. I have a webhook for rubygems.org but it's not hooked up _yet_. But hopefully when I get some free time.
<adam12>
It won't support Github docs for now; I think that's a big reason why rubydoc.info does what it does. Some gems generate __huge_ docs.
<nakilon>
I guess you better make it generate what people want to see rather than everything from the hook
<adam12>
Well, it's an experiment. I might have to blacklist some gems, maybe high-level mark some (so I prune old versions), etc. I'm not sure yet. I wanted to see what it would look like to generate and store _every_ gem's documentation.
<adam12>
On the cheap, because there's no funding for it.
<adam12>
I backfilled from the Gemfile's for a bunch of my projects. If you have gems you want added, LMK.
<weaksauce>
devise is one that probably should be there
<nakilon>
gem oga -- is what I wanted to look up right now, but already solved it
<weaksauce>
and warden
<nakilon>
gem ruby-vips, for example, just hosts docs it on their website so there is no need to render them on your one at all
<weaksauce>
rubyapi.org is pretty great
<weaksauce>
i do wish it had a "browse" feature though
<adam12>
I like rubyapi.org. Maybe they'll get support for gems (tho I think they'll get support for mruby/artichoke/whatever before that).