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
hololeap has joined #ruby
hololeap has quit [Quit: Bye]
hololeap has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
Stoffel has quit [Ping timeout: 260 seconds]
grokify has joined #ruby
toshiba__ has quit [Read error: Connection reset by peer]
cuntor24 has joined #ruby
toshiba__ has joined #ruby
grokify has quit [Ping timeout: 246 seconds]
cuntor24 has quit [Ping timeout: 268 seconds]
toshiba__ has quit [Ping timeout: 246 seconds]
Guimauve has quit [Ping timeout: 244 seconds]
drainpipe has joined #ruby
drainpipe has quit [Ping timeout: 252 seconds]
mitt3ns has joined #ruby
r3m has quit [Quit: WeeChat 3.7-dev]
r3m has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
Rounin has quit [Ping timeout: 264 seconds]
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
Vonter has quit [Ping timeout: 252 seconds]
drainpipe has joined #ruby
drainpipe has quit [Ping timeout: 252 seconds]
moldorcoder7 has quit [Ping timeout: 246 seconds]
Vonter has joined #ruby
weyhmueller has quit [Quit: ZNC - https://znc.in]
weyhmueller has joined #ruby
D_A_N has quit [Quit: leaving]
wand has quit [Remote host closed the connection]
wand has joined #ruby
Vonter has quit [Read error: Connection reset by peer]
Vonter has joined #ruby
drainpipe has joined #ruby
drainpipe has quit [Ping timeout: 260 seconds]
Vonter has quit [Ping timeout: 268 seconds]
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
lagash has quit [Ping timeout: 264 seconds]
plujon has quit [Ping timeout: 252 seconds]
lagash has joined #ruby
stomper2x has joined #ruby
stomper2x has quit [Client Quit]
toshiba has joined #ruby
toshiba has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 246 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mitt3ns is now known as agent_white
frax44 has joined #ruby
___nick___ has joined #ruby
drainpipe has joined #ruby
drainpipe has quit [Ping timeout: 252 seconds]
agent_white has quit [Quit: bbl]
_ht has joined #ruby
crux73 has joined #ruby
frax44 has quit [Ping timeout: 268 seconds]
ur5us has joined #ruby
ur5us has quit [Quit: Leaving]
dionysus69 has joined #ruby
ur5us has joined #ruby
rvalue has quit [Quit: ZNC - https://znc.in]
rvalue has joined #ruby
cek has joined #ruby
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp has joined #ruby
drainpipe has joined #ruby
drainpipe has quit [Ping timeout: 264 seconds]
jollyrogue[m] has quit [Read error: Connection reset by peer]
jhass[m] has quit [Read error: Connection reset by peer]
DenKn[m] has quit [Write error: Connection reset by peer]
sixecho has quit [Read error: Connection reset by peer]
lightstalker has quit [Write error: Connection reset by peer]
andrea[m] has quit [Read error: Connection reset by peer]
jhass[m] has joined #ruby
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
sixecho has joined #ruby
jollyrogue[m] has joined #ruby
lightstalker has joined #ruby
andrea[m] has joined #ruby
DenKn[m] has joined #ruby
Vonter has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
Vonter has quit [Read error: Connection reset by peer]
crux73 has quit [Quit: Leaving]
Vonter has joined #ruby
frax44 has joined #ruby
moldorcoder7 has joined #ruby
mitt3ns has joined #ruby
Vonter has quit [Ping timeout: 264 seconds]
royo25 has joined #ruby
royo25 has quit [Quit: Bye]
reset has quit [Quit: reset]
drainpipe has joined #ruby
croot has joined #ruby
Stoffel has joined #ruby
croot has quit [Changing host]
croot has joined #ruby
croot has left #ruby [#ruby]
drainpipe has quit [Ping timeout: 264 seconds]
onyx has joined #ruby
croot has joined #ruby
<Stoffel> **shudders**
<Stoffel> hey guys...
<Stoffel> does..... .capitalize() affect digits? because it does in what I've encountered.
<Stoffel> and it kept me perplexed for 2 days straight
royo25 has joined #ruby
<Stoffel> "Test123".capitalize().eql?("TEST123") gives out false unless I do "TEST123".capitalize() too.
D_A_N has joined #ruby
<sam113101> Stoffel: not sure I understand your issue
<Stoffel> sam113101, isn't "Test123".capitalize() the same as "TEST123"? Shouldn't it give true?
<Stoffel> if compared via eql?() or ==
cek has quit [Quit: Connection closed for inactivity]
<Stoffel> Because it gives false in my case.
<sam113101> Stoffel: no, with capitalize every word starts with an uppercase letter, you're looking for .upcase I think
<sam113101> 'test123'.upcase
<Stoffel> I am yes. wait. so what exactly does capitalize do instead?
<sam113101> It Does That, Every Word Starts With A Capital Letter
Vonter has joined #ruby
<sam113101> actually no
<sam113101> just the first letter I think?
<Stoffel> I think there's something off here.
<sam113101> yeah just the first letter
<Stoffel> because I saw the results of capitalize.
<Stoffel> it produces "TEST123"
<Stoffel> but when compared through the if statement, it gives false for some odd reason.
<Stoffel> unless the digits 1 2 3 get changed to some other representation (which is weird imo)
<sam113101> it will actually turn upper case letter into lower case ones too
<sam113101> letters*
crux73 has joined #ruby
<sam113101> 'TEST'.capitalize == 'Test'
some14u has joined #ruby
royo25 has quit [Quit: Bye]
<Stoffel> ok. sigh. thank you.
toshiba__ has joined #ruby
frax44 has quit [Ping timeout: 268 seconds]
crux73 has quit [Ping timeout: 268 seconds]
some14u has quit [Ping timeout: 268 seconds]
some14u has joined #ruby
toshiba__ has quit [Ping timeout: 250 seconds]
some14u has quit [Ping timeout: 248 seconds]
Stoffel has quit [Read error: Connection reset by peer]
John_Ivan has joined #ruby
nyuszika7h has quit [Quit: WeeChat 3.7]
nyuszika7h has joined #ruby
some14u has joined #ruby
frax44 has joined #ruby
frax44 has quit [Read error: Connection reset by peer]
cartdrige has joined #ruby
drainpipe has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
grokify has joined #ruby
drainpipe has quit [Ping timeout: 248 seconds]
grokify has quit [Remote host closed the connection]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
Sheilong has joined #ruby
matju has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
mitt3ns has quit [Remote host closed the connection]
eddof13 has joined #ruby
grokify has quit [Remote host closed the connection]
eddof13 has quit [Ping timeout: 248 seconds]
victori has quit [Read error: Connection reset by peer]
victori has joined #ruby
crux73 has joined #ruby
toshiba__ has joined #ruby
cartdrige has quit [Ping timeout: 248 seconds]
cartdrige has joined #ruby
crux73 has quit [Ping timeout: 248 seconds]
crux73 has joined #ruby
whatahwt has joined #ruby
toshiba__ has quit [Ping timeout: 248 seconds]
cartdrige has quit [Ping timeout: 248 seconds]
ollysmith has quit [Quit: ZNC 1.8.2+deb3 - https://znc.in]
ollysmith has joined #ruby
nyuszika7h has left #ruby [WeeChat 3.7]
drainpipe has joined #ruby
whatahwt has quit [Quit: Leaving]
drainpipe has quit [Ping timeout: 264 seconds]
toshiba__ has joined #ruby
crux73 has quit [Ping timeout: 252 seconds]
cartdrige has joined #ruby
Guimauve has joined #ruby
matju has quit [Quit: Leaving]
toshiba__ has quit [Ping timeout: 250 seconds]
crux73 has joined #ruby
cartdrige has quit [Ping timeout: 250 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
toshiba__ has joined #ruby
crux73 has quit [Ping timeout: 248 seconds]
toshiba__ has quit [Client Quit]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
<sam113101> guys help me
grokify has quit [Remote host closed the connection]
justVain is now known as justache
onyx has quit [Read error: Connection reset by peer]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
<croot> That's poignant.
<croot> :')
<joto> :D
<croot> I'm coding on paper.
<croot> mapping the directories tree into my future app
<croot> pre-stage
nirvdrum has joined #ruby
jetchisel has quit [Ping timeout: 248 seconds]
jetchisel has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
<croot> staging.eql?("make unit test") == nil I don't know how to
<croot> I would compare my get requests if assert("good results") then OK
<leftylink> I thought that couldn't happen. I thought eql? is supposed to only return true or false, not nil.
Al2O3 has quit [Ping timeout: 248 seconds]
<croot> how do you parse a get request then?
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
yxhuvud has quit [Read error: Connection reset by peer]
staff420 has joined #ruby
<staff420> Is there a way to automatically do `git checkout HEAD -- Gemfile.lock && bundle install && git add Gemfile* && git rebase --continue` everytime my Gemfile.lock is having a conflict during a rebase?
Al2O3 has joined #ruby
yxhuvud has joined #ruby
___nick___ has quit [Ping timeout: 268 seconds]
<croot> I get a passennger [emerg] still could not bind() Address already in use
_ht has quit [Remote host closed the connection]
<croot> rm passenger.pid don't change anything.
<croot> restarting nginx didn't change a thing.
_ht has joined #ruby
<croot> Phusion Passenger(R) Standalone is not running, according to PID file /var/www/sinatra/passenger.3000.pid
_ht has quit [Remote host closed the connection]
<croot> Ha! It's used by nginx.
drainpipe has joined #ruby
<croot> How to unbind the port used by nginx?
<croot> mh, i had a backend.conf file in /etc/nginx/conf.d/ using the port.
some14u has joined #ruby
dionysus69 has joined #ruby
drainpipe has quit [Ping timeout: 250 seconds]
<sam113101> what do you think is the fastest way to check if a number ends with 6, number.digits.first == 6 or number % 10 == 6
<sam113101> or even number.to_s[-1] == '6'
reset has joined #ruby
grokify has quit [Remote host closed the connection]
<croot> string = 9876.to_s
<croot> string[3,1].eql?(6)
<croot> huh, can't convert a string into an integer.
<croot> use maths
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<croot> 6.next.eql?(7) could work
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
teclator has quit [Remote host closed the connection]
<havenwood> sam113101: modulo
<sam113101> havenwood: thanks, that's what I thought
<havenwood> sam113101: I seem modulo about 3x faster than digits and about 5x faster than string.
<havenwood> With a random sampling of fairly small numbers.
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> That was my same expectation.
some14u has joined #ruby
<havenwood> FWIW, the results are in the same order in JRuby and TruffleRuby. The proportions are quite similar in JRuby but in TruffleRuby modulo is wildly faster, folding the whol thing away.
<sam113101> what's your favorite implementation of ruby?
<havenwood> sam113101: My favorite to contribute to is TruffleRuby, since it's the highest proportion Ruby. CRuby is the one I typically use. JRuby is neat too. Natalie and Artichoke are too relatively new implementations that seem on a good trajectory.
<havenwood> Natalie is C++ and actually emits C++ code and compiles to machine code for standard deployment. It's also quite young. Artichoke is implemented in Rust and aims to emit solid WASM binaries, etc.
<Guimauve> havenwood - headius is jruby's biggest feature, IMHO. years and years ago i had a weird issue i mentioned offhand in #jruby on IRC. he was all like "huh" and 10 minutes later i had a patch
clemens3 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
pavelz has joined #ruby
<havenwood> Guimauve: Yeah, the whole JRuby team is awesome, +1!
drainpipe has joined #ruby
grokify has joined #ruby
drainpipe has quit [Ping timeout: 264 seconds]
plujon has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
jetchisel has joined #ruby
<John_Ivan> anyone into software engineering?
<John_Ivan> I ask because I have a question about a particular scenario which would seem to fall under "fault tolerance" or something
<John_Ivan> so I have a script.
<John_Ivan> the problem is, I'm shaky on the belief that this script is stable
<John_Ivan> I have tests
<John_Ivan> I just.... the nature of what the script does, feels like it's impossible to test against.
grokify has quit [Remote host closed the connection]
<John_Ivan> the script goes on a webpage and checks a few links, to which it bumps a counter if the links satisfy the criteria
<John_Ivan> simple enough. but I have to run this script for over a few thousand urls (from the same webpage)
<John_Ivan> and the predictability of the website's content isn't very good, as I have encountered irregularities with how the data I expect it to be
<madprops> what should i code with ruby
<John_Ivan> in short, I find it extremely hard to make meaningful tests for such a script
Guimauve has quit [Quit: need more cats]
grokify has joined #ruby
<leftylink> the only thing I'd really be interested in testing is how it responds to certain pieces of html
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
<havenwood> John_Ivan: You might consider taking a look at the Async libraries like async-http, which compose pretty well for testing and scale nicely with Ruby 3.1.
<havenwood> John_Ivan: Whatcha using for your HTTP client?
<John_Ivan> havenwood, nokogiri. but that's not what I'm worried about. I'm worried about the html itself.
<John_Ivan> leftylink, this
<John_Ivan> but the possibilities are practically endless..
<John_Ivan> I can at least think of 30 test cases; I think it's madness to do that for a single function.
grokify has quit [Remote host closed the connection]
<John_Ivan> havenwood, nokogiri + open-uri **
<havenwood> John_Ivan: You could use open-uri with `Fiber.schedule do` but I'd suggest taking a look at Typhoeus or async-http.
grokify has joined #ruby
<John_Ivan> havenwood, I think leftylink has narrowed down the scenario where my problem mostly lies with parsing rather than actually doing the web request.
<havenwood> Ah, I missed the backlog.
<havenwood> Reading now.
<John_Ivan> out of frustration, I failed to do this distinction..
<John_Ivan> havenwood, so yeah, in short, the HTML I'm dealing with is very shoddy.
<weaksauce> how important is it to get 100% correct?
<havenwood> HTML tends to be shoddy. Kinda sad XHTML didn't win!
<John_Ivan> yeah, but this is shoddy in semantics not just HTML itself. anyway. weaksauce ehm, well, 100% is impossible because there will be urls that are 404s.
<John_Ivan> so I have to parse, well, 404 pages.
<John_Ivan> which are not the pages I expect but eh.
<John_Ivan> have to account for it.
<John_Ivan> weaksauce, let me try to summarize everything with 1 sentence.
<John_Ivan> weaksauce, the html will contain data out of order (to what it usually is). is irregular in certain parts and regular in others. some content will exist under a class/id which it doesn't belong in. some tags are actually even missing. some pages are 404. other pages contain more information than required or expected.
<John_Ivan> will/may ***
<John_Ivan> as such the testing needed to create a function that parses "correctly" is absurd.
<weaksauce> this is the anime catalog thing?
<John_Ivan> weaksauce, close enough. yeah.
grokify has quit [Remote host closed the connection]
<John_Ivan> weaksauce, it's ultimately the problem that people just aren't very conventional.
grokify has joined #ruby
<John_Ivan> weaksauce, they may add a genre in one work, and another may lack genres completely.
<John_Ivan> weaksauce, another one will have information about the subtitle placed in the wrong tag
<John_Ivan> weaksauce, some information is kept in tags without ids or classes (holy cat)
<John_Ivan> weaksauce, others contain more information than I need and because there's unnecessary stuff in there, my script goes haywire because maybe I've missed an edge case.
<John_Ivan> that's more or less my situation..
<weaksauce> sounds like a rough problem to solve well
<joto> are you in fact web crawling? because in that case it'll be nearly impossible to do 'well'
<John_Ivan> crawling? nah. scraping? somewhat. and yeah, I agree. it will be impossible to do well. but "relatively well" is acceptable to me. I just am getting overwhelmed by the amount of test cases I can come up with on how things can go wrong :D
<joto> meant scraping indeed :)
<John_Ivan> if I was crawling, that's be a nightmare compared to this situation
<John_Ivan> I'd end up in tree nodes where the script just dies lol
<joto> have been there too... it's a hard problem to solve because there little logic
<joto> there's*
<John_Ivan> weaksauce, let me tell you straight - I have my anime catalog scraped. It's on my disk. I have what I need.
<weaksauce> how many sites are you scraping?
<John_Ivan> this is just me "grooming" my data.
<John_Ivan> weaksauce, one.
<John_Ivan> weaksauce, but I need to "keep in sync" what I have on disk with the website.
<John_Ivan> if that makes sense.
<John_Ivan> I "groom" my data and "add/remove" as necessary to meet the "metadata" of the website.
<John_Ivan> catalog entries die out. new ones come in. what I have on disk may not match for some works.
<John_Ivan> that kind of thing.
<John_Ivan> may not match what's online or what's online doesn't match what's on disk (because I simply don't have the work for example)
<joto> exactly. it's what I'm doing too for my content but I imagine it's harder for anime
<John_Ivan> makes me feel more relieved that it's actually a hard problem - was feeling rather incompetent a few minutes ago
<John_Ivan> maybe I need a break.
<joto> nah it is a hard problem. ten years ago or so I categorised all my content against thetvdb
<joto> and eventhough they have an api: the numbering changes on that site during the years
<joto> so had to do a lot of manual work
<John_Ivan> I feel ya. I end up doing some manual work for certain portions which is just quicker done than writing yet another script for "this scenario"
<joto> yep, you'll have to do a mix of automation and manual work. it's impossible to fully automate the process as metadata changes
<joto> scraping a html soup is cool at first but it's a lot of work to keep up
<John_Ivan> word.
* joto is going to bed zzz
<John_Ivan> gnight and thanks for your input
<John_Ivan> anyway, thanks weaksauce, havenwood for your input too.
<John_Ivan> also, been a long while since I've spoken/chatted here with you guys. how've you been
grokify has quit [Remote host closed the connection]
<joto> yw good luck! i'll maybe ping back as I know someone who does a lot of anime categorising.
<John_Ivan> joto, cheers. any advice is welcome.
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grokify has joined #ruby
jetchisel has joined #ruby
grokify has quit [Ping timeout: 250 seconds]
<sam113101> how do I get the methods of a module, but not those that are inherited?