havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
roadie has joined #ruby
mmalter has quit [Quit: Lost terminal]
Tasi has quit [Quit: Leaving]
eddof13 has joined #ruby
rijndael has joined #ruby
rijndael is now known as John__
<John__> hi. I'm attempting to work with Watir's wait_until() method. https://www.rubydoc.info/gems/watir/Watir%2FWait.until
<John__> I have seen examples where watir uses wait_until(element visible or selected)
<John__> but I have not seen a function where you'd have an element "changed/updated"
<John__> any ideas?
<John__> I have a <a href="#"> anchor which starts off like that. once javascript runs, it will change href to an actual URI
<John__> and I need to wait until it has been "populated"
EvilAlan has joined #ruby
EvilAlan has quit [Quit: Client closed]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rhe5 has joined #ruby
rhe has quit [Ping timeout: 252 seconds]
rhe5 is now known as rhe
roadie has quit [Ping timeout: 245 seconds]
Rounin has quit [Ping timeout: 252 seconds]
unyu has quit [Quit: brb]
EvilAlan has joined #ruby
rando25892 has quit [Ping timeout: 272 seconds]
bluedust has joined #ruby
mdemo has quit [Quit: The Lounge - https://thelounge.github.io]
mdemo has joined #ruby
bluedust has quit [Ping timeout: 250 seconds]
EvilAlan has quit [Quit: Client closed]
Hobbyboy has quit [Quit: The BNC has broken!]
yossarian has quit [Ping timeout: 250 seconds]
JSharp has quit [Ping timeout: 250 seconds]
r3my has quit [Ping timeout: 250 seconds]
weyhmueller has quit [Quit: ZNC 1.8.2 - https://znc.in]
pjlsergeant has quit [Read error: Connection reset by peer]
BSaboia has quit [Quit: ZNC - https://znc.in]
frodl has quit [Read error: Connection reset by peer]
oz has quit [Quit: EOF]
r3my has joined #ruby
pjlsergeant has joined #ruby
frodl has joined #ruby
BSaboia has joined #ruby
ox has joined #ruby
JSharp has joined #ruby
weyhmueller has joined #ruby
yossarian has joined #ruby
yossarian has quit [Changing host]
yossarian has joined #ruby
unyu has joined #ruby
Hobbyboy has joined #ruby
<ox1eef> John__: is the idea not to simply return true/false from the block ? eg wait_until { cond }
<ox1eef> John__: not sure of waitr's api, but you should be able to poll that condition using a css selector
oxfuxxx has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
_ht has joined #ruby
oxtyped[m] has quit [Quit: You have been kicked for being idle]
hellstabber[m]1 has quit [Quit: You have been kicked for being idle]
ollysmith has joined #ruby
oxfuxxx has quit [Quit: Yankies Motherfh@ckers C0[k Astroboys]
oxfuxxx has joined #ruby
TasiMobile has joined #ruby
TasiMobile has quit [Quit: Quit]
TasiMobile has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.4]
gr33n7007h has joined #ruby
roadie has joined #ruby
cognemo has quit [Quit: ZNC 1.8.2 - https://znc.in]
cognemo has joined #ruby
gproto23 has joined #ruby
oxfuxxx has quit [Quit: Yankies Motherfh@ckers C0[k Astroboys]
moldorcoder7 has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4]
legit has quit [Quit: WeeChat 2.8]
<nakilon> when you do "fail :some_symbol" it throws "exception class/object expected" -- why doesn't it throw "exception class/object or a string expected"?
<nakilon> can't find it in source code
legit has joined #ruby
<nakilon> not sure what is isstr and where is the branch there it's only an exception class
Rounin has joined #ruby
moldorcoder7 has joined #ruby
oxfuxxx has quit [Quit: Yankies Motherfh@ckers C0[k Astroboys]
oxfuxxx has joined #ruby
perrierjouet has joined #ruby
shiru has joined #ruby
mirage_ has joined #ruby
mirage_ has quit [Client Quit]
oxfuxxx has quit [Ping timeout: 272 seconds]
roadie has quit [Ping timeout: 256 seconds]
perrierjouet has quit [Quit: WeeChat 3.4]
roadie has joined #ruby
perrierjouet has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
shiru has quit [Quit: leaving]
Sheilong has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
mixfix41 has joined #ruby
jetchisel has quit [Ping timeout: 268 seconds]
bluedust has joined #ruby
oxfuxxx has joined #ruby
ollysmith_ has joined #ruby
ollysmith has quit [Ping timeout: 268 seconds]
bluedust has quit [Ping timeout: 250 seconds]
fooklydookly has joined #ruby
<John__> hi. I'm attempting to work with Watir's wait_until() method. https://www.rubydoc.info/gems/watir/Watir%2FWait.until
<John__> I have seen examples where watir uses wait_until(element visible or selected)
<John__> but I have not seen a function where you'd have an element "changed/updated"
<John__> I have a <a href="#"> anchor which starts off like that. once javascript runs, it will change href to an actual URI
<John__> and I need to wait until it has been "populated"
<John__> any ideas?
jetchisel has joined #ruby
<mooff> John__: did you get anywhere with ox1eef's suggestions?
<mooff> > John__: not sure of waitr's api, but you should be able to poll that condition using a css selector
<mooff> > John__: is the idea not to simply return true/false from the block ? eg wait_until { cond }
roadie has joined #ruby
<mooff> looking at the API.. i think you want browser.link(href: "/desired/uri").wait_until(&:visible?)
oxfuxxx has quit [Ping timeout: 250 seconds]
jetchisel has quit [Ping timeout: 272 seconds]
Tempesta has joined #ruby
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
roadie has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
<John__> mooff, I don't think I did, apologies.
___nick___ has joined #ruby
<John__> mooff, hmm. that line of code seems close enough, but I don't think I have a predictable /desired/uri
<John__> the URI is generated randomly and it may contain arbitrary values.
<John__> of course, I could do the unintuitive "browser.link(href: "#").wait_until(!&:visible?)"
<John__> mooff, but I really don't think that's an adequate solution. it feels wrong.
<ox1eef> it is invalid syntax for one thing :)
<John__> ox1eef, did you come online recently? I tried to tab-complete your name but it didn't work.
<John__> must've missed your name or mistyped.
<ox1eef> sadly i never leave this place
<John__> sadly?
<John__> ox1eef, are you by any chance the person who recommended me the Eloquent Ruby book?
<ox1eef> not sure but could be, it is the usual recommendation of this channel afaik
<John__> I come from a C/C++ background. seeking refuge in the... "more sane" dynamically typed languages. ruby hit the spot. but I do tend to fight with documentation sometimes - especially from external gems.
<John__> stuff that should be there just isn't. I think? or I might be doing something horribly wrong.
<John__> ox1eef, I seek refuge because the web has reached a complex level that C just isn't the right language for doing web requests/parsing.
<John__> even though it can.... but 5 lines in ruby would result in 150 lines of C...
<ox1eef> C is still fun and you can combine it with Ruby through C extensions
<ox1eef> and also mruby
<John__> I wouldn't know. I'm still a ruby greenhorn.
<mooff> welcome to the Hotel California...
<mooff> John__: watir lets you match attributes with regexes
<mooff> browser.link(href: /some\/regex\/\d+/).wait_until(&:visible?)
<John__> mooff, I can definitely match attributes yes. I want to wait until a matched attribute changes though.
<John__> e.g when <a href="#"> becomes <a href="unpredictable_uri"> and then extract that "unpredictable_uri"
<John__> visible() isn't really the right approach I think? although I could do "wait until # is not visible".
<John__> but the api doesn't offer anything better. that, or I'm blind.
<John__> or both!
<mooff> John__: are you sure you have to detect the change itself?
<mooff> can you just wait for / expect the final uri? then process that?
<John__> mooff, you mean "wait until "/" present in href" ?
<John__> js_doc = browser.element(css: "#dlbutton").wait_until(href: "/")
<John__> I suspect this won't work.
<mooff> John__: i was thinking e.g. "wait until href matches /^\/download\/\d+/"
<John__> mooff, the href is unpredictable. it will never contain anything I can use to match against it because it will contain a value like /434t44/32t4gmedsf
<mooff> does the element have a class you could use as a selector?
<John__> mooff, it does. I can select the element.
<John__> #dlbutton
<John__> problem is, at the moment of selection, unless I "wait", the returned value is <a href="#">
<John__> as opposed to <a href="/252453/234vnref">
<mooff> John__: it doesn't look like wait_until takes match options in that way, btw
<John__> aye
<John__> browser.text_field(css: "new_user_first_name").wait_until(timeout: 60, &:present?)
<John__> oops
<John__> mooff, browser.element(css: "#dlbutton").wait_until(timeout: 60)
<John__> that would work. if I replace the timeout with 5-10 seconds. rather poor solution but...
<mooff> John__: browser.link(css: '#dlbutton', href: /^\//).wait_until(&:visible?)
<John__> mooff, that will work too I guess.
<John__> thank you.
* John__ stretches on desk in dissapointment
<mooff> take time to decompress, but what has you disappointed?
<John__> mooff, I suppose watir in this case. and it's api
<John__> mooff, and the fact that what I want to do involves complexity due to......... dynamic js webpages.
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<mooff> understood :)
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
<John__> mooff, honestly, I was expecting the typical "browser.wait_until_changed(element)"
<John__> event driven apis work like that. on_change() events.
___nick___ has joined #ruby
<mooff> John__: automated browser testing can be pretty frustrating to debug
<mooff> the APIs tend to work like "give me some conditions, and i'll wait in a loop until they're matched, or raise"
<John__> I'll keep that in mind
impermanence has joined #ruby
wand has quit [Remote host closed the connection]
wand has joined #ruby
oxfuxxx has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
fooklydookly has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
cout has quit [*.net *.split]
leftylink has quit [*.net *.split]
pandabot has quit [*.net *.split]
Pixi has quit [*.net *.split]
Spitfire_ has quit [*.net *.split]
apotheon has quit [*.net *.split]
roadie has quit [Ping timeout: 256 seconds]
bluedust has joined #ruby
cout has joined #ruby
pandabot has joined #ruby
Pixi has joined #ruby
Spitfire_ has joined #ruby
leftylink has joined #ruby
apotheon has joined #ruby
bluedust has quit [Ping timeout: 250 seconds]
<John__> to what degree can bundler make packaged source code with gem packs "standalone"?
<John__> for example, can you truly distribute a standalone ruby application by just providing it's packed gems + the source code?
roadie has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
<nakilon> John__ unless they also depend on some non-ruby libraries
<nakilon> such as a gem that uses imagemagick
<John__> nakilon, sure, makes sense. what about gems that require compilation/the devkit?
<John__> the situation you mentioned I took as a given :)
<John__> nakilon, suppose one of the gems I bundle was compiled with mingw.
<John__> and it arrives on another machine.
<John__> what happens then?
<John__> say, linux. or say on a different architecture.
<nakilon> the .gem file isn't yet compiled but bundler probably has some flag to specify where to install gems and there the compilation artifacts will be put right in the corrersponded dirs of each gem installed
<nakilon> i.e. the *.o file will be put somewhere either in the ./lib or higher
<John__> nakilon, so in other words, it won't work. it has to be recompiled.
<nakilon> of course changing the platform will break the gem
<nakilon> but it should be runnable on the same linux
<John__> nakilon, makes sense. although that breaks a little bit of the "ruby is crossplatform"
<John__> aspect
<John__> i suppose it being recompiled elsewhere and working without sourcecode changes is satisfactory enough
jetchisel has joined #ruby
<nakilon> some gems are pure-ruby, i.e. there is a json gem that compiles and the one that does not -- that's where there crossplatformability is used
<John__> it would also vary from gem to gem
<nakilon> also consider using docker
<John__> nakilon, my goal is to create standalone software that does not depend on the network.
<John__> e.g it runs offline without exceptions.
roadie has quit [Ping timeout: 250 seconds]
<John__> I have written an abomination.
roadie has joined #ruby
<John__> but it works
roadie has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
teclator has joined #ruby
teclator has quit [Client Quit]
roadie has joined #ruby
ur5us has quit [Quit: Leaving]
ua_ has quit [Quit: Leaving]
roadie has quit [Ping timeout: 245 seconds]
John__ has quit [Quit: Leaving]
John_Ivan has joined #ruby
<John_Ivan> ox1eef, done.
<John_Ivan> right. so nakilon. I should separate out pure-ruby gems and... compile-able ruby gems.
* John_Ivan ponders
<John_Ivan> I guess the simplest possible way is just "bundle install --standalone"
<John_Ivan> now to look for some books..
ua_ has joined #ruby
<ox1eef> John_Ivan: https://github.com/FooBarWidget/traveling-ruby and there's other similar projects out there, might be useful to you
___nick___ has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
TCZ has joined #ruby
<John_Ivan> ox1eef, thanks, this is great :)
<ox1eef> yeah sorta, even with tools like that i think its an uphill battle
gproto23 has quit [Remote host closed the connection]
impermanence has quit [Quit: Connection closed]
<John_Ivan> ox1eef, and if I strive to stick to "pure ruby" gems?
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
<weaksauce> standalone ruby is kinda a deadish thing
<weaksauce> docker is just about the best way to get something multi platform and repeatable though
<weaksauce> that said it does increase the complexity
<ox1eef> John_Ivan: yeah, that definitely makes life easier in terms of packaging
<ox1eef> weaksauce: docker is fine for devs, i dont think its fine for deploying a consumer-destined app. theyll have no clue what docker is.
<weaksauce> oh that's what he wants it for?
hololeap has quit [Excess Flood]
<John_Ivan> weaksauce, hey mate, long time no see.
<weaksauce> howdy John_Ivan
<John_Ivan> if by deadish you mean, as dead as "exe" or the "desktop" is, yeah, I know. but that doesn't bother me.
<John_Ivan> my goal is to pop in a ruby standalone module that's self written and have it work.
<John_Ivan> without internet access. so offline
hololeap has joined #ruby
<weaksauce> oh i meant dead as in the maintainers that started most of them have moved on
<weaksauce> i'm not aware of any active maintainers
<John_Ivan> ah
<John_Ivan> can't be helped.
<weaksauce> they should still work for some definition of work though
<weaksauce> what kind of thing are you trying to make?
Sheilong has quit [Quit: Connection closed for inactivity]
<weaksauce> the only project that i can think of that is actively maintained is a game engine that is standalone
<weaksauce> but you are stuck with mruby and all that entails wrt gems
<weaksauce> oh yeah and rubymotion
<John_Ivan> hmm. yeah, I'll take a look at those, thanks
<John_Ivan> but I don't mind installing the ruby interpreter.
<John_Ivan> when I say standalone, I don't necessarily mean embed ruby with the package
<John_Ivan> I just mean "it should run, given that the gems needed come along"
<weaksauce> ah
<John_Ivan> bundler does miracles on this one, as I can see. to a point.
<John_Ivan> `bundle install --standalone`
<John_Ivan> with a defined Gemfile
<weaksauce> docker images seem to be what you would want?
<John_Ivan> the only thing that worries me are ruby gems that are compiled.
<weaksauce> precompiled
<John_Ivan> weaksauce, nah. not docker.
<John_Ivan> anyway, I was just saying that, as I can see, some gems, such as ffi, requires I have the devkit version of ruby which compiles the gem on the platform you're on
<John_Ivan> if I package said application on windows, I suspect bundler will make it standalone for windows but not have it work on linux for example
<John_Ivan> IF I don't recompile that gem there that is.
<John_Ivan> but as long as this happens with "non-pure" ruby gems
<John_Ivan> I'm happy.
<John_Ivan> weaksauce, I wrote an abomination today in watir
<John_Ivan> an abomination that works
<weaksauce> hah well that's something then
<John_Ivan> frankenruby.
<John_Ivan> weaksauce, yeah, I have taken a new policy to my main machine about a month ago, going offline-first mindset
<John_Ivan> stacked up on setup installers, portable zips and whatnot. I intend to stay on a frozen OS for the next 10 yeras.
<John_Ivan> so I need my ruby scripts to work without internet :)
<John_Ivan> I'm not happy with the direction Win10/11 is going.
<John_Ivan> And Linux gaming has reached a mature level already with proton. I say a few more years and I'll eventually switch permanently. But I prefer 10 years of stability than 10 years of ups and downs.
TasiMobile has quit [Quit: Quit]
<John_Ivan> weaksauce, it won't be long before 99% of windows games will run on linux with little to no tweaks thanks to proton/wine and GE
<John_Ivan> and we're talking big AAA titles like Skyrim, Farcry 6, The Witcher, etc
<John_Ivan> Apex Legends already works.
<weaksauce> yeah it's impressive
<John_Ivan> weaksauce, did you order a Steam Deck? ;)
<John_Ivan> steam gaming. handheld.
<weaksauce> i didn't
<weaksauce> looks neat though
<John_Ivan> weaksauce, yup. it runs on Arch
<John_Ivan> that handheld device runs arch with a kde desktop and a bunch of other wrappers making gaming sleek
<John_Ivan> and it's powerful enough to run pretty much most high end games on steam
* John_Ivan explodes due to hype
<John_Ivan> weaksauce, play this around the house
<John_Ivan> and smile *grin*
<John_Ivan> it's your chance to pretend to be italian
<nakilon> TIL: you can have two Homebrew installations _Oo https://github.com/tenderlove/hatstone
<mooff> i haven't tried bundle install --standalone, but if you don't mind relying on Ruby being installed, sounds like a great way to go
<John_Ivan> :)
<John_Ivan> mooff, it's because I have offline installers on disk. ruby + devkit 3.1.1 are offline for me
<John_Ivan> so I can just install it.
<John_Ivan> gems not so much. hence why I want to try to make some packages standalone
<John_Ivan> nakilon, stone of hat :)
TCZ has quit [Quit: Leaving]
<weaksauce> John_Ivan https://guides.rubygems.org/run-your-own-gem-server/ another option
<John_Ivan> weaksauce, that would work too
<John_Ivan> weaksauce, would need something like apt-mirror tho :P
<John_Ivan> gem-mirror!
* John_Ivan wiggles his italian moustache
<John_Ivan> mooff, why did you say you "sadly" never leave this place? :D
<John_Ivan> not leaving is a good thing
<mooff> John_Ivan: i think that was ox1eef
<mooff> lol
<John_Ivan> mooff, sorry.
<John_Ivan> ox1eef, **
<ox1eef> oh just a joke. i'm connected here all the time through a droplet.
<John_Ivan> :)
<ox1eef> it is certainly a nice place to discuss ruby and programming. way better than twitter and the like.
<John_Ivan> ox1eef, good to hear. Been looking for such a place myself. I'm a refugee from the world of programming.
constxd has joined #ruby
<John_Ivan> ox1eef, I've strangled with python, gotten rust over my shoes, C'd my way out of the coffeescript department, commited C#-acide and worst of all, I used the verb "Go" instead of "went" when I tried to get out of that place.
<John_Ivan> I just couldn't find any middle ground. C/C++ is my main area but it sadly requires far too much effort and lines of code to get something done in it.
<John_Ivan> and relying on frameworks usually involves a lot of config
<constxd> nice
<constxd> take the ruby pill
<John_Ivan> languages like python cause my eyes to be lost
<John_Ivan> too much whitespace
<John_Ivan> can tell where something starts but not where it ends
<John_Ivan> constxd, ye
<John_Ivan> ruby on the other hand clicked. good balance. sane syntax. high level enough to consider.
<John_Ivan> docs are also somewhat better. at least, so far... I do have SOME complaints but not as many as other languages.
<John_Ivan> python docs are like "woah.... is that an object... of what type bruh?"
<constxd> i have a question for you ruby kings
<John_Ivan> enumerating processes in C requires (and I shit you not) exactly 72 lines of code.
<John_Ivan> something ruby does in 1-3 lines...
<John_Ivan> it's like - "C: Suffer bitch..."
<John_Ivan> constxd, anyway, I'm done talking to myself. Go ahead.
oxfuxxx has quit [Ping timeout: 250 seconds]
<constxd> are people using RBS?
<constxd> John_Ivan: that doesn't sound right 72 lines?
<constxd> wtf are u doing
<John_Ivan> constxd, yes. Win32 has an "ancient" function called CreateToolhelpSnapshot32Snapshot() to further call ProcessFirst() and ProcessNext() in order to traverse module lists.
<constxd> oh i was thinking linux
<John_Ivan> constxd, nah. linux is cool.
<John_Ivan> linux isn't windows
<John_Ivan> :P
<constxd> yeah win32 is very special
<John_Ivan> constxd, win32 complexity is equivalent to xorg raw geometry complexity.
<John_Ivan> making a gui feels like lifting mountains
* John_Ivan complains about his spine
<John_Ivan> a simple window that handles layout management, some control events and such (take an IRC window) would be about 800 lines of code.
<John_Ivan> I fucking counted!
<John_Ivan> constxd, anyway, win32 is an interesting area. I like it, I just hate how much I have to work to get anything done.
<John_Ivan> constxd, don't ever write a GUI in win32
<John_Ivan> you will die
<John_Ivan> by the time you reach 3k lines of code, you will look at your ambitious looking wordpad app
<John_Ivan> or your notepad++ clone
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
<mooff> win32 is nice in that it's stable and relatively functional
<mooff> i hope it gets ported to wasm, including win32 forms
<mooff> the best gems are totally undocumented and lack tests, right?
<mooff> finally published the IRC code i've been working on \o/ https://github.com/awfulcooking/iirc
<ox1eef> the win32 api is very powerful though, and actually quite usable from ruby.
<ox1eef> at an old job i did just that.
<ox1eef> mooff: cool - looks interesting.