havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
cacheeror has left #ruby ["WeeChat 2.8"]
jenrzzz has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Manchotix[m] has quit [Ping timeout: 246 seconds]
plutes has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 272 seconds]
DaRock has joined #ruby
Manchotix[m] has joined #ruby
plutes has joined #ruby
Caius has quit [Ping timeout: 246 seconds]
Caius has joined #ruby
Caius has quit [Changing host]
Caius has joined #ruby
tranch[m] has quit [Ping timeout: 246 seconds]
hsiktas[m] has quit [Ping timeout: 246 seconds]
mbarbar has quit [Ping timeout: 246 seconds]
turt2live has quit [Ping timeout: 246 seconds]
plutes has quit [Read error: Connection reset by peer]
tranch[m] has joined #ruby
cacheerror has joined #ruby
cacheerror has quit [Client Quit]
mbarbar has joined #ruby
cacheerror has joined #ruby
hsiktas[m] has joined #ruby
turt2live has joined #ruby
RingtailedFox has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 256 seconds]
xco has joined #ruby
cacheerror has quit [Quit: WeeChat 2.3]
cacheerror has joined #ruby
ur5us has joined #ruby
teclator has quit [Read error: Connection reset by peer]
RingtailedFox has joined #ruby
poro_ has joined #ruby
teclator has joined #ruby
poro has quit [Ping timeout: 246 seconds]
gix has quit [Ping timeout: 244 seconds]
tranch[m] has quit [Ping timeout: 246 seconds]
hsiktas[m] has quit [Ping timeout: 246 seconds]
tranch[m] has joined #ruby
cd has quit [Quit: cd]
hsiktas[m] has joined #ruby
alexherbo2 has quit [Ping timeout: 246 seconds]
ta has quit [Ping timeout: 272 seconds]
ta has joined #ruby
poro_ has quit [Quit: Leaving]
haraoka has joined #ruby
jinmiaoluo has joined #ruby
Arkantos_ has quit [Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in]
Arkantos has joined #ruby
SuperLag has quit [Remote host closed the connection]
jinmiaoluo has quit [Ping timeout: 246 seconds]
jinmiaoluo has joined #ruby
jinmiaoluo has quit [Ping timeout: 260 seconds]
plutes has joined #ruby
bga57 has quit [Ping timeout: 272 seconds]
bga57 has joined #ruby
bga57 has quit [Ping timeout: 272 seconds]
<xco> i'm a little bothered that kovid rose very quickly to 99 stars and just stuck! the 100th start has taken close to 2 months and it's still not coming https://github.com/siaw23/kovid
<xco> anyone wants to waste a star so i get a sense of "completeness"
<xco> ?
<xco> 😅
<xco> it'd be waaaaay happier even if it were 75 stars than 99 stars
<xco> :D :D
<xco> I'd*
bga57 has joined #ruby
<apotheon> done
<xco> whew!! apotheon you rock!
<xco> you know how good this feels? hahhaha
<apotheon> no clue
<apotheon> I've never gotten 99 stars on anything.
<xco> to be honest the stars mean nothing, it's just like facebook likes for some people (not for me though)
<xco> it just worries me that it was stuck at 99%
<xco> imagine you're watching a movie that buffers to 99% then gets stuck
<xco> i'd go mad
<xco> same here
<xco> 🤣...
<xco> apotheon anyway i have a genuine question for you, let me prepare a gist for you, it's about accessing a local variable withing a nested block
amjam has quit [Quit: leaving]
<apotheon> I have two things with four stars. Those are my high-star-rating repositories.
<apotheon> har har
<apotheon> It's okay. Most of my repos on GitHub are shit.
<apotheon> . . . or forks for minor pull requests.
lawr3nce has quit [Remote host closed the connection]
_whitelogger has joined #ruby
bga57 has quit [Ping timeout: 272 seconds]
<xco> apotheon yeah i realised that
<xco> look at L8
<xco> ideas?
bga57 has joined #ruby
tau has joined #ruby
RingtailedFox has quit [Quit: Leaving]
jinmiaoluo has joined #ruby
<havenwood> xco: From what you've shown, it looks like @extra should be EXTRA.
<havenwood> xco: Why an instance variable instead of a constant? Is there a reason not shown?
<havenwood> &>> [] + nil
<rubydoc> stderr: -e:4:in `+': no implicit conversion of nil into Array (TypeError)... check link for more (https://carc.in/#/r/97m2)
<havenwood> xco: EXTRA = %w[some extra].freeze
<havenwood> xco: csv << [row, *EXTRA]
imode has quit [Ping timeout: 246 seconds]
<apotheon> I'm not entirely clear on why toplevel instance variables aren't behaving like they're lexically scoped, actually.
<apotheon> I think they used to, in an earlier version of Ruby.
<xco> apotheon my thought exactly... for some reason i was so sure a top-level instance variable would be accessible down the change to everything
<xco> havenwood that works nicely but now i have so many questions, why does a constant work and an instance var doesn't?
<apotheon> I've gotta get going, but maybe I can check back later and find out why things seem to have changed.
<apotheon> (not that I've used instance variables as globals much anyway)
<xco> apotheon no worries. stay safe
^amra has joined #ruby
akem has quit [Quit: Leaving]
ltd has quit [Ping timeout: 258 seconds]
ltd has joined #ruby
<leftylink> so how much am I allowed to change to get it to work.
<leftylink> &>> module A; @v = :yes; def self.f; @v end end; p A.f
<rubydoc> # => :yes... check link for more (https://carc.in/#/r/97mo)
<leftylink> because clearly while that works, it changes a bit too much
<leftylink> so it's probably not allowed to change that much
<leftylink> but what's not allowed to change?
<leftylink> without knowing that, it's not really possible to know what to do here
haraoka has quit [Remote host closed the connection]
<leftylink> here, why don't I assume I'm not allowed to change the extend, nor can I define it as a module function
<leftylink> in which case, I would do this
<leftylink> &>> module A; def self.extended(m); m.instance_variable_set(:@v, :yes) end; def f; @v end end; extend A; f
<rubydoc> # => :yes (https://carc.in/#/r/97mw)
ChmEarl has quit [Quit: Leaving]
evdubs has quit [Remote host closed the connection]
evdubs has joined #ruby
lesha has quit [Ping timeout: 272 seconds]
akem has joined #ruby
^amra has left #ruby [#ruby]
tau has quit [Ping timeout: 260 seconds]
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
imode has joined #ruby
cassolas has quit [Quit: cassolas]
cassolas has joined #ruby
^amra has joined #ruby
<^amra> Hwo can I delete (crop) all html-tags from the string?
^amra has quit [Quit: ^amra]
cassolas has quit [Quit: cassolas]
cfjk has quit [Quit: The Lounge - https://thelounge.chat]
cfjk has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dviola has quit [Quit: WeeChat 2.8]
imode has quit [Ping timeout: 246 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
s2013 has quit [Quit: Textual IRC Client: www.textualapp.com]
xco has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
MrCrackPot has joined #ruby
venmx has quit [Remote host closed the connection]
cadeskywalker has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> ^amra, if they come back: Nokogiri::HTML(string).text
alexherbo2 has joined #ruby
jinmiaoluo has quit [Quit: WeeChat 2.8]
ur5us has joined #ruby
MrCrackPot has quit [Quit: Leaving]
davispuh has joined #ruby
teclator has quit [Ping timeout: 272 seconds]
conta has joined #ruby
venmx has joined #ruby
teclator has joined #ruby
conta has quit [Remote host closed the connection]
conta has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
kenso has joined #ruby
venmx has quit [Quit: leaving]
tf2ftw has quit [Ping timeout: 258 seconds]
imode has joined #ruby
schne1der has joined #ruby
venmx has joined #ruby
imode has quit [Ping timeout: 272 seconds]
fercell has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
venmx_ has joined #ruby
venmx has quit [Quit: leaving]
kinduff has joined #ruby
venmx_ has quit [Client Quit]
venmx has joined #ruby
rprimus has joined #ruby
C-Keen has quit [Quit: WeeChat 2.8]
sarna has joined #ruby
cacheerror1 has joined #ruby
cacheerror has quit [Ping timeout: 246 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
lazarus1 has joined #ruby
conta has quit [Remote host closed the connection]
gix has joined #ruby
ellcs1 has joined #ruby
TomyWork has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
schne1der has quit [Ping timeout: 272 seconds]
goepsilongo has joined #ruby
lxsameer has quit [Ping timeout: 265 seconds]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
patrick99e99 has quit [Ping timeout: 265 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
teclator has quit [Ping timeout: 272 seconds]
patrick99e99 has joined #ruby
patrick99e99 has quit [Ping timeout: 246 seconds]
jetchisel has quit [Ping timeout: 272 seconds]
teclator has joined #ruby
fercell has quit [Quit: WeeChat 2.8]
jenrzzz has joined #ruby
lazarus1 has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
<Cork> anyone know what's holding up https://github.com/ruby/ruby/pull/1732 ?
drincruz_ has joined #ruby
burningserenity has joined #ruby
conta has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
kenso has quit [Quit: Connection closed for inactivity]
fercell has joined #ruby
alexherbo27 has joined #ruby
alexherbo2 has quit [Ping timeout: 272 seconds]
alexherbo27 is now known as alexherbo2
burningserenity has quit [Ping timeout: 260 seconds]
drincruz_ has quit [Ping timeout: 260 seconds]
conta has quit [Quit: conta]
tf2ftw has joined #ruby
Mia has quit [Read error: Connection reset by peer]
xco has joined #ruby
schne1der has joined #ruby
vondruch_ has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
lesha has joined #ruby
kinduff has joined #ruby
vondruch has quit [Ping timeout: 272 seconds]
vondruch_ is now known as vondruch
burningserenity has joined #ruby
<xco> is there a difference between #undef and #undef_method?
Esa__ has joined #ruby
Esa__ has quit [Client Quit]
Esa__ has joined #ruby
drincruz_ has joined #ruby
burningserenity has quit [Ping timeout: 246 seconds]
cd has joined #ruby
goepsilongo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goepsilongo has joined #ruby
dionysus69 has joined #ruby
burningserenity has joined #ruby
poro has joined #ruby
conta has joined #ruby
<poro> is it true that Ruby will give you false data when you ask it to calculate floats with many digits after the dot?
<adam12> poro: Doing math with floats is prone to error in many languages, Ruby included.
<adam12> poro: Ruby includes the BigDecimal library which allows you to do floating point math without rounding errors.
<poro> oh ok
<leftylink> for example
<leftylink> &>> 0.1 + 0.2
<rubydoc> # => 0.30000000000000004 (https://carc.in/#/r/97p1)
<leftylink> enjoy
<adam12> Cork: Might have just fallen through the cracks.
<leftylink> &>> 0.1r + 0.2r
<rubydoc> # => (3/10) (https://carc.in/#/r/97p2)
<leftylink> handy
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
conta has quit [Quit: conta]
burningserenity has quit [Ping timeout: 260 seconds]
alexherbo25 has joined #ruby
alexherbo2 has quit [Ping timeout: 272 seconds]
alexherbo25 is now known as alexherbo2
goepsilongo has quit [Quit: Textual IRC Client: www.textualapp.com]
poro has quit [Quit: Leaving]
alexherbo2 has quit [Ping timeout: 246 seconds]
InfosecTai has joined #ruby
alexherbo2 has joined #ruby
Esa__ has quit []
cnsvc_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
InfosecTai has quit [Quit: Leaving]
TCZ has joined #ruby
cnsvc_ has joined #ruby
chalkmonster has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: WeeChat 2.8]
cnsvc_ has joined #ruby
DaRock has quit [Ping timeout: 256 seconds]
cnsvc_ has quit [Ping timeout: 240 seconds]
sarna has quit [Quit: Connection closed]
clemens3 has quit [Quit: WeeChat 2.7]
patrick99e99 has joined #ruby
fercell has quit [Quit: WeeChat 2.8]
clemens3 has joined #ruby
<havenwood> xco: First, undef is a keyword, so not #undef. That also means it can take a symbol or bare method name, like `undef foo` as well as `undef :foo`.
<havenwood> xco: Unlike, undef and #undef_method, #remove_method just removes the method from the current class, and doesn't interfere with the rest of the ancestry.
sphex has quit [Ping timeout: 256 seconds]
sphex has joined #ruby
clemens3 has quit [Quit: WeeChat 2.7]
clemens3 has joined #ruby
<havenwood> xco: Since #undef_method is a method, you can call it on a class, unlike undef.
<havenwood> xco: It's somewhat similar to how you can define a method with the keyword def or the method #define_method. The keyword is used more commonly but the method is more flexible in certain cases where the keyword won't work.
cnsvc_ has joined #ruby
lesha has quit [Ping timeout: 246 seconds]
cnsvc_ has quit [Ping timeout: 240 seconds]
aesthe has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
ChmEarl has joined #ruby
va5c0 has joined #ruby
va5c0 has quit [Quit: WeeChat 2.8]
linetrac1 is now known as linetrace
rafadc has joined #ruby
canton7 has quit [Quit: ZNC - http://znc.in]
canton7 has joined #ruby
cnsvc_ has joined #ruby
rafadc has quit [Client Quit]
rafadc has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
conta has joined #ruby
<ule> havenwood: hey, are you there?
<ule> havenwood: this is what happened here after compiling ruby with jemalloc
cnsvc_ has joined #ruby
<ule> from ~1GB to ~400mb
<ule> :D
imode has joined #ruby
<al2o3-cr> jemalloc good...
chalkmonster has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
<havenwood> ule: And typically a nice little speed increase as well. :)
<ule> al2o3-cr: I've been reading many good things about it since havenwood mentioned.
cloaked1 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<ule> Looks like Firefox uses jemalloc as well
<ule> Facebook also uses internally in some projects
<ule> havenwood: so far in our tests, it looks a bit slower actually. We'll finish tests this afternoon
<havenwood> ule: I've always seen a single digit percent performance improvement. I'd be curious to know your results.
<havenwood> Once they're in.
<ule> I'll definitely share with more details
conta has quit [Read error: Connection reset by peer]
BTRE has quit [Quit: Leaving]
schne1der has quit [Ping timeout: 256 seconds]
TomyWork has quit [Remote host closed the connection]
aesthe has quit [Quit: Leaving]
clemens3 has quit [Quit: WeeChat 2.7]
chalkmonster has quit [Quit: WeeChat 2.8]
<adam12> ule: Did you look at setting the ARENA environment variable? Apparently it works in similar ways for reducing memory usage.
<adam12> MALLOC_ARENA_MAX=2
<havenwood> Nifty gem ^
aesthe has joined #ruby
lazarus1 has joined #ruby
howdoi has joined #ruby
sol1d_ has quit [Ping timeout: 264 seconds]
hiroaki has joined #ruby
lesha has joined #ruby
NODE has quit [Excess Flood]
NODE has joined #ruby
Besnik_b has quit [Remote host closed the connection]
Besnik_b has joined #ruby
NODE has quit [Excess Flood]
NODE has joined #ruby
BTRE has joined #ruby
NODE has quit [Excess Flood]
NODE has joined #ruby
NODE has quit [Excess Flood]
venmx has quit [Ping timeout: 246 seconds]
NODE has joined #ruby
NODE has quit [Excess Flood]
clemens3 has joined #ruby
sauvin has quit [Ping timeout: 258 seconds]
clemens3 has quit [Client Quit]
NODE has joined #ruby
NODE has left #ruby [#ruby]
clemens3 has joined #ruby
sol1d has joined #ruby
aesthe has quit [Quit: Leaving]
cnsvc_ has joined #ruby
<xco> havenwood it's the nuances that always get me... thanks. those method are pretty useful (talking about undef and #undef_method), when you want to change core functionality with the help of refinements
nofxx__ has joined #ruby
nofxx_ has quit [Ping timeout: 258 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #ruby
major_majors has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
major_majors has joined #ruby
major_majors has quit [Changing host]
major_majors has joined #ruby
ni291187 has joined #ruby
<CommunistWolf> boycott refinements :p
major_majors has quit [Client Quit]
greengriminal has quit [Quit: This computer has gone to sleep]
ni291187 has left #ruby [#ruby]
major_majors has joined #ruby
major_majors has quit [Changing host]
major_majors has joined #ruby
chalkmonster has joined #ruby
sphex has quit [Read error: Connection reset by peer]
sphex has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
cnsvc_ has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
schne1der has joined #ruby
jetchisel has joined #ruby
r29v has joined #ruby
Deesl has joined #ruby
miah has joined #ruby
cxl has quit [Ping timeout: 265 seconds]
<xco> CommunistWolf ha. refinements are cool
<CommunistWolf> nein
lxsameer has quit [Ping timeout: 272 seconds]
<havenwood> CommunistWolf: Refine everything!
<CommunistWolf> it's such a bad idea
<leftylink> I would like to voice my support
<leftylink> thanks for listening
cxl has joined #ruby
<leftylink> although I suppose I didn't give anyone a choice
<leftylink> so it's not much to thank for
<CommunistWolf> I've been struck recently by how much we have to hem people in at work to not use various features of ruby
<CommunistWolf> the list of cops is long and ever-growing
<havenwood> CommunistWolf: I see some shops use a subset of Ruby and others use every part of Ruby Matz included.
<havenwood> CommunistWolf: Seems to work fine both ways.
<havenwood> CommunistWolf: I don't see a reason to ban refinements. ¯\_(ツ)_/¯ That's an odd one.
<havenwood> I've not actually had refinements bite me. I'm curious what the perceived trouble is.
<havenwood> Monkey patching core classes, sure. Don't do that! But refinements? They're harmless.
lxsameer has joined #ruby
akem has quit [Ping timeout: 246 seconds]
konvertex has joined #ruby
lesha has quit [Remote host closed the connection]
lesha has joined #ruby
<CommunistWolf> not so harmless
<CommunistWolf> if you don't carry the full list of currently active refinements around in your head, you will suffer
<CommunistWolf> and that's just not possible in large codebases
<CommunistWolf> at least monkey-patches have global scope, so affect every site in the process
<xco> havenwood Monkey patching core classes, sure. Don't do that! But refinements? They're harmless. << preach on brother
<xco> CommunistWolf if you don't carry the full list of currently active refinements around in your head, you will suffer << how about documentation if the codebase is that large?
<CommunistWolf> impractical
<xco> hm... now i'm left to imagine how big of a codebase that must be
akem has joined #ruby
<CommunistWolf> there are whole subsystems, changes to which I have to do reviews for, that have grown up without my involvement at all. If refinements have been used in them, it's hard for me to rely on my general knowledge to do that
* CommunistWolf runs sloccount
<CommunistWolf> Total Physical Source Lines of Code (SLOC) = 99,081
<havenwood> CommunistWolf: But what's the longest file? Refinements are lexically scoped to the class or module definition they're in and the current file.
<CommunistWolf> a few thousand lines maybe
<havenwood> CommunistWolf: If refinements weren't so tightly scoped, it'd be a problem. But I can look inside a single file for refinements without hassle unless they're used gratuitously.
<CommunistWolf> looks like they're not used at all in this codebase
<CommunistWolf> hopefully it'll stay that way :3
<havenwood> CommunistWolf: The size of the project isn't relevant due to scoping. It's only the size of the current file.
<CommunistWolf> so many files > 1kloc :/
<havenwood> CommunistWolf: Every time I've used them in prod it's been fine. ¯\_(ツ)_/¯
<havenwood> CommunistWolf: 1kloc isn't hard to find a refinement.
<havenwood> CommunistWolf: It's scoped to the class and file. If you have 10kloc classes, that seems excessive.
<CommunistWolf> I shall remain happy that they don't exist for me
<havenwood> They're fine. FUD.
<havenwood> Refinements are delicate and graceful creatures.
<havenwood> CommunistWolf: I do use them sparingly. Maybe that's why they've caused zero pain but some delight.
<CommunistWolf> maybe one day I'll find a good use for one
alexherbo21 has joined #ruby
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo21 is now known as alexherbo2
Deesl has quit [Quit: Textual IRC Client: www.textualapp.com]
akem has quit [Ping timeout: 246 seconds]
gell5 has joined #ruby
DTZUZU has quit [Quit: WeeChat 2.8]
alexherbo2 has quit [Ping timeout: 246 seconds]
akem has joined #ruby
schne1der has quit [Remote host closed the connection]
venmx has joined #ruby
DTZUZU has joined #ruby
kiwi_2457 has joined #ruby
kiwi_2457 has quit [Remote host closed the connection]
DTZUZU has quit [Client Quit]
DTZUZU has joined #ruby
gell5 has quit [Remote host closed the connection]
gell5 has joined #ruby
akem has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
akem has joined #ruby
akem has quit [Ping timeout: 272 seconds]
cloaked1 has joined #ruby
ur5us has joined #ruby
orbyt_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
drincruz_ has quit [Quit: WeeChat 2.6]
akem has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
BTRE has quit [Ping timeout: 265 seconds]
BTRE has joined #ruby
ur5us has quit [Ping timeout: 272 seconds]
chalkmonster has joined #ruby
teclator has quit [Ping timeout: 260 seconds]