<Tonker>
the code has " require 'nokogiri' " in the top. Like I said, it was pretty much an old abandoned project that hadn't seen a update in years
<havenwood>
Tonker: Ah, maybe it just used Nokogiri directly. Nokogiris is the most popular XML/HTML parser.
<Tonker>
so i had to manually get optparse, nokogiri, open-uri, and uri if I remember right. It was a pain to figure it all out
<havenwood>
mmm, yeah, that's a stdlib direction to go
dfucci has quit [Ping timeout: 260 seconds]
<Tonker>
Suprisingly it all went smoothly after I updated the target url's. Although I can't figure out how to get the .sh file included in it to work nicely with windows
<Tonker>
I worked around it tho, so no biggie
<Tonker>
I might try and actually learn Ruby tho. For some reason, Python just bores the hell out of me haha
<Tonker>
would you recommend I learn ruby for web scraping? I might need to look into whether beautiful soup or nokogiri is better
<havenwood>
Tonker: Maybe JavaScript or TypeScript for headless scraping? Elixir for fault tolerant, parallel scraping? There are lots of other options. Ruby is very nice.
<havenwood>
Tonker: It depends what you're scraping and why.
<Tonker>
Basically, theres this guy named John McCrae whose written a couple Web Serials. That old web scraper I found converts it each page of the website into an html file. Then I use calibre in the cmd line to convert it.
donofrio has quit [Remote host closed the connection]
dfucci has joined #ruby
<Tonker>
One of his web serials is on-going though. So if I want an updated version to put on my kindle, I gotta run the script again
<Tonker>
He's also stated on his website that personal copies are OK, so long as I don't try and sell them, which I'm not. I just like reading on my kindle lol
<Tonker>
I've heard web scraping can be uhh..ethically dubious, I guess?
Tonker has quit [Quit: Leaving]
Tonker has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
chouhoulis has quit [Remote host closed the connection]
burgestrand has joined #ruby
burgestrand has quit [Client Quit]
nofxx__ has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
nofxx_ has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ChmEarl has quit [Quit: Leaving]
dfucci has joined #ruby
mich9x has joined #ruby
burgestrand has joined #ruby
burgestrand has quit [Client Quit]
mich9x has quit [Quit: mich9x]
dfucci has quit [Ping timeout: 260 seconds]
burgestrand has joined #ruby
burgestrand has quit [Client Quit]
fanta1 has joined #ruby
iNs has quit [Ping timeout: 240 seconds]
iNs has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ruby
dfucci has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rudd0 has quit [Remote host closed the connection]
_whitelogger has joined #ruby
orbyt_ has joined #ruby
adu has quit [Quit: adu]
_whitelogger has joined #ruby
vondruch has joined #ruby
ur5us has joined #ruby
dfucci has quit [Read error: No route to host]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xiti has quit [Quit: Leaving]
zacts has joined #ruby
zacts has quit [Client Quit]
Xiti has joined #ruby
burgestrand has joined #ruby
prion has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
braincrash has joined #ruby
cuerbot has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
Technodrome has joined #ruby
elcuervo has quit [Ping timeout: 265 seconds]
jacksop has joined #ruby
Tonker has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
prion has quit [Ping timeout: 264 seconds]
Nilium has quit [Ping timeout: 256 seconds]
Emmanuel_Chanel has quit [Remote host closed the connection]
cd has quit [Quit: cd]
Nilium has joined #ruby
cognemo has quit [Quit: cognemo]
cognemo has joined #ruby
Rudd0 has joined #ruby
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #ruby
plant_enjoyer has joined #ruby
jacksop has quit [Remote host closed the connection]
jacksop has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jacksop has quit [Ping timeout: 260 seconds]
DaRock has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
Matadoer has quit [Quit: ciao]
burgestrand has quit [Quit: burgestrand]
sleetdrop has joined #ruby
jenrzzz has joined #ruby
prion has joined #ruby
jacksop has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jacksop has quit [Remote host closed the connection]
jacksop has joined #ruby
<tempate>
How exactly does Array#sum work?
<tempate>
I thought it was just an alias for Array#map and reduce(:+)
<leftylink>
hmm... well, I would say I cannot find a time where it would be functionally different. but if the question was instead more along the lines of how it'd be implemented under the hood... the links provided by &ri have an Expand source button. it's usually C, not sure how many insight it's possible to glean
dfucci has joined #ruby
<leftylink>
hmm... hashes auto-freeze their string keys. wonder if sets do the same
<leftylink>
no sir they do not
<leftylink>
oh wait they do
<leftylink>
I think they duped it first which is why I couldn't tell!
al2o3-cr has joined #ruby
weaksauce has quit [Ping timeout: 256 seconds]
<tempate>
Hmmm
<tempate>
I was asking because yesterday I had problems using Array#sum for lists, but managed to solve it by using map and reduce(:+)
jacksop has quit []
phaul has quit [Ping timeout: 256 seconds]
rubydoc has quit [Ping timeout: 246 seconds]
rubydoc has joined #ruby
phaul has joined #ruby
jenrzzz has joined #ruby
Nahra has joined #ruby
nowhere_man has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 260 seconds]
rubydoc has joined #ruby
phaul has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem__ is now known as akem
burgestrand has quit [Quit: burgestrand]
dfucci has quit [Ping timeout: 260 seconds]
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
sh7d has quit [Quit: meh]
burgestrand has joined #ruby
plant_enjoyer has quit [Quit: Leaving]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
braincrash has quit [Ping timeout: 260 seconds]
burgestrand has quit [Quit: burgestrand]
rubydoc has quit [Ping timeout: 246 seconds]
phaul has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
Technodrome has joined #ruby
hiroaki has quit [Ping timeout: 256 seconds]
rubydoc has joined #ruby
phaul has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
dfucci has joined #ruby
braincrash has joined #ruby
Swyper has joined #ruby
<akem>
Hey, any idea why ENV.inspect does not include $COLUMNS and $LINES (terminal screen size)?
dfucci has quit [Ping timeout: 260 seconds]
hiroaki has joined #ruby
TCZ has joined #ruby
al2o3-cr has joined #ruby
Swyper has quit [Ping timeout: 260 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
jenrzzz has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
cloud69 has joined #ruby
somazero has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
nowhere_man has quit [Ping timeout: 258 seconds]
braincrash has quit [Ping timeout: 240 seconds]
impermanence has joined #ruby
nowhere_man has joined #ruby
akem has quit [Ping timeout: 246 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
bkuhlmann has joined #ruby
Emmanuel_Chanel has joined #ruby
waqstar has joined #ruby
<waqstar>
Hi
<adam12>
waqstar: hello
<waqstar>
How do I install development tools for Windows? I have something called td-agent (fluentd) installed - but when I try and install a plugin I need via gem it asks me to install "development tools"
<adam12>
waqstar: For Windows, they would likely come with the Ruby installer you used (vs Linux where you'd install them through it's package manager). How did you install Ruby?
<waqstar>
One sec, let me get the full method I used. (it does it via ansible and was a while ago)
<waqstar>
I dont install ruby myself - i install td-agent and it comes with it :)
<adam12>
waqstar: What plugin are you installing?
<waqstar>
Plugin is called fluent-plugin-cloudwatch-logs
<waqstar>
I ran gem install fluent-plugin-cloudwatch-logs
<waqstar>
adam12: Same error - Full error is: "You have to install development tools first"
<waqstar>
^ Sorry about above - i meant to paste that below on one line
CrazyEdd has joined #ruby
<adam12>
waqstar: is td-agent-gem a thing? Can you try running it? I'm not sure if it will help.
<adam12>
I suspect you'll have to talk to Fluentd about this, since I'm not sure how they package Ruby. Ruby + Windows is somewhat weird, because AFAIK Windows never shipped a compiler out of the box like Linux always has. So the way you install Ruby on Windows generally includes a compiler of some sort.
<adam12>
Actually for good measure, can you open C:/opt/td-agent/embedded/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/certstore_c-0.1.7/mkmf.log and paste the output into something like dpaste.org? I wonder what the error actually is.
<waqstar>
I found a file called td-agent-gem - however it has "#!bin/sh" at the start so I am guessing its not a windows executeable file right?
<adam12>
waqstar: Likely not. Was just curious.
<waqstar>
Ok mate - 1 sec
<adam12>
You're running an up to date version of fluentd?
<waqstar>
Ahh I am on old stable. Good shout, Ill upgrade now :) - no idea how this will go with windows :D
<adam12>
waqstar: Hah. No idea. I run Windows as a dev machine but only because of WSL2 :P
Swyper has joined #ruby
<adam12>
I die everytime I need to do anything outside of it.
<waqstar>
:)
dionysus69 has joined #ruby
<dionysus69>
Hey all, I suddenly started getting this weird error while installing pg gem with ruby 2.7.2 with a clean ubuntu install https://paste.ubuntu.com/p/BKTVvdkJt6/
<adam12>
dionysus69: `echo $CC` from shell.
<dionysus69>
it's clear
<dionysus69>
blank*
<adam12>
`which gcc` ?
<dionysus69>
current directory: /home/devops/.rvm/gems/ruby-2.7.2/gems/pg-1.2.3/ext
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
<adam12>
dionysus69: sounds like a bad version of 2.7.2. could try compiling from source.
<dionysus69>
how though, all I ever did with rvm was just rvm install 2.7.2 or any other version
<dionysus69>
is there an rvm flag that force compiles?
<adam12>
dionysus69: See bug I linked. Might be related.
<adam12>
afk
<dionysus69>
yea I read the first couple lines and it could be related, strong possiblity
akem has joined #ruby
Swyper has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 246 seconds]
Technodrome has quit [Ping timeout: 246 seconds]
chouhoulis has joined #ruby
akem has quit [Ping timeout: 256 seconds]
Emmanuel_Chanel has quit [Quit: Leaving]
<waqstar>
adam12: So just to update you on this - I tried to install version 4 but the installer reported a "problem", with no details. So I went to the latest release in the 3x section and I was able to install it and then also download the cloudwatch plugin :D thank you!
<adam12>
dionysus69: I don't use rvm so I'm not sure to be honest. But the fact that CC is empty makes me suspicious of that bug.
<adam12>
dionysus69: You might be able to confirm by loading up 2.7.2 irb, require "rbconfig", then poke around RbConfig.
<dionysus69>
adam12: yea I added the comment to that bug and added logs, hope it will be useful
bvdw has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
<adam12>
cloud69: laters!
<adam12>
dionysus69: nice.
<dionysus69>
it's weird, now I retried same thing and it still doesnt work with 2.7.1
GGMethos has quit [Ping timeout: 268 seconds]
GGMethos has joined #ruby
dfucci has joined #ruby
Eiam has joined #ruby
stryek has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
howdoi has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
Swyper has joined #ruby
HeavenDestroyer has joined #ruby
lucasb has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
hiroaki has quit [Ping timeout: 256 seconds]
<Eiam>
okay thats new, % source ~/.zshrc zsh: command not found: rbenv rehash. Google seems to feel its related to Fish, but no fish here. Oddly, no ~/.rbenv/bin/ folder either. Related to trying to force arm64 variants via homebrew perhaps
<Eiam>
~/.rbenv/shims right there in the ole path
hsmath has left #ruby [#ruby]
gr33n7007h has joined #ruby
dfucci has joined #ruby
mozzarella has quit [Remote host closed the connection]
mozzarella has joined #ruby
al2o3-cr has quit [Disconnected by services]
gr33n7007h is now known as al2o3-cr
al2o3-cr-tmp has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
hiroaki has joined #ruby
dfucci has joined #ruby
jeromelanteri has joined #ruby
AnomalyXII has joined #ruby
al2o3-cr-tmp has quit [Ping timeout: 256 seconds]
SanguineAnomaly has quit [Ping timeout: 258 seconds]
<havenwood>
tempate: +1 what leftylink said. Great to try in IRB.
<havenwood>
?irb tempate
<ruby[bot]>
tempate: irb is "interactive ruby", it is part of ruby. You can run ruby code and see results immediately. it's useful for testing code. Also see ?pry, a gem which is a popular alternative to irb.
<havenwood>
?pry
<ruby[bot]>
Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (http://pry.github.io/): gem install pry pry-doc
<tempate>
When calling a Chain's to_s it's not recursively calling its OrChain's to_s, making the output hideous
<tempate>
havenwood: I guess the issue comes from OrChain inheriting from Chain itself
<tempate>
havenwood: so OrChain's to_s isn't defined when Chain's to_s is
<havenwood>
tempate: Yeah, you have four. I dunno why I saw three?
<tempate>
havenwood: not sure; I'll use 2 from now on.
dfucci has joined #ruby
<havenwood>
My counting ability falls off after two.
<havenwood>
Falls off sharply.
<tempate>
heh
<tempate>
So what can I do to fix it?
<Eiam>
pry remains my favorite thing in ruby, its the first thing I install after building ruby
<Eiam>
(spoiler: I spend more time figuring out why my code doesn't work than I do writing actual code so lotta time in pry....)
<havenwood>
Eiam: IRB has surely inched towards it, with binding.irb and syntax highlighting, but <3 Pry for sure.
<leftylink>
need minimal reproduction. not motivated to trace through everything to figure out
<leftylink>
I will provide a minimal working example as well
<leftylink>
&>> class A def initialize(x = []); @x = x end; def to_s; "a#{@x.map(&:to_s)}" end end; class B
<leftylink>
errr
<rubydoc>
stderr: -e:6: syntax error, unexpected end-of-input, expecting `end'... check link for more (https://carc.in/#/r/a5mn)
<leftylink>
that is not complte
<havenwood>
Or a minimal failing example works too.
<leftylink>
&>> class A def initialize(x = []); @x = x end; def to_s; "a#{@x.map(&:to_s)}" end end; class B < A; def to_s; ?b end end; puts A.new([A.new, B.new]).to_s