nayena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Uncle_Cid is now known as pwnd_nsfw
mossplix has quit [Remote host closed the connection]
fercell has quit [Ping timeout: 240 seconds]
dviola has quit [Ping timeout: 240 seconds]
fercell has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
drincruz has quit [Ping timeout: 256 seconds]
fercell has quit [Ping timeout: 265 seconds]
fowl has joined #ruby
fercell has joined #ruby
mossplix has joined #ruby
cd has joined #ruby
<AndreYuhai>
How can I see what headers are sent when I make a request with Mechanize?
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
<AndreYuhai>
Because I am still not sure how the headers are sent. Like do cookies set previously get sent?
<AndreYuhai>
I was always passing my own headers.
roadie has quit [Ping timeout: 260 seconds]
fercell has quit [Ping timeout: 260 seconds]
maidhc has joined #ruby
fercell has joined #ruby
<AndreYuhai>
To my surprise, log file works for that purpose.
maidhc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
markong has quit [Ping timeout: 240 seconds]
markoong has joined #ruby
dviola has joined #ruby
<apteryx>
Would someone know at what stage the file lib/ruby/vendor_ruby/cache/pkg/package-version.gem is produced? Probably during 'gem install' but I'm not sure. Is it possible to prevent installing this cached gem altogether?
dviola has quit [Ping timeout: 256 seconds]
drincruz has joined #ruby
roadie has joined #ruby
schne1der has quit [Ping timeout: 260 seconds]
roadie has quit [Ping timeout: 256 seconds]
dviola has joined #ruby
<al2o3-cr>
AndreYuhai: you can view the request headers with a hook.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndreYuhai has quit [Quit: Leaving]
ximovai has joined #ruby
howdoi has joined #ruby
imode has joined #ruby
alfiemax has joined #ruby
alfiemax_ has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
alfiemax_ has quit [Ping timeout: 260 seconds]
Technodrome has joined #ruby
ellcs has joined #ruby
alexherbo2 has joined #ruby
mossplix_ has quit [Remote host closed the connection]
mossplix has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
r29v has joined #ruby
alfiemax has joined #ruby
DEac- has quit [Quit: Reconnecting]
DEac- has joined #ruby
xco has joined #ruby
DEac- has quit [Client Quit]
DEac- has joined #ruby
DEac- has quit [Client Quit]
DEac- has joined #ruby
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
wymillerlinux has quit [Ping timeout: 258 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
DEac- has quit [Quit: Reconnecting]
DEac-_ has joined #ruby
DEac-_ is now known as DEac-
bsdbandit-01 has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
akem has quit [Ping timeout: 246 seconds]
DEac- has quit [Quit: Reconnecting]
DEac- has joined #ruby
ellcs has quit [Ping timeout: 256 seconds]
regedit has quit [Quit: Connection closed for inactivity]
akem has joined #ruby
maidhc has joined #ruby
maidhc has quit [Client Quit]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maidhc has joined #ruby
cthu| has quit [Read error: Connection reset by peer]
DEac- has quit [Quit: leaving]
cthu| has joined #ruby
DEac- has joined #ruby
skx86 has quit [Quit: Connection closed for inactivity]
xco has joined #ruby
cthu| has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
alfiemax has joined #ruby
maidhc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
lmat has joined #ruby
<lmat>
Am I a retard or does it take extra mental effort to read "unless"?
<adam12>
yes
<apotheon>
No?
<apotheon>
I mean, I wouldn't use it in complex conditionals, but if it's just a simple "unless" it seems the same as "if" to me, in terms of readability.
<adam12>
lmat: It's generally in the eye of the beholder, but personally I'll only use `unless` in postfix scenarios with a very clean predicate.
<apotheon>
I find "unless" better for readability than "if not" or "if !", personally.
<apotheon>
If there's an else involved, though, I'll just reverse the order of "if" and "else" or something like that, generally.
<apotheon>
Like I said, I like "unless" for only simple cases.
<adam12>
I'll reach for `if !` if it's a block almost always. My brain decomposes the intent a bit easier than `unless`.
<adam12>
Again, I think it's definitely developer dependent. Some people just read it differently.
<adam12>
But for someting simple like `do_work unless busy?` the postfix `unless` works well.
<xco>
when i do `?x` I get "w" back
<xco>
why can't i do it for a whole world? like `?world` to get "world"
<lmat>
Okay, so it's just me (regarding "unless") :-)
<lmat>
Every time I see it, I think "hmm, unless means if not...right? Yeah, I think so. Wait...yeah. Yeah, it does. If not, okay."
<leftylink>
will use unless, but will get angry if someone uses unless-else because come on
skx86 has joined #ruby
<adam12>
imho, I find unless as a block run the risk of double negation too, when people start getting lazy when updating code. Just tack on this crazy conditional to the end of the already crazy conditional. It's team dependent and not specifically because of `unless` but I find it happen with more frequency.
<leftylink>
would I be happy if there were an elsunless... I... will think about that
<lmat>
leftylink: I'll sit for five minutes reading that :-P
alfiemax has quit [Ping timeout: 258 seconds]
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
maidhc has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
cthu| has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
<havenwood>
xco: You can do `'s' 'o' 'm' 'e'` but not `?s ?o ?m ?e`. The character literal is actually disfavored, for a few reasons.
<havenwood>
xco: The bigger problem is folk got hung up on the 1.8-to-1.9 difference in behavior.
<havenwood>
xco: It fell out of favor in 1.9 and has never regained prominence since there's a perception it has no added value.
<havenwood>
xco: Used to be `119` and now it's `"w"`.
<havenwood>
xco: There was no compelling reason to keep using character literals, but nobody wanted to use something that breaks on 1.8 and confuses folk.
<havenwood>
xco: Now... 1.8 is gone. We probably shouldn't care, but folk just remember "avoid character literals" and not the why.
<havenwood>
They don't bother me.
<xco>
so i'd say iti's perfectly safe to keep them right?
<havenwood>
Live in the now!
<xco>
they don't seem to be a problem at all
<xco>
who uses 1.8 now anyway?
<xco>
link in production
<havenwood>
time travelers
<xco>
hahhaaa
<xco>
next tiem i see someone discouraging it's use i'd ask "WHY?"
<xco>
actually i saw people talking about this on rubocop
<havenwood>
xco: It fell out of favor due to 1.8 legacy and *was* scheduled for removal in 3.0.
schne1der has quit [Ping timeout: 258 seconds]
<xco>
got it
<havenwood>
I never bought into the call for removal. I just don't care. Removing is super painful so I expect to have character literals for possibly long enough that they fall back in favor. :P
BenDover has quit [Quit: BenDover]
<xco>
good thinking :D
<havenwood>
They'll survive 3.0. If they survive 4.0 I expect folk will have forgotten 1.8.
<xco>
definitely
shokohsc has joined #ruby
<adam12>
4.0 ....
<adam12>
I wonder if 3.0 ETA has moved at all
<havenwood>
adam12: Christmas!
<havenwood>
adam12: (But which Christmas?)
<adam12>
Indeed.
<adam12>
havenwood: Have you been playing with steep at all? Seems like it's moving at a decent pace.
bambanx has joined #ruby
<havenwood>
adam12: Trunk is still named "2.8" but release plans are still 3.0. If 2.8 renames to 3.0 we'll know Matz' decision.
<havenwood>
adam12: Yes, love Steep in VSCode. Sooooo cool. :D
<adam12>
havenwood: Yeah? I'm on VS Code now so I'll have to give it a try.
akem has quit [Remote host closed the connection]
<havenwood>
adam12: I'm really please I was able to recruit the Ruby core member working on types with baweaver's help, and that Square can support his work.
<havenwood>
I'm glad Sorbet is moving from RBI to RBS support too. RBS \o/
<havenwood>
No announcement to drop RBI yet, but seems inevitable?
<adam12>
I haven't been able to use Sorbet yet. No FreeBSD release, and once I moved back to Linux for devel, couldnt' get `sorbet init` to finish.
linuus[m] has joined #ruby
akem has joined #ruby
lmat has quit [Ping timeout: 256 seconds]
markong has joined #ruby
lmat has joined #ruby
<deimos_>
Hi, i'm trying to understand what i'm seeing. Say you're parsing 10-50GB webserver logs with ruby. IO.readlines(logfile).lazy.each do... still reads the file into an anonymous array in memory, right?
<havenwood>
adam12: It doesn't work on 2.7, so meh.
<havenwood>
adam12: C++ >.>
<deimos_>
versus, say, IO.foreach(logfile) which basically "streams" a file one new line at a time into a block
<havenwood>
deimos_: Yeah, just the `IO.readlines(logfile)` is already an Array of the full file in memory.
<havenwood>
deimos_: The subsequent #lazy doesn't change that.
<deimos_>
the code with IO.readlines is throwing memory errors
<havenwood>
deimos_: Yeah, #readlines reads all lines into memory at once.
<deimos_>
ok, what's that array called if not explicitly assigned to anything? anonymous array? temporary array?
<deimos_>
undefined array?
<havenwood>
deimos_: I'd say transient, but it's just the same as if you did: lines_in_memory = IO.readlines(logfile); line_in_memory.lazy...
<deimos_>
ok
roshanavand__ has quit [Ping timeout: 240 seconds]
<deimos_>
i did understand it correctly, just not clear terminology
<havenwood>
deimos_: Yes, seems so.
<deimos_>
going to add a comment to make sure next person doesn't try to go back to "IO.readlines"
roshanavand has joined #ruby
<deimos_>
since i've changed all their code to IO.foreach(logfile)
<deimos_>
IO.foreach.lazy seems, silly to me
markoong has joined #ruby
arzWZM has quit [Ping timeout: 240 seconds]
arzWZM has joined #ruby
<havenwood>
deimos_: It depends, I suppose. I you don't need lazy enumeration then I agree it's not needed.
markong has quit [Ping timeout: 272 seconds]
<havenwood>
If you don't*
<havenwood>
deimos_: I'd say "IO::readlines returns an Array of all lines, reading the entire file into memory."
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<deimos_>
trying to understand their mindset, i suspect the original person thought IO.readlines(logfile).lazy created an enumerator and didn't load it into an array because they didn't define a name for the array
<deimos_>
it does create an enumerator, but also an array
<havenwood>
deimos_: Yup, it certainly seems they were simply mistaken about how it works.
<havenwood>
deimos_: Yeah, the #lazy is simply too late. An Array with all lines in memory has already been returned by the previous method in the method chain.
<deimos_>
yeah, thanks for confirming my suspicions
<havenwood>
any time
maidhc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<deimos_>
for comic relief, in reading this code, I couldn't wrap my head around this "hash", Visitor.new("user agent","ipaddress","returncode", "bytessent")
<deimos_>
until i realized way too late that it was a struct
ur5us has joined #ruby
maidhc has joined #ruby
<havenwood>
deimos_: There's discussion of adding a Struct literal in Ruby 3, speaking of.