<leftylink>
you have already made the good idea to say `log.debug(log_statement)`. that already tells you what is wrong, particularly what you called parse_recur on.
<AndreYuhai>
hey there, when I am making a request with Mechanize sometimes it takes too much time because the response is like 3 MB or 4 MB. Since it's json I then have to wait for parsing it as well.
<AndreYuhai>
Any suggestions for a faster way?
jonhg has quit [Remote host closed the connection]
<adam12>
AndreYuhai: Maybe some sort of streaming parser?
<adam12>
AndreYuhai: You’d have to switch to something like oj tho. I dont’ believe stdlib json will parse a stream.
<AndreYuhai>
adam12, I will check that. And is there anything I can do about the request? Not sure whether other libraries would load faster but I can try.
NL3limin4t0r_afk is now known as NL3limin4t0r
al2o3-cr has quit [Ping timeout: 256 seconds]
<adam12>
AndreYuhai: Hard to say, really. You’d need to figure out where the bottleneck is. Does something like `curl` load faster? If it does, maybe you need to use one of the curl bindings.
<AndreYuhai>
adam12, Yes, much much better. I am doing it in an irb session though. Not sure whether that would affect.
roadie has quit [Quit: ERC (IRC client for Emacs 27.1.91)]
<AndreYuhai>
adam12, Oh I think the problem is the irb session
<AndreYuhai>
If I call the script then it's fast.
jonhg has joined #ruby
<AndreYuhai>
pry is OK too, irb is too slow
<AndreYuhai>
I liked that multiline editing stuff but will switch back to pry probably.
<AndreYuhai>
Thanks for helping me debug, adam12!
<adam12>
AndreYuhai: Cheers.
jonhg has quit [Ping timeout: 276 seconds]
m27frogy has joined #ruby
alexherbo2 has joined #ruby
vondruch has quit [Ping timeout: 264 seconds]
lbwski has joined #ruby
akem_ has joined #ruby
nofxx_ has quit [Remote host closed the connection]
nofxx_ has joined #ruby
lbwski has quit [Ping timeout: 264 seconds]
akem has quit [Ping timeout: 245 seconds]
jonhg has joined #ruby
akem_ has quit [Ping timeout: 246 seconds]
jonhg has quit [Ping timeout: 246 seconds]
wsmoak has joined #ruby
jonhg has joined #ruby
<BeerLover>
adam12 this will fail as it will try to iterate over integers and string as well
<BeerLover>
i fixed it.
<BeerLover>
thanks
AndreYuhai has quit [Quit: Leaving]
yann-kaelig has joined #ruby
AndreYuhai has joined #ruby
Swyper has joined #ruby
StarOnD has joined #ruby
joshcom has joined #ruby
vondruch has joined #ruby
dg1727 has quit [Remote host closed the connection]
dg1727 has joined #ruby
shokohsc6 has quit [Ping timeout: 276 seconds]
hiroaki__ has quit [Ping timeout: 246 seconds]
akem has joined #ruby
hiroaki__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
shokohsc6 has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
tweaks has quit [Quit: tweaks]
<nakilon>
14:51:23 <AndreYuhai> I liked that multiline editing stuff but will switch back to pry probably.
<nakilon>
I was disgusted by colors and bugs about the end of the Terminal line but gladly I don't have to spend time with newer rubies
<AndreYuhai>
nakilon, in IRB?
rwb has joined #ruby
<nakilon>
AndreYuhai, yes
<AndreYuhai>
What do you mean by bugs about the end of the Terminal line?
<nakilon>
when the code goes from one line to a new one those fancy colored chars were splitting in two or something like that, breaking the ability to copypaste, etc.
<AndreYuhai>
One annoying thing I've encountered is when you do multiline then you can't look up for a previous line by using up key. :D
<nakilon>
on macOS at least
<nakilon>
in macOS you look up previous commands in any CLI and prompt by just cmd+Up -- it's a universal shortcut
<AndreYuhai>
oh I've not encountered that.
<AndreYuhai>
I've been using up key for previous commands however when you have multilines it's basically going up one line
<nakilon>
I imagine it's like in Chrome console
<NL3limin4t0r>
AndreYuhai: When working with irb and long return results I tend to end lines with `;nil` to let irb not print the result.
<AndreYuhai>
NL3limin4t0r, oh I do that sometimes as well, if I remember. :D
lbwski has joined #ruby
<NL3limin4t0r>
It's often not the operation that is slow, just the print of each return statement. Especially when those are large.
<NL3limin4t0r>
Another option when working with irb, is to wrap your code inside a `begin`/`end` block, that way irb doesn't print the return value of each statement, but only the final value returned by the block.
<AndreYuhai>
Yes, copy & pasting on irb is so slow as well.
Hedaleth has quit [Ping timeout: 264 seconds]
<AndreYuhai>
haven't tried with begin end but will try. Actually I will try that request I was trying to make in IRB again to see whether that works
lbwski has quit [Ping timeout: 256 seconds]
<AndreYuhai>
Perfect, NL3limin4t0r thank you for the suggestion.
Hedaleth has joined #ruby
<NL3limin4t0r>
When working with larger scripts and IRB, you could also paste them in an .rb script inside your working directory. Then use `result = load('./script.rb')` this will only give you access to the return value and not al the intermidate variables, but sometimes the return value is all you need.
<NL3limin4t0r>
I'm dropping the ball here a bit, I thought #load returned the final result but it only returns true/false so you cannot use that.
<adam12>
You can also trigger irb in the script via binding.irb.
<NL3limin4t0r>
Ah, been looking throught the IRB documentation. I guess I meant `source('./script.rb')` which (obviously) sources the script in IRB. Giving you full access to all local variables defined in there.
<NL3limin4t0r>
By pasting large chunks of code into a file, then sourcing it you'll remove the slowness of pasting into IRB as well.
lbwski has joined #ruby
AndreYuhai has quit [Read error: Connection reset by peer]
akem has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
TomyLobo has quit [Quit: Leaving]
cloud69 has joined #ruby
tweaks has joined #ruby
Swyper has quit [Remote host closed the connection]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
trautwein has joined #ruby
ramfjord has joined #ruby
trautwein has quit [Ping timeout: 246 seconds]
trautwein has joined #ruby
siery has quit [Ping timeout: 264 seconds]
siery has joined #ruby
trautwein has quit [Ping timeout: 264 seconds]
Swyper has joined #ruby
<jidar>
is there a reason gem uninstall and gem pristine check different paths to kick off? I can't seem to uninstall a gem because the uninstall expects the gem to be in /usr/local/share, rather than /usr/share
TomyLobo has joined #ruby
Swyper has quit [Ping timeout: 258 seconds]
<havenwood>
jidar: Show the error output?
<havenwood>
jidar: Are you doing `--all` or a specific gem?
<jidar>
but whatev, not a big deal and as always thank you so much for the help havenwood
<havenwood>
🙌
trautwein has quit [Ping timeout: 264 seconds]
Dweezahr has joined #ruby
Hedaleth has quit [Quit: Leaving]
<Dweezahr>
I'm having difficulties with Ruby. I have a few assumptions: 1 don't run gem install as root, 2 run programs that write /etc with the root account, 3 minimise root usage. So I install schleuder with gems, apparently it is installed in a user path? Very strange. Then run the gem with an install flag, it fails to run as no write access to /etc. Run as root, it is not installed?
Xiti` has quit [Quit: Leaving]
trautwein has joined #ruby
cthulchu has joined #ruby
trautwein has quit [Ping timeout: 246 seconds]
<NL3limin4t0r>
Dweezahr: Do both the user and root use the same Ruby? Or does your user use RVM Ruby while root uses system Ruby?
<Dweezahr>
NL3Limi4t0r, it is /etc/gemrc having a --user-install
<Dweezahr>
I removed it and now things seem to work normally
Fabio_ has joined #ruby
howdoi has joined #ruby
SuperLag has quit [Remote host closed the connection]
trautwein has joined #ruby
trautwein has quit [Ping timeout: 240 seconds]
kroger has joined #ruby
GodFather has joined #ruby
BeerLover has quit [Ping timeout: 246 seconds]
ikus060 has quit [Quit: Leaving]
memcorrupt has joined #ruby
BeerLover has joined #ruby
arooni_team_b is now known as arooni
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
memcorrupt has quit [Remote host closed the connection]
trautwein has joined #ruby
andremedeiros has quit [Read error: Connection reset by peer]
Rudd0 has quit [Ping timeout: 260 seconds]
andremedeiros has joined #ruby
trautwein has quit [Ping timeout: 265 seconds]
konsolebox has joined #ruby
Fabio_ has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #ruby
TomyLobo has quit [Quit: Leaving]
Omnilord has joined #ruby
_joes_ has joined #ruby
fercell has joined #ruby
ferr_ has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
teardown has quit [Ping timeout: 268 seconds]
kroger has left #ruby ["ERC (IRC client for Emacs 28.0.50)"]
NL3limin4t0r is now known as NL3limin4t0r_afk
Omnilord has quit [Quit: Leaving]
TCZ has joined #ruby
_joes_ has quit [Remote host closed the connection]
trautwein has joined #ruby
trautwein has quit [Ping timeout: 265 seconds]
swaggboi has quit [Quit: C-x C-c]
teardown has joined #ruby
hiroaki1 has quit [Ping timeout: 240 seconds]
hiroaki1 has joined #ruby
teardown has quit [Remote host closed the connection]
teardown has joined #ruby
swaggboi has joined #ruby
stryek has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
vondruch has quit [Read error: Connection reset by peer]
roadie has quit [Quit: ERC (IRC client for Emacs 27.1.91)]
vondruch has joined #ruby
gix has joined #ruby
s3nd1v0g1us has joined #ruby
naftilos76 has quit [Ping timeout: 264 seconds]
ur5us_ has joined #ruby
akem_ has joined #ruby
hiroaki__ has quit [Ping timeout: 272 seconds]
akem has quit [Ping timeout: 264 seconds]
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #ruby
FastJack has quit [Ping timeout: 245 seconds]
FastJack has joined #ruby
alexherbo2 has quit [Ping timeout: 245 seconds]
alexherbo2 has joined #ruby
hiroaki__ has joined #ruby
siery has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 246 seconds]
ramfjord has joined #ruby
alexherbo2 has quit [Ping timeout: 245 seconds]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 260 seconds]
trautwein has joined #ruby
trautwein has quit [Ping timeout: 272 seconds]
plujon has joined #ruby
<plujon>
Should assignment methods return the value that is assigned ?
<plujon>
E.g., 'object.foo = 3' # would this normally return 3 ? Or is nil ok ?
<havenwood>
plujon: Yeah, I'd say returning the assigned value is fairly normal but nil is also okay. Up to you!
<plujon>
havenwood: Thanks.
tpanarch1st has joined #ruby
jenrzzz has joined #ruby
akem has joined #ruby
jonhg has quit [Remote host closed the connection]