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"?
<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>
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__>
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>
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>
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.