havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
chouhoulis has quit [Ping timeout: 260 seconds]
RiPuk has quit [Ping timeout: 240 seconds]
troulouliou_div2 has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
nowhere_man has joined #ruby
greypack has quit [Read error: Connection reset by peer]
greypack has joined #ruby
xco has joined #ruby
roadie has joined #ruby
henninb has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
drincruz has quit [Read error: Connection reset by peer]
lucasb has quit [Quit: Connection closed for inactivity]
Technodrome has joined #ruby
alexherbo2 has quit [Ping timeout: 265 seconds]
_whitelogger has joined #ruby
henninb has quit [Quit: leaving]
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cd has quit [Quit: cd]
cgfbee has quit [Ping timeout: 258 seconds]
braj has quit []
cnsvc has quit [Ping timeout: 240 seconds]
pandakekok9 has joined #ruby
cnsvc has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
jinmiaoluo has joined #ruby
schne1der has quit [Ping timeout: 246 seconds]
pandakekok9 has quit [Ping timeout: 246 seconds]
<xco> 👋
<xco> i have a Nokogiri::XML::NodeSet like this https://gist.github.com/xcobar/0842c3c8fc31d3dfa3794b75b7a58e14
<xco> any ideas?
edwardly has joined #ruby
xtsee has joined #ruby
markopasha has quit [Ping timeout: 260 seconds]
<xco> got it
<xco> children.attribute("href").value
gix has quit [Ping timeout: 246 seconds]
<havenwood> xco: What's the return value you want?
<xco> havenwood string
<xco> of the link
<xco> URL
<xco> but i got it now :)
<xco> thanks
<havenwood> xco: nice
<xco> havenwood but it's good you're here :D
<xco> something with encoding prolly
<xco> the #text Nokogiri returns looks like this
sergioro has quit [Quit: leaving]
<xco> havenwood see those Â
<xco> at the end?
<xco> and within the string?
banisterfiend has joined #ruby
akem has quit [Ping timeout: 260 seconds]
sergioro has joined #ruby
alfiemax has joined #ruby
<xco> looks like it's a &nbsp;
hiroaki has quit [Ping timeout: 256 seconds]
chalkmonster has joined #ruby
roadie has joined #ruby
<havenwood> xco: Hem, I'm not seeing an  parsing the same.
<xco> havenwood 🤔 how are you getting the texT?
<xco> havenwood hehe.. that's because you're not getting a string with with a nbsp in it :D
<havenwood> xco: Oh. Show the code that gets the nbsp?
<xco> one sec
roadie has quit [Ping timeout: 260 seconds]
<havenwood> xco: I just read "paragraph" and was multitasking so I clicked on the browser and asked for the xpath.
brool has quit [Ping timeout: 240 seconds]
hiroaki has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
ferche23 has joined #ruby
brool has joined #ruby
shirak_ has quit [Ping timeout: 260 seconds]
<xco> havenwood weird, for the same code on your gist, and xpath for the 2nd paragraph i get an empty string :/
dayu has joined #ruby
dayu has left #ruby [#ruby]
cnsvc has joined #ruby
careta has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc_ has joined #ruby
Garb0_ has joined #ruby
Garb0 has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
braj has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
Emmanuel_Chanel has joined #ruby
ChmEarl has quit [Quit: Leaving]
bradfordli123 has joined #ruby
greypack has quit [Ping timeout: 246 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
ferche23 has quit [Read error: Connection reset by peer]
greypack has joined #ruby
roadie has quit [Ping timeout: 246 seconds]
krillbat has joined #ruby
krillbat has quit [Client Quit]
greypack has quit [Ping timeout: 260 seconds]
greypack has joined #ruby
roadie has joined #ruby
braj has quit []
roadie has quit [Ping timeout: 240 seconds]
dhollinger has quit [Ping timeout: 246 seconds]
dhollinger has joined #ruby
roadie has joined #ruby
Garb0_ has quit [Quit: Leaving]
chalkmonster has joined #ruby
mheld has quit [Quit: Connection closed for inactivity]
chalkmonster has quit [Client Quit]
alexherbo2 has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
jinmiaoluo has quit [Remote host closed the connection]
jinmiaoluo has joined #ruby
krillbat has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
ur5us has joined #ruby
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
mozzarella has quit [Remote host closed the connection]
mozzarella has joined #ruby
felix_221986 has joined #ruby
emptyflask has quit [Ping timeout: 260 seconds]
DTZUZU has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
jinmiaoluo has quit [Ping timeout: 246 seconds]
jinmiaoluo has joined #ruby
mozzarella has quit [Remote host closed the connection]
mozzarella has joined #ruby
imode has quit [Ping timeout: 260 seconds]
jinmiaoluo has quit [Ping timeout: 260 seconds]
cnsvc has joined #ruby
jinmiaol2 has joined #ruby
solars has joined #ruby
alfiemax has quit [Remote host closed the connection]
brool has quit [Ping timeout: 244 seconds]
alfiemax has joined #ruby
ldepandis has joined #ruby
jinmiaol2 has quit [Ping timeout: 260 seconds]
jinmiaol2 has joined #ruby
alexherbo2 has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
rcvalle_ has joined #ruby
rcvalle has quit [Ping timeout: 252 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
chalkmonster has joined #ruby
gix has joined #ruby
Technodrome has joined #ruby
cnsvc has joined #ruby
gzc has joined #ruby
SCHAPiE has quit [Quit: ZNC - https://znc.in]
sticaz has joined #ruby
_whitelogger has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
giorgian has quit [Ping timeout: 240 seconds]
giorgian has joined #ruby
alfiemax has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
chalkmonster has quit [Remote host closed the connection]
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 240 seconds]
SCHAPiE has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
dhollinger has joined #ruby
akem has joined #ruby
akem has quit [Max SendQ exceeded]
akem has joined #ruby
cnsvc has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 246 seconds]
Emmanuel_Chanel has joined #ruby
henninb has joined #ruby
krillbat has quit [Quit: Connection closed for inactivity]
xco has joined #ruby
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
markopasha has joined #ruby
RiPuk has joined #ruby
jetchisel has quit [Ping timeout: 265 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jetchisel has joined #ruby
markopasha has quit [Quit: Leaving]
arup_r has joined #ruby
gdonald has joined #ruby
Pixi__ has joined #ruby
go|dfish has joined #ruby
Xiti` has quit [Ping timeout: 246 seconds]
<xco> how do i extra the href and text from <a href="/entertainment/best-old-hollywood-classic-films-to-stream-right-now">Best old Hollywood films to stream right now</a> with Nokogiri?
<xco> I don't want to use regex
bradfordli123 has quit [Remote host closed the connection]
<jhass> just get the node and link["href"] and link.text
cnsvc has quit [Ping timeout: 240 seconds]
<xco> jhass <a href="/entertainment/best-old-hollywood-classic-films-to-stream-right-now">Best old Hollywood films to stream right now</a> is of class Nokogiri::XML::Element
<xco> it's not a node
<jhass> Nokogiri::XML::Element < Nokogiri::XML::Node # => true
<jhass> but I remembered wrong, it's not .text but .content
infinityfye has joined #ruby
<xco> jhass not sure what to call #content on
<jhass> the thing you puts
<jhass> puts invokes to_s
<jhass> use p, which calls inspect, for debug prints
<xco> jhass returns this
<xco> #<Nokogiri::XML::Element:0x11fa8 name="a" attributes=[#<Nokogiri::XML::Attr:0x11f80 name="href" value="https://video.foxnews.com/v/6152098031001/">] children=[#<Nokogiri::XML::Text:0x11f94 "Hog farmer Brian Duncan on how COVID-19 is impacting food supply chains">]>
<xco> i need the href value AND the text from this
<jhass> so what's wrong with my suggestion?
arup_r has quit []
<jhass> seems just fine https://p.jhass.eu/7w.txt
alfiemax has quit [Ping timeout: 246 seconds]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
henninb has quit [Quit: leaving]
cnsvc has joined #ruby
pandakekok9 has joined #ruby
<jhass> travis going downhill is kind of a tradegy but was kinda to expect after they got bought by Idera. Many of their original staff left as a result
<jhass> oh wait wrong channel :D
chalkmonster has joined #ruby
schne1der has joined #ruby
arcaos has joined #ruby
conta has joined #ruby
GodFather has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
Technodrome has joined #ruby
<xco> jhass thanks :)
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
sergioro has quit [Quit: leaving]
cnsvc has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
banisterfiend has quit [Ping timeout: 244 seconds]
dionysus69 has joined #ruby
TCZ has quit [Quit: Leaving]
conta has quit [Quit: conta]
drincruz has joined #ruby
arcaos has quit [Ping timeout: 244 seconds]
arcaos has joined #ruby
cnsvc has joined #ruby
akem has quit [Remote host closed the connection]
romanlevin has quit [Quit: The Lounge - https://thelounge.chat]
akem has joined #ruby
caterfxo has quit [Quit: leaving]
romanlevin has joined #ruby
schne1der has quit [Ping timeout: 260 seconds]
drincruz has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
drincruz has joined #ruby
roadie has quit [Ping timeout: 244 seconds]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
caterfxo has joined #ruby
d3bug has joined #ruby
felix_221986 has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
akem has quit [Ping timeout: 240 seconds]
jinmiaoluo has joined #ruby
cnsvc has joined #ruby
jinmiaol2 has quit [Ping timeout: 244 seconds]
jinmiaoluo has quit [Ping timeout: 260 seconds]
jinmiaoluo has joined #ruby
chalkmonster has joined #ruby
hiroaki has quit [Remote host closed the connection]
akem has joined #ruby
hiroaki has joined #ruby
jinmiaoluo has quit [Ping timeout: 244 seconds]
jinmiaoluo has joined #ruby
felix_221986 has joined #ruby
nowhere_man has joined #ruby
drincruz has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
dviola has quit [Quit: WeeChat 2.8]
sergioro has joined #ruby
cd has joined #ruby
drincruz has joined #ruby
jinmiaoluo has quit [Ping timeout: 260 seconds]
jinmiaoluo has joined #ruby
pandakekok9 has quit [Quit: Lost terminal]
drincruz has quit [Ping timeout: 240 seconds]
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
davispuh has joined #ruby
gitter1234 has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 244 seconds]
chalkmonster has quit [Quit: WeeChat 2.8]
wilhelm418 has joined #ruby
Garb0 has joined #ruby
ChmEarl has joined #ruby
imode has joined #ruby
felix_221986 has quit [Quit: Connection closed]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
caterfxo has quit [Quit: leaving]
xco has joined #ruby
brool has joined #ruby
jetchisel has quit [Ping timeout: 260 seconds]
emptyflask has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
caterfxo has joined #ruby
oneeggeach has joined #ruby
davor has left #ruby ["Leaving"]
oneeggeach has quit [Client Quit]
dhollinger has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
dhollinger has joined #ruby
jinmiaoluo has quit [Ping timeout: 240 seconds]
jinmiaoluo has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
Garb0 has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
SuperL4g has joined #ruby
SuperLag has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
schne1der has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
careta has quit [Ping timeout: 244 seconds]
alfiemax_ has joined #ruby
tpanarch1st has joined #ruby
cnsvc has joined #ruby
tpanarch1st has quit [Quit: Thanks for your help, nice to see you, take care.]
tpanarch1st has joined #ruby
cnsvc has quit [Quit: WeeChat 2.8]
alfiemax_ has quit [Remote host closed the connection]
alfiemax has joined #ruby
cahoots has joined #ruby
<cahoots> hi, i want to turn "{a,b}" into ["a", "b"], like bash sort of does with globbing. is there a standard ruby way of doing that?
alfiemax has quit [Ping timeout: 260 seconds]
<cahoots> (note that there may not be any files named "a" or "b" in the current dir)
<havenwood> cahoots: {a,b} is invalid syntax. say more?
<havenwood> cahoots: ahhh
<havenwood> cahoots: bash, gotcha
<cahoots> yep
<cahoots> and invoking a shell is too slow
<jhass> validate start_with? && end_with?, strip the braces [1..-2] and .split?
<cahoots> jhass, yeah, looks like i'll be doing that. was just curious if there was a std library solutin
<jhass> there's File.fnmatch to validate a string against a glob pattern
<jhass> your question is a bit XYy, so not sure
Ai9zO5AP has quit [Ping timeout: 240 seconds]
Ai9zO5AP has joined #ruby
<cahoots> bracecomp gem ftw
ExoUNX has quit [Quit: I'm leaving these neckbeards]
drincruz has joined #ruby
drincruz has quit [Ping timeout: 260 seconds]
ExoUNX has joined #ruby
cahoots has quit [Quit: leaving]
<tty1> hi... i am using a library and its giving me some trouble because there is a class that relies on static variables (variable shared by all instances of the class).. however it is causing problems and I effectively need to seperate out the static variables into their own isolated instances... is there some way to do that?
<havenwood> tty1: It's best to avoid defining class variables or global variables, for sure.
<havenwood> tty1: Show your code?
<tty1> havenwood: its not "my code" im using a library, and that library ultimately seems to be a thin wrapper around a system level library... so unlikely it can be modified in the source itself.. but I am refering to the ncursesw library
<tty1> havenwood: if you really want though I can share my code.. one sec ill link it
<tty1> havenwood: here is my code: https://git.qoto.org/aethyr/Aethyr
cnsvc_ has quit [Quit: WeeChat 2.8]
<tty1> havenwood: but to explain the issue in context a little more.. the issue is the NCurses library is apparently designed for the typical use case of rendering an ncurses app on the local console, as you might expect.. but this is going over telnet with multiple clients, each needing to render their own ncurses encironment.. works fine when a single client is connected but crashes horrible when a second
<tty1> person connects
ellcs has joined #ruby
<tty1> havenwood: here is the part of my code where things start breaking (notice the Ncurses class relies a lot on static methods): https://git.qoto.org/aethyr/Aethyr/-/blob/master/lib/aethyr/core/render/display.rb#L31
imode has quit [Ping timeout: 244 seconds]
jetchisel has joined #ruby
DTZUZU has quit [Quit: WeeChat 2.7]
lucasb has joined #ruby
Garb0 has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
Garb0 has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
johnny56 has joined #ruby
s2013 has joined #ruby
lunarkitty has quit [Ping timeout: 252 seconds]
lunarkitty has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
<tty1> This room is suprisingly dead for a quarintine... anyone know of any other chat rooms that might be more active?
Pixi__ has quit [Quit: Leaving]
SeepingN has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
<havenwood> tty1: Offhand I can't think of an obvious solution other than a separate process per connection.
<tty1> havenwood: i wouldnt mind seperate processes except that since this is an mmorpg Im not sure that would be workable without a complete rewrite
<tty1> havenwood: there has got to be a way to force an eigenclass into multiple instances givent he hackability of ruby
Xiti has joined #ruby
<havenwood> tty1: You could probably reopen Curses and change the class variables to thread local variables, but that sounds like an undertaking.
<havenwood> tty1: It's certainly possible.
roadie has joined #ruby
<tty1> havenwood: the thing is... im really just trying to work around a bug in the library in the first place
<havenwood> tty1: A bug in curses?
<tty1> havenwood: I think so, the wrapper is kind of thing but could be the wrapper itself
<tty1> havenwood: normally this is solved with set_term.. thing is i am getting a segfault
<tty1> havenwood: so I think its just because the ruby library is so old, problem is the more modern ruby curses library leave out the methods i need entierly so i cant update
ellcs has quit [Ping timeout: 240 seconds]
<tty1> havenwood: this issue has been a thorn in my side for years I think ive rewritten this library for every curses ruby library there is over the years
roadie has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has joined #ruby
hiroaki has quit [Ping timeout: 240 seconds]
SuperL4g is now known as SuperLag
jeromelanteri has quit [Quit: Leaving]
drincruz has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has quit [Ping timeout: 260 seconds]
mkroman has quit [Remote host closed the connection]
mkroman has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
cnsvc has joined #ruby
DTZUZU has joined #ruby
bwitt has joined #ruby
CrazyEddy has joined #ruby
Zubov has joined #ruby
imode has joined #ruby
roadie has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roadie has quit [Ping timeout: 246 seconds]
schne1der has quit [Ping timeout: 244 seconds]
Technodrome has joined #ruby
emptyflask has quit [Quit: WeeChat 2.7.1]
dionysus69 has quit [Quit: dionysus69]
TomyWork has joined #ruby
s2013 has joined #ruby
Garb0 has quit [Remote host closed the connection]
Garb0 has joined #ruby
sticaz has quit [Quit: WeeChat 2.8]
rmnull has joined #ruby
<tty1> well i think i may have solved it!\
wilhelm418 has quit [Remote host closed the connection]
roadie has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drincruz has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
drincruz has quit [Ping timeout: 240 seconds]
Zubov has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 240 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
jetchisel has joined #ruby
jinie has quit [Ping timeout: 256 seconds]
ta has quit [Ping timeout: 256 seconds]
infinityfye has quit [Quit: Leaving]
ta has joined #ruby
Garb0 has quit [Remote host closed the connection]
Garb0 has joined #ruby
jinie has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
gix has quit [Ping timeout: 260 seconds]