jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
factor has joined #ruby
factor has quit [Client Quit]
factor has joined #ruby
twosuns has quit [Quit: ...]
twosuns has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
twosuns has quit [Quit: ...]
hanzo has quit [Quit: Connection closed for inactivity]
Rounin has quit [Ping timeout: 272 seconds]
donofrio__ has quit [Remote host closed the connection]
Ziyan has joined #ruby
comet23 has joined #ruby
gschanuel has quit [Read error: Connection reset by peer]
gschanuel has joined #ruby
goepsilongo_ has joined #ruby
goepsilongo has quit [Ping timeout: 250 seconds]
comet23 has quit [Ping timeout: 252 seconds]
ur5us has quit [Ping timeout: 250 seconds]
FetidToot9 has joined #ruby
FetidToot has quit [Ping timeout: 276 seconds]
FetidToot9 is now known as FetidToot
ur5us has joined #ruby
Vonter has joined #ruby
John_Ivan_ has quit [Ping timeout: 272 seconds]
goepsilongo_ has quit [Quit: Textual IRC Client: www.textualapp.com]
dionysus69 has joined #ruby
jpn has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
jpn has quit [Ping timeout: 256 seconds]
Guestdlci8 has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
Guestdlci8 has quit [Quit: Ping timeout (120 seconds)]
dionysus69 has joined #ruby
oxfuxxx has quit [Quit: [H]EAT ROX FUCK R0X SHIT BRIX. = The Yankies M0th3Rphackers Coconut Aerospace =]
teclator has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.5]
howdoi has quit [Quit: Connection closed for inactivity]
howdoi has joined #ruby
ur5us has joined #ruby
Ziyan has quit [Ping timeout: 272 seconds]
Ziyan has joined #ruby
Ziyan has quit [Ping timeout: 256 seconds]
Ziyan has joined #ruby
Cristian540 has joined #ruby
Cristian540 has quit [Client Quit]
Ziyan has quit [Ping timeout: 276 seconds]
gschanuel has quit [Read error: Connection reset by peer]
gschanuel has joined #ruby
Ziyan has joined #ruby
gschanuel9 has joined #ruby
gschanuel has quit [Ping timeout: 256 seconds]
gschanuel9 is now known as gschanuel
gschanuel has quit [Read error: Connection reset by peer]
gschanuel has joined #ruby
some14u has joined #ruby
Rounin has joined #ruby
some14u has quit [Client Quit]
Ziyan has quit [Ping timeout: 256 seconds]
some14u has joined #ruby
Ziyan has joined #ruby
jpn has joined #ruby
Ziyan has quit [Ping timeout: 256 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ziyan has joined #ruby
Ziyan has quit [Client Quit]
_ht has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
twosuns has joined #ruby
Ziyan has joined #ruby
Jonopoly has joined #ruby
giorgian has joined #ruby
<rapha> oh wow that's beautiful ... i wish that were in Ruby proper
Ziyan has quit [Ping timeout: 256 seconds]
Ziyan has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
Ziyan has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
roadie has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
giorgian has quit [Ping timeout: 256 seconds]
roadie has joined #ruby
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 272 seconds]
roadie has quit [Ping timeout: 240 seconds]
giorgian has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
moldorcoder7 has quit [Ping timeout: 240 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
moldorcoder7 has joined #ruby
Ziyan_ has quit [Ping timeout: 250 seconds]
Ziyan has joined #ruby
twosuns has quit [Quit: ...]
jpn has quit [Quit: leaving]
gr33n7007h has joined #ruby
donofrio has joined #ruby
some14u has joined #ruby
hololeap has quit [Quit: Bye]
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 256 seconds]
Ziyan_ has quit [Quit: Textual IRC Client: www.textualapp.com]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rapha> hmm. when building an HTML5 document with Nokogiri's XML::Builder, how does one add the <!doctype?
<rapha> i've googled around for a while, tried to read the API docs, but it kind of looks like you're not even supposed to be using it for that, for some reason
some14u has joined #ruby
<ox1eef> why are you using the xml builder, shouldn't you be using the html builder?
some14u has quit [Ping timeout: 276 seconds]
some14u has joined #ruby
<rapha> ox1eef: i thought so, but apparently that's intended for HTML *4* only.
<rapha> (Nokogiri::HTML5::Builder is just aliased to it)
gr33n7007h has quit [Ping timeout: 272 seconds]
jpn has joined #ruby
gr33n7007h has joined #ruby
<ox1eef> hm not sure then
<rapha> perhaps in the long run it would be more enjoyable to start doing such things with wunderbar instead
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John_Ivan_ has joined #ruby
protektwar has quit [Ping timeout: 248 seconds]
bit4bit has joined #ruby
Ziyan has joined #ruby
some14u has joined #ruby
some14u has quit [Ping timeout: 248 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Read error: Connection reset by peer]
some14u has joined #ruby
Sheilong has joined #ruby
libsys has joined #ruby
joast has quit [Quit: Leaving.]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ox1eef> idk what wunderbar is, but i think nokogiri is solid.
Jonopoly has quit [Quit: WeeChat 3.0]
some14u has joined #ruby
libsys has quit [Ping timeout: 276 seconds]
libsys has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
<rapha> not calling into question its solidity :)
<rapha> wunderbar is a gem for building HTML ... specifically, HTML. not XML in general.
<rapha> ox1eef: a different Nokogiri question: how can you force it to not escape the HTML that might be present in a string you pass to a builder node?
joast has joined #ruby
<jidar> > The Nokogiri::HTML5.fragment function takes a string and parses it as a HTML5 document. The <html>, <head>, and <body> elements are removed from this document, and any children of these elements that remain are returned as a Nokogiri::HTML5::DocumentFragment.
<rapha> we're not talking about parsing, we're talking about building, jidar
<jidar> hmm, maybe not.. was thinking you might be able to setup a few fragments but it's not part of the builder
<jidar> I'm aware
<rapha> ah ok
<rapha> and yeah
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rapha> i'm CGI:unescapeHTML'ing the whole thing afterwards now. crude but nm.
jpn has quit [Ping timeout: 276 seconds]
jpn has joined #ruby
bit4bit has quit [Ping timeout: 260 seconds]
giorgian has quit [Ping timeout: 250 seconds]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
vos has joined #ruby
<vos> Morning. I'm not sure what sort of stuff to be searching for really, but I'm trying to work out how to escalate to root when inside a script. My script creates some symlinks, which works ok, but when I get to symlinking something in /etc or whatever it's not possible because I didn't execute the script as root. Ansible does some sort of privilege escalation, but I have no idea how that works. Is
<vos> there some way this can be done in ruby without relaunching the process with the initial args?
John_Ivan_ has quit [Read error: Connection reset by peer]
jpn has quit [Ping timeout: 276 seconds]
<adam12> vos: I don't believe so. Ruby can setuid/seteuid but it would need super user capabilities. You can't chattr +S a script, so the binary would need it. Not elegant.
<adam12> vos: In the past I've shipped a suid binary in C that has a _very_ small interface, that I call from Ruby.
John_Ivan has joined #ruby
<vos> adam12: oh cool, how does that bin work, I guess it asks for a password?
<adam12> vos: It would need to be installed before hand, with suid bit set (or some other cap that you need). Then you'd just call it from your script.
<vos> ahh fair enough - yeah I was thinking more of asking for a password exactly like how sudo works
<vos> I wonder how ansible does it
libsys has quit [Ping timeout: 256 seconds]
libsys has joined #ruby
giorgian has joined #ruby
<adam12> vos: You could probably sudo ruby -rdrb -e 'DRB.start' and then interact with it from your main process.
<adam12> I'm presuming that's what it does.
howdoi has joined #ruby
giorgian has quit [Ping timeout: 256 seconds]
<vos> I'm thinking my only option is to just use `ln` and then add a `sudo` to the system call
<adam12> Are you just doing the single symlink?
<vos> this is a script for my dotfiles, so it's a fair few files I think
<vos> maybe 4 or so
jpn has joined #ruby
jpn has quit [Ping timeout: 272 seconds]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
dionysus70 is now known as dionysus69
Cork has quit [Quit: .]
Cork has joined #ruby
sphex has quit [Remote host closed the connection]
some14u has joined #ruby
giorgian has joined #ruby
giorgian has quit [Ping timeout: 240 seconds]
<jhass[m]> ansible just runs a new command for each task as the appropriate user. It does not compile a single script or something like that
giorgian has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
bit4bit has joined #ruby
jpn has joined #ruby
sylario has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
giorgian has quit [Remote host closed the connection]
giorgian has joined #ruby
<ox1eef> rapha: i don't think you should do that, what's the use case for not escaping html?
<ox1eef> your approach should probably be to use the builder API to construct the html you're inserting as a raw string, rather than trying to disable the escape feature.
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
victori has joined #ruby
jpn has joined #ruby
<ox1eef> vos: i suggest looking into popen, open3 - stuff like that. that way, you should have a stream for the in/out streams of sudo
<ox1eef> presumably, you can supply the password that way. i have never tried, but whats where id start.
jpn has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Read error: Connection reset by peer]
jpn has joined #ruby
dionysus69 has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
jpn has quit [Ping timeout: 240 seconds]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
dionysus70 is now known as dionysus69
jpn has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
roadie has quit [Ping timeout: 248 seconds]
Starfoxxes has quit [Ping timeout: 240 seconds]
some14u has joined #ruby
roadie has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_ht has quit [Remote host closed the connection]
Starfoxxes has joined #ruby
Starfoxxes has quit [Ping timeout: 240 seconds]
danjo00 has quit [Ping timeout: 240 seconds]
danjo00 has joined #ruby
some14u has joined #ruby
Starfoxxes has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
<rapha> ox1eef: of course I shouldn't be doing that. But then, Nokogiri *should* also have a "please don't patronize me"-mode. The use case is HTML I that needs to be put inside of HTML.
<rapha> s/L I/L /g
<rapha> (actually, let me rephrase to "shouldn't have to be doing that")
<rapha> Oh, wait, you did tell me the "please don't patronize me' mode.
* rapha tries
dionysus69 has joined #ruby
<ox1eef> the #<< method looks like it works for that use case
<rapha> ox1eef: yup, just changed the code and ran the data through and it's exactly what i was looking for - thank you very much!
<ox1eef> cool, good to know
<rapha> my google-fu was completely off ... i kept using search words like "unescape". didn't think of "raw".
<ox1eef> well, i don't think yard docs are that optimized for search anyway.
goldfish has joined #ruby
Totooria has joined #ruby
<Totooria> anyone familiar with build issues related to 2.7.x on the newest ubuntu lts? I can't seem to get a build to succeed even with older openssl versions
goldfish has quit [Ping timeout: 276 seconds]
<rapha> maybe it'll help people to help if you post a link to a buildlog
<Totooria> yeah let me termbin real quick. I've been getting issues with ripper.c
<rapha> (full disclosure: i don't have a ubuntu box available)
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Totooria> googling around for the specific error with ripper.c doesn't yield any results I can find
<leah2> blind shot: try installing bison
<Totooria> apt tells me already at the latest version
roadie has quit [Ping timeout: 240 seconds]
<leah2> hmm
<Totooria> perhaps the latest is incompatible with 2.7.6?
<ox1eef> how many times did you try build, id suggest trying from a fresh tarball
<Totooria> ox1eef: working from a fresh tarball. I can re-extract, conf, and build again
<ox1eef> you might also consider ruby-install, and to a lesser extent, rvm - for taking care of building, if doing it manually brings no results.
<Totooria> so, I started with rvm. I can try ruby-install I suppose
<ox1eef> rvm is usually decent at solving build issues automagically.
ur5us has joined #ruby
<ox1eef> iirc it even has pŕecompiled binaries, id be surprised if it didnt even those for 2.7, not that old, but i dunno.
roadie has joined #ruby
<Totooria> no precompiled for 22.04 it seems
some14u has joined #ruby
<Totooria> I'll try letting it default to a 2.7 version rather than forcing 2.7.6, see if that helps
<ox1eef> oh, if you can get some version of 2.7 older than .6, then definitely do that, those version bumps dont introduce huge changes.
<ox1eef> or newer*
dionysus69 has quit [Quit: dionysus69]
<Totooria> .6 seems to be latest for 2.7 so I figured that was my best shot, it's now attempting 2.7.2. All I need is 2.7 for a build dep for something else
<ox1eef> itd be the best if 2.7.6 is the latest for 2.7, i think a few of those recent patches were security-related.
<Totooria> no luck with 2.7.2 either. Errors all the way down.
<ox1eef> why do you need 2.7 specifically?
<ox1eef> have you tried 3 already?
<Totooria> ox1eef: it's a pinned dependency for a separate package I need to build
<ox1eef> ah ok
<ox1eef> for the most id say 3 is backwards compatible with 2, it might not be necessary to be strict about it.
roadie has quit [Ping timeout: 240 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
<Totooria> ruby-install seems like it's working...? I mean, if it works it works but all I did was try a different installer
<Totooria> spoke too soon, it just errored out later.
<weaksauce> wait 11 is latest lts? I thought 22 was the latest
<ox1eef> i cant think of what else to try. as far as running ruby code goes, i dont think 3 is that different.
protektwar has quit [Ping timeout: 260 seconds]
<weaksauce> what are you building that needs 2.7? Totooria
<weaksauce> perhaps theres an alternative
<Totooria> weaksauce: weechat, with specific scripts in use which require the ruby plugin which builds with 2.7
<ox1eef> -_-
<Totooria> there has been a "migrate to/enable ruby 3" ticket open for weechat for like 2 years /sigh
<ox1eef> yeah, when it comes to the C API the transition probably isnt as smooth
<Totooria> at this point I'm wondering if I just need to downgrade this server to 20.04 and take the hit, but 20.04 has its own set of problems with other packages I need
<Totooria> I love ~infra~
<ox1eef> weechat is feature rich without the scripts.
<Totooria> that's true, I could change my whole workflow to not be using them
<Totooria> vast majority of scripts are perl anyways
<ox1eef> thats a non moving target
<weaksauce> could run it in docker
<Totooria> fair enough. Well, thanks for the help. Guess I'll just keep any eye on things until support catches up
oxfuxxx has joined #ruby
Totooria has left #ruby [sent from my IBM Simon]
roadie has joined #ruby
<leah2> ah gone
<leah2> weechat works fine with 3.0/3.1
roadie has quit [Ping timeout: 250 seconds]
libsys has quit [Ping timeout: 276 seconds]
giorgian has quit [Ping timeout: 246 seconds]
bit4bit has quit [Quit: Leaving]
roadie has joined #ruby
roadie` has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
emcb54 has quit [Read error: Connection reset by peer]
emcb54 has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
roadie` has quit [Ping timeout: 260 seconds]
oxfuxxx has joined #ruby
giorgian has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
giorgian has quit [Ping timeout: 272 seconds]
genpaku has joined #ruby
genpaku has left #ruby [#ruby]
giorgian has joined #ruby
giorgian has quit [Ping timeout: 260 seconds]
marethyu has joined #ruby
marethyu has quit [Quit: Leaving]
floss-jas has joined #ruby
John_Ivan_ has joined #ruby
John_Ivan has quit [Ping timeout: 240 seconds]
sylario has quit [Quit: Connection closed for inactivity]
twosuns has joined #ruby
niv has quit [Ping timeout: 240 seconds]
artemon has quit [Ping timeout: 240 seconds]
brw has quit [Ping timeout: 256 seconds]
brw has joined #ruby
artemon has joined #ruby
emcb541 has joined #ruby
emcb54 has quit [Ping timeout: 248 seconds]
emcb541 is now known as emcb54