havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.org | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3 | Can't talk? Register/identify with NickServ
bambanx has joined #ruby
Azure|dc has joined #ruby
Azure has quit [Ping timeout: 246 seconds]
orbyt_ has joined #ruby
mwlang has quit [Quit: mwlang]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cliluw has quit [Ping timeout: 256 seconds]
drincruz has quit [Ping timeout: 264 seconds]
crankharder has joined #ruby
banisterfiend has joined #ruby
orbyt_ has joined #ruby
drincruz has joined #ruby
cliluw has joined #ruby
meinside has joined #ruby
axsuul has quit [Ping timeout: 256 seconds]
Guest27 has joined #ruby
axsuul has joined #ruby
Guest27 is now known as aks
ur5us has joined #ruby
evdubs has quit [Quit: Leaving]
evdubs has joined #ruby
Swyper has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
dfucci has joined #ruby
Swyper has joined #ruby
drincruz has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
drincruz has joined #ruby
katalepsis has joined #ruby
htmnc has quit [Ping timeout: 264 seconds]
drincruz has quit [Ping timeout: 260 seconds]
crankharder has quit [Ping timeout: 264 seconds]
TCZ has quit [Remote host closed the connection]
fuzzface has joined #ruby
fuzzface has quit [Client Quit]
crankharder has joined #ruby
Iarfen has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
chewb has quit [Ping timeout: 265 seconds]
Swyper has joined #ruby
s2013 has quit [Quit: Textual IRC Client: www.textualapp.com]
Swyper has quit [Ping timeout: 264 seconds]
crankharder has quit [Ping timeout: 260 seconds]
drincruz has joined #ruby
katalepsis has quit [Quit: Leaving]
DaRock has joined #ruby
aks has quit [Ping timeout: 260 seconds]
bambanx has quit [Ping timeout: 256 seconds]
kigster has joined #ruby
fratis has joined #ruby
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 265 seconds]
powerhouse has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
kigster has quit [Ping timeout: 246 seconds]
fratis has quit [Ping timeout: 256 seconds]
kigster has joined #ruby
kigster has quit [Client Quit]
dfucci has quit [Ping timeout: 260 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
powerhouse has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
polishdub has joined #ruby
Rudd0 has joined #ruby
bambanx has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
bambanx has quit [Quit: Leaving]
hagabaka has quit [Ping timeout: 264 seconds]
crankharder has joined #ruby
cloud69 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix- has joined #ruby
gix has quit [Disconnected by services]
coniptor has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
hagabaka has joined #ruby
Swyper has joined #ruby
polishdub has quit [Quit: leaving]
Swyper has quit [Ping timeout: 240 seconds]
crankharder has quit [Quit: leaving]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coniptor has joined #ruby
akem_ has joined #ruby
coniptor has quit [Ping timeout: 260 seconds]
akem has quit [Ping timeout: 256 seconds]
Tempesta has quit [Quit: See ya!]
ChmEarl has quit [Quit: Leaving]
orbyt_ has joined #ruby
cthu| has quit [Ping timeout: 240 seconds]
Tempesta has joined #ruby
dfucci has joined #ruby
factormystic has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 246 seconds]
coniptor has joined #ruby
factormystic has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leftylink> hmm
<leftylink> is there any expression of a similar form that looks aesthetically pleasing at all?
<leftylink> &>> ???????::?::????::??
pinkpandabot has joined #ruby
<leftylink> pinkpandabot: rb ???????::?::????::??
<pinkpandabot> ":" - stderr: -e:2: warning: string literal in condition - https://carc.in/#/r/a18c
<leftylink> so, I dunno. it works but it's just not very aesthetically pleasing
<leftylink> like there's no rhyme or reason to the number of consecutive question marks
cloud69 has quit [Quit: Connection closed for inactivity]
Swyper has joined #ruby
bambanx has joined #ruby
bambanx has quit [Client Quit]
code_zombie has quit [Quit: Leaving]
BenDover has joined #ruby
dfucci has joined #ruby
ZeroFreak has joined #ruby
hiroaki has joined #ruby
ua has quit [Ping timeout: 265 seconds]
DaRock has quit [Ping timeout: 240 seconds]
ua has joined #ruby
weaksauce has quit [Ping timeout: 256 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ZeroFreak has quit [Remote host closed the connection]
coniptor has quit [Ping timeout: 272 seconds]
ur5us has joined #ruby
ur5us has quit [Client Quit]
DaRock has joined #ruby
coniptor has joined #ruby
royo25 has joined #ruby
royo25 has quit [Ping timeout: 240 seconds]
cloud69 has joined #ruby
vondruch has joined #ruby
tekk has quit [Ping timeout: 256 seconds]
tekk has joined #ruby
TomyWork has joined #ruby
royo25 has joined #ruby
pwnd_sfw has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
pwnd_sfw has joined #ruby
akem_ is now known as akem
akem has quit [Quit: Leaving]
<tempate> Hello. I'm trying to use regular expressions in Ruby and it's giving me an undefined-group-option error. This is the line that's giving me trouble: pattern = Regexp.compile(/^(?P<pos1>\d+)-(?P<pos2>\d+) (?P<letter>[a-z]{1}): (?P<string>[a-z]+)$/)
akem has joined #ruby
<jhass> First of all, passing a regex literal, //, to .compile doesn't make a whole lot of sense :) Now P indeed is not an option Ruby knows. A named group is simply (?<name>content)
<jhass> https://rubyapi.org/2.7/o/regexp documents ruby regular expressions pretty well
HappyGirl has joined #ruby
<HappyGirl> hey! =)
<HappyGirl> does anyone here use ruby to manage SEO keywords like density/stuffing.. and scraping/analyzing other websitse?
<HappyGirl> i imagine ruby must vbe the funnest and most beautiful language to play in :D
<tempate> jhass: oh, right, thank you very much
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
duderonomy has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
Mrgoose has quit [Quit: The Lounge - https://thelounge.chat]
apoc has quit [Quit: WeeChat 2.8]
vondruch has quit [Ping timeout: 264 seconds]
NeoThermic has joined #ruby
<NeoThermic> ok, so I'm trying to extend an ex-colleagues code, and my ruby experience is utterly minimal, so sorry in advanced if the questions are odd. This code has two methods, and both methods create a new Thread. I want to, from a 3rd method call the first two methods, but I need to ensure that they're done in serial (i.e method2 needs to be called after method1). Do Threads auto-resolve before the method returns, or do I need to have some form of
<NeoThermic> locking?
jenrzzz has quit [Ping timeout: 272 seconds]
Technodrome has joined #ruby
<leftylink> no, a thread may outlive the method that returned it. try Thread#join if wishing to wait until a thread finishes
<jhass> NeoThermic: no. I would recommend you refactor out the actual job method1 and method2 are doing from launching a thread, so maybe add spawn_method1 which does just Thread.new { method1 }
<jhass> then you can just have method3 be Thread.new { method1; method2; }
<NeoThermic> hmm
<leftylink> I yield to the sheer superiority of that suggestion to mine
<NeoThermic> could I use join in each method to ensure they return only once the thread is done?
<NeoThermic> I'm lothe to do major refactoring on this code, as ruby isn't a language I'm familiar with, mind. Smallest changes win :D
<leftylink> if they should only return once the job is done, then there doesn't seem to be much point in spawning the thread at all
<jhass> you could, if you don't break the callers with that. And if that's the case I would highly question why they launch a thread in the first place?
<jhass> you gain nothing from a thread in ruby other than being able to continue your buisness while that's still doing its thing
<NeoThermic> I think they thread so the rest of the code can continue working in the background
<jhass> if you always .join, you prevent that "going on"
<NeoThermic> yeah, hmm
banisterfiend has joined #ruby
fredolinhares has joined #ruby
<NeoThermic> looking at their methods, they are very close to just: def methodX(args) Thread.new{...}
ellcs has joined #ruby
jenrzzz has joined #ruby
<NeoThermic> yeah, I might just revert my progress and walk away slowly, I feel like I'm playing with fire on that :D
<NeoThermic> thank you for the food for thought though, if I return to this code I will ensure to read up a lot more :)
jenrzzz has quit [Ping timeout: 260 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
impermanence has joined #ruby
jenrzzz has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
al2o3-cr has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
fercell has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
impermanence has quit [Quit: Connection closed]
pwl has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
drincruz has joined #ruby
tekk has quit [Ping timeout: 260 seconds]
tekk has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
vondruch has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
pwnd_sfw has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 272 seconds]
Technodrome has joined #ruby
kurko_ has joined #ruby
fercell has quit [Quit: WeeChat 2.9]
fratis has joined #ruby
jenrzzz has joined #ruby
apoc has joined #ruby
TCZ has joined #ruby
fredolinhares has quit [Read error: Connection reset by peer]
fratis has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
Technodrome has quit [Read error: Connection reset by peer]
DaRock has quit [Ping timeout: 260 seconds]
DaRock has joined #ruby
deadbee has joined #ruby
deadbee has quit [Client Quit]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deadbee has joined #ruby
jenrzzz has joined #ruby
DaRock has quit [Ping timeout: 256 seconds]
DaRock has joined #ruby
kurko_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
carbone5 has joined #ruby
jenrzzz has joined #ruby
deadbee has quit [Quit: WeeChat 2.9]
jenrzzz has quit [Ping timeout: 260 seconds]
DaRock has quit [Read error: Connection reset by peer]
Mrgoose has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
orbyt_ has joined #ruby
royo25 has quit [Quit: Bye]
carbone5 has quit [Quit: carbone5]
carbone5 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
dcunit3d has joined #ruby
ChmEarl has joined #ruby
TCZ has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
kurko_ has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 272 seconds]
carbone5 has quit [Quit: carbone5]
elcuervo has joined #ruby
carbone5 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has quit [Quit: Leaving]
cuerbot has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
carbone5 has quit [Quit: carbone5]
jenrzzz has quit [Ping timeout: 264 seconds]
pwl has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
bambanx has joined #ruby
solebox has joined #ruby
solebox has left #ruby [#ruby]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
pwl has joined #ruby
cthu| has joined #ruby
jenrzzz has joined #ruby
howdoi has joined #ruby
Eiam has joined #ruby
Eiam has quit [Client Quit]
vondruch has quit [Read error: Connection reset by peer]
Eiam has joined #ruby
akem has joined #ruby
jdeen has joined #ruby
al2o3-cr has joined #ruby
robotmay has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 246 seconds]
robotmay has joined #ruby
blackmesa has joined #ruby
bambanx has quit [Quit: Leaving]
TomyWork has quit [Remote host closed the connection]
jenrzzz has joined #ruby
titanbiscuit has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
coniptor has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jottr has joined #ruby
jenrzzz has joined #ruby
Rudd0 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
duckpuppy has quit [Ping timeout: 256 seconds]
duckpupp- has joined #ruby
banisterfiend has joined #ruby
jenrzzz has joined #ruby
dfucci has quit [Ping timeout: 272 seconds]
coniptor has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
<isene> I have a string with the character '&#966;' - how do I translate that to the actual character 'φ'?
<isene> Is there a way without a gem relience?
jenrzzz has joined #ruby
shokohsc has quit [Quit: The Lounge - https://thelounge.chat]
<jhass> &>> "&#966;".gsub(/&#(\d+);/) { |m| p $1.to_i(10).chr(Encoding::UTF_8) }
jenrzzz has quit [Ping timeout: 240 seconds]
<jhass> meh
shokohsc has joined #ruby
<isene> jhass: Neat. I'll just exted the string class with that
<isene> *extend
blackmesa1 has joined #ruby
<isene> jhass: Thank you so much - this works like a charm :-)
blackmesa has quit [Ping timeout: 272 seconds]
<jhass> always good to just read the sourcecode of a gem you deem too much for a simple task ;)
<jhass> note it won't handle named entities or &#xABC; style entities
duckpupp- has quit [Quit: ZNC 1.8.2 - https://znc.in]
jenrzzz has joined #ruby
duckpuppy has joined #ruby
dcunit3d has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #ruby
<isene> jhass: That is good enough for my application :-)
<isene> And I don't want to rely on gems for installation of my applications
dcunit3d has joined #ruby
jenrzzz has joined #ruby
duderonomy has joined #ruby
stdedos has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
gremax has quit [Quit: Bye]
gremax has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
pwnd_sfw has joined #ruby
dfucci has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
jenrzzz has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
cloud69 has quit [Quit: Connection closed for inactivity]
weaksauce has joined #ruby
cow[moo] has quit [Quit: Textual IRC Client: www.textualapp.com]
dcunit3d has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
cow[moo] has joined #ruby
duderonomy has joined #ruby
jenrzzz has joined #ruby
blackmesa1 has quit [Ping timeout: 260 seconds]
Synthead has joined #ruby
<Synthead> if I have a file open as binary for writing, how can I write a byte to it? If I do file.write(255), it seems to write the ascii "255" to the file when I want to write 0xFF
jenrzzz has quit [Ping timeout: 265 seconds]
<Synthead> Ah, file.write(255.chr) does the trick :)
Synthead has quit [Quit: Leaving]
jenrzzz has joined #ruby
zacts has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
orbyt_ has joined #ruby
akem has quit [Remote host closed the connection]
akem has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
Rudd0 has joined #ruby
jenrzzz has joined #ruby
pxl__ has joined #ruby
pxl__ has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 240 seconds]
pwl has left #ruby ["Leaving"]
BenDover has quit [Quit: BenDover]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
ellcs has joined #ruby
ellcs has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
dfucci has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
jenrzzz has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
zacts has quit [Quit: leaving]
postmodern has joined #ruby
jenrzzz has joined #ruby
bambanx has joined #ruby
dfucci has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
dfucci has quit [Ping timeout: 246 seconds]
coniptor has quit [Ping timeout: 264 seconds]
Technodrome has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dhollinger has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby