havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.0, 2.7.2, 2.6.6: 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
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfucci has quit [Ping timeout: 265 seconds]
coniptor has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
vk has quit [Ping timeout: 272 seconds]
nicolas_ has joined #ruby
coniptor has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
Technodrome has joined #ruby
whoisxy has joined #ruby
<whoisxy> Hello Could someone assist me with this: https://ideone.com/blYYUL me' works but as you'll see 'you' fails
fandre1986 has joined #ruby
<leftylink> IIRC, there is absolutely no remedy. the only choice is to do memo(:you) { 6 + 4 } and there is no way to achieve it without the parentheses
<whoisxy> leftylink: Ahh okay. Well, that's not the end of the world
<leftylink> https://ruby-doc.org/core-3.0.0/doc/syntax/calling_methods_rdoc.html#label-Block+Argument seems to agree with what I have just said
<whoisxy> leftylink: Thanks.
coniptor has quit [Ping timeout: 256 seconds]
bsdbandit-01 has joined #ruby
rzjian has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
coniptor has joined #ruby
Rudd0 has quit [Ping timeout: 265 seconds]
siery has quit [Read error: Connection reset by peer]
coniptor has quit [Ping timeout: 256 seconds]
fandre1986 has quit [Quit: Connection closed]
whoisxy has quit [Ping timeout: 246 seconds]
roshanavand has quit [Ping timeout: 272 seconds]
coniptor has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coniptor has quit [Ping timeout: 256 seconds]
dilated_dinosaur has quit [Ping timeout: 256 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
coniptor has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
GodFather has quit [Ping timeout: 246 seconds]
gix has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
Technodrome has joined #ruby
bsdbandit-01 has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
dilated_dinosaur has joined #ruby
robotmay has quit [Ping timeout: 240 seconds]
elcuervo has joined #ruby
cuerbot has quit [Ping timeout: 264 seconds]
bsdbandit-01 has joined #ruby
coniptor has quit [Ping timeout: 264 seconds]
GodFather has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
riceandbeans has joined #ruby
<riceandbeans> When using the pg gem, https://github.com/ged/ruby-pg, if you do a query and want to check the number of rows returned, what would you check?
<riceandbeans> There isn't an empty or length and it doesn't return nil when there are no rows returned
<ged> riceandbeans: result.cmd_tuples
<riceandbeans> oh wow, the dude that wrote it
<ged> It's based on the API lib the client library (libpq), so the names come from its functions: https://www.postgresql.org/docs/13/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO
<riceandbeans> That was unexpected, thank you
<ged> Well I only wrote a part of it. Mostly people smarter than me did the rest.
<riceandbeans> I don't question your naming, I'm just a little edgy trying to hurry up and write something to monitor something
<ged> Yep, wasn't suggesting that. Just wanted to give you some guideposts on figuring out the conventions, as they're a bit different than your regular higher-level DB library. :)
<riceandbeans> I guess I kind of invoked you by highlighting your nick by way of the github uri, sorry
<ged> Haha nope, I actually monitor `pg` so I can help out on occasion.
<riceandbeans> Ironically I've been using this lib for years but never actually needed in the past on personal projects to check if there were 0 rows
<ged> So no worries!
<riceandbeans> I rescue errors on duplicate keys and I can do a SELECT COUNT(*) but I didn't want to do a second query
* ged nods.
coniptor has joined #ruby
<ged> The tuples thing is kind of nice because you can also tell how many rows an UPDATE touched too.
envex has joined #ruby
<riceandbeans> Ah
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
<riceandbeans> When referencing https://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/FormatStringToken, what's the proper way to handle padding?
<riceandbeans> Like, if you were doing a puts '%-6s' % foo
<bougyman> with which style?
<riceandbeans> annotated
<riceandbeans> Trying to follow the rubocop recommendation
<riceandbeans> my stuff works now but rubocop wants me to feel bad for doing it like I did above
<bougyman> [2] pry(main)> format("%<thing>10d", thing: 10)
<bougyman> => " 10"
<bougyman> [3] pry(main)> format("%<thing>-10d", thing: 10)
<bougyman> that's annotated
<riceandbeans> That's gonna be kinda goofy looking
<riceandbeans> Because I'm gonna have like
<bougyman> You can set EnforcedStyle to [2] pry(main)> format("%<thing>10d", thing: 10)
<bougyman> => " 10"
<bougyman> gah, sorry, mispaste
<bougyman> can set it to unannotated.
<havenwood> riceandbeans: With the example you gave, you can use #printf.
<bougyman> in a .rubocop.yml
<bougyman> or use printf
<bougyman> or sprintf.
<riceandbeans> format("%<foo>10d %<bar>-10d %<baz>10d", foo: foo, bar: bar, baz: baz)
<riceandbeans> That looks dumb
<riceandbeans> I mean I'm doing it with a puts right now
<bougyman> I don't know why it looks dumb.
<bougyman> It's very explicit.
<riceandbeans> foo: foo, bar: bar, baz: baz
<riceandbeans> You don't think that looks horrifically redundant?
<bougyman> I think it takes the guesswork out of reading the line of code.
<riceandbeans> I mean, I guess
<riceandbeans> I think it's kind of clear that foo, bar, and baz are foo, bar, and baz here.
<riceandbeans> I could be wrong
<bougyman> as opposed to "%10d %-10d %10d %12s", arg1, arg2, arg3, arg2 for instance
<bougyman> format("%<thing>-10d %<thing>10d", thing: 10)
<bougyman> => "10 10"
<bougyman> for instance.
<riceandbeans> I mean, in my actual code they're DB column names, with a puts on the line above with the column names
<riceandbeans> I'll just do the format though, see if anyone complains about it
<riceandbeans> At least rubocop will be happy
nofxx has joined #ruby
endorama has quit [Ping timeout: 240 seconds]
endorama has joined #ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
cliluw has quit [Ping timeout: 264 seconds]
bsdbandit-01 has joined #ruby
ChmEarl has quit [Quit: Leaving]
bsdbandit-01 has quit [Read error: Connection reset by peer]
alexherbo2 has quit [Ping timeout: 246 seconds]
prion has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Rudd0 has joined #ruby
dfucci has joined #ruby
prion has quit [Ping timeout: 272 seconds]
dfucci has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
GodFather has quit [Ping timeout: 264 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
dviola has quit [Quit: WeeChat 3.0]
coniptor has quit [Ping timeout: 256 seconds]
cliluw has joined #ruby
rzjian has quit [Ping timeout: 264 seconds]
coniptor has joined #ruby
m27frogy has quit [Ping timeout: 256 seconds]
nofxx_ has joined #ruby
nofxx has quit [Ping timeout: 246 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
rzjian has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
blackmesa1 has joined #ruby
siery has joined #ruby
dhollinger has quit [Ping timeout: 264 seconds]
dhollinger has joined #ruby
schaerli_ has joined #ruby
Furai has quit [Quit: WeeChat 3.0]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Furai has joined #ruby
Iarfen has quit [Remote host closed the connection]
dfucci has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coniptor has quit [Ping timeout: 264 seconds]
dfucci has quit [Ping timeout: 240 seconds]
coniptor has joined #ruby
schaerli_ has quit [Ping timeout: 256 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
blackmesa1 has quit [Ping timeout: 264 seconds]
al2o3-cr has quit [Quit: WeeChat 3.0]
Xiti has quit [Quit: Leaving]
blackmesa has quit [Ping timeout: 264 seconds]
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #ruby
apotheon has quit [Read error: Connection reset by peer]
apotheon has joined #ruby
TomyWork has joined #ruby
cd has quit [Quit: cd]
dfucci has joined #ruby
bsdbandit-01 has joined #ruby
burgestrand has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
jokester has joined #ruby
BrianWGray has quit [Ping timeout: 260 seconds]
Xiti has joined #ruby
vondruch has joined #ruby
whoisxy has joined #ruby
coniptor has quit [Ping timeout: 256 seconds]
Mrgoose2 has joined #ruby
Mrgoose has quit [Ping timeout: 268 seconds]
Mrgoose2 is now known as Mrgoose
fandre1986 has joined #ruby
coniptor has joined #ruby
cloud69 has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
dfucci has quit [Ping timeout: 240 seconds]
rzjian has quit [Ping timeout: 272 seconds]
apotheon has quit [Ping timeout: 264 seconds]
apotheon has joined #ruby
siery has quit [Read error: Connection reset by peer]
aesthe has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
burgestrand has quit [Quit: burgestrand]
schaerli has joined #ruby
coniptor has quit [Ping timeout: 264 seconds]
burgestrand has joined #ruby
hramrach has quit [Ping timeout: 272 seconds]
fandre1986 has quit [Quit: Connection closed]
coniptor has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
fandre1986 has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
siery has joined #ruby
harland has joined #ruby
<harland> hello
aesthe has quit [Ping timeout: 265 seconds]
dilated_dinosaur has quit [Ping timeout: 264 seconds]
<burgestrand> \o.
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 260 seconds]
markong is now known as mvo_
mvo_ is now known as markong
fandre1986 has quit [Quit: Connection closed]
aesthe has joined #ruby
phaul has joined #ruby
kristian_on_linu has joined #ruby
rubydoc has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
burgestrand has quit [Quit: burgestrand]
siery has quit [Ping timeout: 264 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
coniptor has quit [Ping timeout: 256 seconds]
BTRE has quit [Remote host closed the connection]
burgestrand has joined #ruby
harland has quit [Ping timeout: 264 seconds]
linoge has joined #ruby
BTRE has joined #ruby
akem has quit [Quit: Leaving]
siery has joined #ruby
alexherbo2 has joined #ruby
coniptor has joined #ruby
m27frogy has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
hramrach has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
rubydoc has quit [Remote host closed the connection]
whoisxy has quit [Read error: Connection reset by peer]
rubydoc has joined #ruby
dfucci has joined #ruby
whoisxy has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
Technodrome has joined #ruby
queip has quit [Ping timeout: 260 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
dfucci has joined #ruby
akem has joined #ruby
prepend has joined #ruby
dfucci has quit [Ping timeout: 272 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
cgfbee has quit [Ping timeout: 272 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
clemens3 has quit [Read error: No route to host]
coniptor has quit [Ping timeout: 256 seconds]
al2o3-cr has joined #ruby
dfucci has joined #ruby
coniptor has joined #ruby
cgfbee has joined #ruby
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 272 seconds]
vondruch_ is now known as vondruch
whoisxy has quit [Ping timeout: 256 seconds]
dilated_dinosaur has joined #ruby
queip has joined #ruby
aesthe has quit [Ping timeout: 256 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cgfbee has quit [Ping timeout: 246 seconds]
blackmesa has joined #ruby
aesthe has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
blackmesa has quit [Ping timeout: 272 seconds]
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo2 has joined #ruby
dfucci has joined #ruby
alexherbo28 has joined #ruby
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo28 is now known as alexherbo2
dfucci has quit [Ping timeout: 256 seconds]
blackmesa has joined #ruby
blackmesa1 has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
TomyWork has quit [Remote host closed the connection]
siery has quit [Read error: Connection reset by peer]
siery has joined #ruby
cgfbee has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
hiroaki has joined #ruby
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #ruby
whoisxy has joined #ruby
dfucci has joined #ruby
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
ellcs has joined #ruby
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 246 seconds]
coniptor has quit [Ping timeout: 256 seconds]
dviola has joined #ruby
clemens3 has joined #ruby
schaerli_ has joined #ruby
blackmesa1 has quit [Ping timeout: 256 seconds]
schaerli has quit [Ping timeout: 240 seconds]
cuerbot has joined #ruby
prion has joined #ruby
coniptor has joined #ruby
elcuervo has quit [Ping timeout: 264 seconds]
burgestrand has quit [Quit: burgestrand]
<siery> Hey, can someone help me to figure out how is String value stored in side of the object? When I look for `str.instance_variables`, all I get is an emty array.
<siery> I wold like to write something like this: https://paste.debian.net/1180201/
jacksop has joined #ruby
prion has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
<leftylink> okay. the prime resource to look at to determine how the string value is stored would be String.new
<leftylink> &ri String.new
<leftylink> there is a link labeled Click to toggle source
<leftylink> I guess it's not a link, it's a clickable portion of text
<leftylink> a reminder that if one wishes to monkeypatch or refine String, the entire range of abilities afforded to Strings, as listed on that page, are at one's disposal
akem has quit [Quit: Leaving]
blackmesa1 has joined #ruby
schaerli_ has quit [Ping timeout: 264 seconds]
blackmesa1 has quit [Ping timeout: 272 seconds]
clemens3 has quit [Quit: rebot]
<al2o3-cr> &>> using Module.new { refine String do def /() end_with?(?/) ? self : self << ?/ end end }; "foo"././././././././././././
<rubydoc> # => "foo/" (https://carc.in/#/r/a8ne)
schaerli has joined #ruby
<al2o3-cr> &>> using Module.new { refine String do def ~@() end_with?(?/) ? self : self << ?/ end end }; ~"foo"
<rubydoc> # => "foo/" (https://carc.in/#/r/a8nf)
<al2o3-cr> siery: changing value of self is indeed, impossible.
<al2o3-cr> &>> self += self
<rubydoc> stderr: -e:4: Can't change the value of self... check link for more (https://carc.in/#/r/a8ng)
<al2o3-cr> siery: that's what you are doing in your example.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> siery: https://carc.in/#/r/a8nh
<al2o3-cr> but consider using refinements than direct monkey-patching the String class
jacksop has quit []
ellcs has quit [Ping timeout: 260 seconds]
ChmEarl has joined #ruby
ellcs has joined #ruby
siery has quit [Read error: Connection reset by peer]
siery has joined #ruby
cthulchu_ has joined #ruby
clemens3 has joined #ruby
aesthe has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
quintasan has quit [Quit: quintasan]
quintasan has joined #ruby
coniptor has quit [Ping timeout: 256 seconds]
schaerli has quit [Ping timeout: 265 seconds]
hiroaki has quit [Ping timeout: 272 seconds]
dfucci has quit [Ping timeout: 265 seconds]
aesthe has joined #ruby
stryek has joined #ruby
Xiti` has quit [Quit: Leaving]
ellcs has quit [Ping timeout: 244 seconds]
coniptor has joined #ruby
hiroaki has joined #ruby
dfucci has joined #ruby
ellcs has joined #ruby
clemens3 has quit [Ping timeout: 246 seconds]
dfucci has quit [Ping timeout: 240 seconds]
whoisxy has quit [Ping timeout: 264 seconds]
ellcs has quit [Ping timeout: 240 seconds]
Xiti has joined #ruby
ellcs has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
Technodrome has joined #ruby
prion has joined #ruby
GodFather has quit [Ping timeout: 256 seconds]
prion has quit [Ping timeout: 246 seconds]
ellcs has quit [Ping timeout: 260 seconds]
lucasb has joined #ruby
blackmesa1 has joined #ruby
adu has joined #ruby
ellcs has joined #ruby
leah2 has quit [Ping timeout: 260 seconds]
leah2 has joined #ruby
aesthe has quit [Ping timeout: 256 seconds]
prion has joined #ruby
siery has quit [Read error: Connection reset by peer]
chamunks has quit [Quit: Don't worry I'm not gone yet.]
cnsvc has joined #ruby
siery has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
aesthe has joined #ruby
vondruch has joined #ruby
moldorcoder7 has quit [Ping timeout: 246 seconds]
moldorcoder7 has joined #ruby
Rudd0 has quit [Ping timeout: 256 seconds]
howdoi has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
clemens3 has joined #ruby
<thad_the_man> Why add self to self?
joast has quit [Read error: Connection reset by peer]
joast has joined #ruby
prion has quit [Ping timeout: 265 seconds]
gix has joined #ruby
juliendesrosiers has joined #ruby
coniptor has quit [Ping timeout: 240 seconds]
somazero has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
coniptor has joined #ruby
ZeiP has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
eddof13 has joined #ruby
ZeiP has joined #ruby
BH23_ has quit [Quit: Connection closed for inactivity]
juliendesrosiers has quit [Quit: leaving]
moldorcoder7 has quit [Ping timeout: 264 seconds]
siery has quit [Read error: Connection reset by peer]
linoge has quit [Remote host closed the connection]
moldorcoder7 has joined #ruby
cd has joined #ruby
cthulchu_ has quit [Ping timeout: 256 seconds]
prion has joined #ruby
dfucci has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
dfucci has quit [Ping timeout: 265 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa1 has quit [Ping timeout: 260 seconds]
al2o3-cr has quit [Ping timeout: 256 seconds]
elcontrastador has joined #ruby
aesthe has quit [Quit: Leaving]
dfucci has joined #ruby
roshanavand has joined #ruby
Rudd0 has joined #ruby
Kilo`byte has quit [Quit: ZNC - 1.6.0 - http://znc.in]
dfucci has quit [Ping timeout: 246 seconds]
Kilo`byte has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
coniptor has quit [Ping timeout: 272 seconds]
blackmesa1 has joined #ruby
blackmesa has joined #ruby
blackmesa1 has quit [Ping timeout: 272 seconds]
coniptor has joined #ruby
cthulchu_ has joined #ruby
elcontrastador has quit [Ping timeout: 260 seconds]
cthulchu_ has quit [Ping timeout: 256 seconds]
Mia has quit [Read error: Connection reset by peer]
prion has quit [Ping timeout: 240 seconds]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
Technodrome has joined #ruby
postmodern has joined #ruby
zoid has quit [Quit: going down for a reboot]
siery has joined #ruby
zoid has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coniptor has quit [Ping timeout: 272 seconds]
SeepingN has joined #ruby
cow[moo] has joined #ruby
cow[moo] has quit [Client Quit]
coniptor has joined #ruby
adu has quit [Quit: adu]
Xiti has quit [Quit: Leaving]
orbyt_ has joined #ruby
somazero has quit [Remote host closed the connection]