adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.1, 2.7.3, 2.6.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3
pyra has quit [Ping timeout: 276 seconds]
infernix has quit [Ping timeout: 250 seconds]
robotbee has joined #ruby
cd has joined #ruby
infernix has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
infernix has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
RubyBrad has joined #ruby
<RubyBrad> If I divide 10.0 by 3.0 why do I get a 5 at the end of the decimal number: puts num1 / num2
<RubyBrad> => 3.3333333333333335 ?
cer-0 has joined #ruby
elcuervo has quit [Quit: ZNC 1.7.5 - https://znc.in]
infernix has joined #ruby
<havenwood> &>> 10.fdiv(3)
<rubydoc> # => 3.3333333333333335 (https://carc.in/#/r/b0it)
<havenwood> RubyBrad: Floats are just that way based on the IEEE spec.
<RubyBrad> havenwood, ok got you. I notice that only with 10.0 / 3.0 but other repeating decimal results aren't off like that.
elcuervo has joined #ruby
<havenwood> RubyBrad: There are tons of ways to get rounding issues with Floats. A Rational doesn't have that issue.
<havenwood> &>> 10/3r
<rubydoc> # => (10/3) (https://carc.in/#/r/b0iu)
evdubs__ has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
<havenwood> RubyBrad: With a Rational, the numerator is 10 and the denominator is 3 and nothing is lost.
<RubyBrad> ah ok
<RubyBrad> I see
kinduff has joined #ruby
<havenwood> RubyBrad: Under the hood, a 0.1 Float is *really* 0.1000000000000000055511151231257827021181583404541015625
evdubs_ has quit [Ping timeout: 240 seconds]
<havenwood> RubyBrad: I don't find Floats particularly useful unless you really mean to be doing floating point math.
<havenwood> RubyBrad: For obvious reasons you'd not want to use them for stuff like currency.
<RubyBrad> havenwood, is there a different data type for currency?
<havenwood> RubyBrad: Typically you have the lowest unit of currency be an Integer. So 100 cents is $1.00.
<havenwood> RubyBrad: Alternatively you can use BigDecimal, Rational, or there are gems like Money that handle it properly.
<havenwood> RubyBrad: It's more common to see Integers used instead of fractions.
<RubyBrad> gems? is that a module or something?
<RubyBrad> err gem.
<havenwood> Ruby libraries are called gems. Yeah, a module that's packaged for others to use.
<RubyBrad> Got you. That's why you do gem install <whatever> then.
<havenwood> RubyBrad: Yup. You can install ones from others or publish your own.
<RubyBrad> ok that's cool. well thanks for the explain havenwood
<havenwood> Saying that reminds me of an early contracting gig I did where the author of the app had a gem in his own name that incorporated all the Ruby libraries he liked to use as dependencies. It'd be like if I maintained a "havenwood" gem and included it with all my code. Very... atypical.
<havenwood> And then he left to go back and work on his PhD and kept changing his personal gem. It got weirder from there. I just worked on it for a few hours before deciding that gig wasn't for me.
<havenwood> When there's no Gemfile, since it's "not needed" when you just have a personal god gem... Also the author did use a Rack framework, which I haven't seen since.
<havenwood> didn't* use Rack
<havenwood> rolled their own server from scratch
<havenwood> also a PHP code serialization bridge
<havenwood> oddly the thing appeared to do what it was supposed to do, they just couldn't find a maintainer when the author left
<havenwood> they refused to rewrite so I made them an (unwanted) Gemfile and advised they hire the original author at whatever cost
<havenwood> ¯\_(ツ)_/¯
<havenwood> it took a few hours just to hunt down all the gems involved beyond author's god gem
<havenwood> no Gemfile or conventions for finding what all gems a massive project uses is frustrating
<havenwood> I've not seen it since. Not once.
<havenwood> Finding the old version of the personal gem to match the time the last version of the app was released was the key. At least the key to unburdening myself that the whole thing was insane and it was better to walk.
duderonomy has joined #ruby
<havenwood> That's a nice bit about being a contractor. You can turn down clients.
cer-0 has quit [Ping timeout: 240 seconds]
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
evdubs__ is now known as evdubs
jmcgnh has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
shtirlic has quit [Ping timeout: 276 seconds]
shtirlic has joined #ruby
jmcgnh has joined #ruby
centrx has joined #ruby
<weaksauce> havenwood that's... insanity
elcuervo has quit [Quit: ZNC 1.7.5 - https://znc.in]
centrx has quit [Ping timeout: 250 seconds]
centrx has joined #ruby
evdubs has quit [Read error: Connection reset by peer]
evdubs has joined #ruby
elcuervo has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
centrx has joined #ruby
py88 has quit [Quit: WeeChat 3.1]
centrx has quit [Ping timeout: 250 seconds]
brunosaboia_ has joined #ruby
brunosaboia_ has quit [Client Quit]
centrx has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
vondruch has joined #ruby
evdubs__ has joined #ruby
explorier has quit [Ping timeout: 240 seconds]
evdubs_ has quit [Ping timeout: 240 seconds]
explorier has joined #ruby
centrx has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
centrx_ has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
gix- has joined #ruby
gix has quit [Disconnected by services]
centrx_ has quit [Ping timeout: 250 seconds]
centrx has joined #ruby
ChmEarl has quit [Quit: Leaving]
RubyBrad has quit [Ping timeout: 240 seconds]
MalkbabY has quit [Remote host closed the connection]
MalkbabY_ has joined #ruby
jenrzzz has joined #ruby
m27frogy has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
postmodern has joined #ruby
robotbee has quit [Ping timeout: 240 seconds]
stryek has quit [Quit: Connection closed for inactivity]
oneeggeach has joined #ruby
oneeggeach has quit [Client Quit]
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 268 seconds]
aloy has quit [Read error: Connection reset by peer]
aloy has joined #ruby
rubydoc has joined #ruby
phaul has joined #ruby
RubyBrad has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
RubyBrad has quit [Ping timeout: 246 seconds]
ur5us__ has quit [Ping timeout: 246 seconds]
robotbee has joined #ruby
maroloccio has joined #ruby
jenrzzz has joined #ruby
teclator has joined #ruby
feriman has joined #ruby
Mrgoose has quit [Ping timeout: 252 seconds]
explorier has quit [Ping timeout: 240 seconds]
explorier has joined #ruby
Mrgoose has joined #ruby
nofxx has quit [Read error: Connection reset by peer]
nofxx has joined #ruby
centrx has quit [Remote host closed the connection]
robotbee has quit [Ping timeout: 240 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
Rudd0 has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 260 seconds]
explorier has quit [Ping timeout: 246 seconds]
explorier has joined #ruby
rubydoc has quit [Ping timeout: 252 seconds]
phaul has quit [Ping timeout: 246 seconds]
explorier has quit [Ping timeout: 246 seconds]
phaul has joined #ruby
rubydoc has joined #ruby
ruurd has joined #ruby
hiroaki has joined #ruby
feriman has quit [Ping timeout: 240 seconds]
nertzy_ has joined #ruby
centrx has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
nertzy has quit [Ping timeout: 260 seconds]
centrx has quit [Ping timeout: 276 seconds]
gearnode has joined #ruby
jokester_ has joined #ruby
jokester has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
rubydoc has quit [Ping timeout: 246 seconds]
phaul has quit [Ping timeout: 246 seconds]
JaredCE has joined #ruby
feriman has joined #ruby
centrx has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
centrx has joined #ruby
MalkbabY_ has quit [Remote host closed the connection]
jla has joined #ruby
MalkbabY has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
maroloccio has quit [Quit: WeeChat 2.3]
gix- has quit [Ping timeout: 240 seconds]
ruurd has quit [Ping timeout: 260 seconds]
va5c0 has quit [Quit: WeeChat 3.1]
postmodern has quit [Quit: Leaving]
va5c0 has joined #ruby
cd has quit [Quit: cd]
va5c0 has quit [Quit: WeeChat 3.1]
va5c0 has joined #ruby
va5c0 has quit [Client Quit]
va5c0 has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
va5c0 has quit [Quit: WeeChat 3.1]
va5c0 has joined #ruby
explorier has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hiroaki has joined #ruby
explorier has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
va5c0 has quit [Quit: WeeChat 3.1]
va5c0 has joined #ruby
johnny56 has quit [Ping timeout: 268 seconds]
ur5us__ has joined #ruby
va5c0 has quit [Client Quit]
TCZ has joined #ruby
va5c0 has joined #ruby
TrufflePump has quit [Ping timeout: 258 seconds]
pyra has joined #ruby
va5c0 has quit [Ping timeout: 268 seconds]
johnny56 has joined #ruby
va5c0 has joined #ruby
centrx has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
TrufflePump has joined #ruby
pyra has quit [Ping timeout: 276 seconds]
Rudd0 has joined #ruby
centrx has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
Tempesta has quit [Quit: See ya!]
centrx has joined #ruby
konsolebox has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
jmcgnh has quit [Remote host closed the connection]
RubyBrad has joined #ruby
centrx has joined #ruby
fernando-basso has joined #ruby
centrx_ has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
centrx has joined #ruby
centrx_ has quit [Ping timeout: 250 seconds]
centrx has quit [Ping timeout: 250 seconds]
erpel has joined #ruby
jmcgnh has joined #ruby
evdubs_ has joined #ruby
evdubs__ has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
evdubs__ has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
evdubs_ has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
user1 has joined #ruby
jaminc has quit [Ping timeout: 248 seconds]
centrx has quit [Ping timeout: 250 seconds]
centrx has joined #ruby
StarOnD has joined #ruby
ur5us__ has quit [Ping timeout: 250 seconds]
Tempesta has joined #ruby
m27frogy has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
jla has quit [Ping timeout: 252 seconds]
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
va5c0 has quit [Ping timeout: 240 seconds]
nertzy__ has joined #ruby
va5c0 has joined #ruby
nertzy_ has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #ruby
TCZ is now known as figurine
jla has joined #ruby
StarOnD has quit [Ping timeout: 240 seconds]
jla has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
centrx has joined #ruby
centrx has quit [Ping timeout: 276 seconds]
stryek has joined #ruby
bamdad has quit [Ping timeout: 240 seconds]
bamdad has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
figurine has quit [Quit: ...]
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
BTRE has quit [Ping timeout: 240 seconds]
BTRE has joined #ruby
nemesit|znc_ has quit [Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in]
nemesit|znc has joined #ruby
centrx has joined #ruby
goepsilongo has joined #ruby
derpadmin has quit [Read error: Connection reset by peer]
jimms has joined #ruby
explorier has joined #ruby
va5c0 has quit [Quit: WeeChat 3.1]
cer-0 has joined #ruby
explorier has quit [Ping timeout: 265 seconds]
klaas has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
klaas has joined #ruby
cd has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
teclator has joined #ruby
<micah> I'm using a version of ruby that is >2.3.3, but I'm getting 'undefined method `grep_v'', and I'm not sure why :o
<jhass> what's the full message?
<micah> NoMethodError (undefined method `grep_v' for #<String:0x00007fb98d0cc8a0>):#012 app/models/concerns/user_username.rb:35:in `parse_list'#012 app/models/concerns/user_username.rb:41:in `username_allowed?'#012 app/models/concerns/user_username.rb:14:in `name_taken?'#012 app/models/user.rb:400:in `validate_username'#012 app/models/concerns/user_invites.rb:54:in `block in create_from_invite!'#012
<micah> app/models/concerns/user_invites.rb:47:in `create_from_invite!'#012 app/controllers/user_controller.rb:66:in `create'#012 app/controllers/application_controller.rb:79:in `log_request'
<micah> sorry for the long paste :o
<jhass> I only see Enumerable#grep_v, no String#grep_v
<micah> hmm, ok. i dont know how to make it Enumerable, i'll try to figure that out
<jhass> micah: what result do you expect from "foo bar baz".grep_v(/baz/) ?
JaredCE_ has joined #ruby
<micah> jhass: here is what I'm doing: https://paste.debian.net/1195661/
JaredCE has quit [Ping timeout: 260 seconds]
<jhass> maybe Conf.default_forbidden_names and Conf.custom_forbidden_names are unintentionally strings instead of arrays of string?
<micah> jhass: yeah, those files contain just strings, one on each line
<micah> can I convert them to arrays of strings?
<jhass> I wouldn't have recognized they're files :) I suspect when reading them you want to do File.readlines(whatever) instead of File.read(whatever)
<jhass> maybe taking a .map(&:chomp) at the end to get rid of the newline characters
jenrzzz has joined #ruby
cthulchu_ has joined #ruby
<micah> yeah, in my defaults.yml, i just am doing default_forbidden_names: file:common/config/default_forbidden_names
jenrzzz has quit [Ping timeout: 265 seconds]
<jhass> welp, TIL you can do that in YAML
<jhass> so if you already got the string you can use String#lines to split it into lines
coniptor has quit [Ping timeout: 276 seconds]
<micah> and then iterate that into an array? I'm not quite following
<micah> oh #lines makes it an array
<jhass> yeah
<micah> i wonder if I can just add .lines in there like Conf.default_forbidden_names.lines
<jhass> iirc .lines preserves the \n so you'd want to split that. If there's any way to do this at load time/inside your Conf abstraction I would prefer that personally
<jhass> *want to strip that
<micah> yeah, i'm not sure. i dont understand that part yet
coniptor has joined #ruby
centrx has quit [Ping timeout: 260 seconds]
explorier has joined #ruby
explorier has quit [Ping timeout: 265 seconds]
jla has joined #ruby
nofxx_ has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
explorier has joined #ruby
ChmEarl has joined #ruby
venmx has joined #ruby
robotbee has joined #ruby
howdoi has joined #ruby
JaredCE_ has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
arooni has joined #ruby
jenrzzz has joined #ruby
yuesbeez has joined #ruby
Dreamer3 has joined #ruby
mcr has quit [Quit: Leaving.]
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
BSaboia has joined #ruby
jla has quit [Ping timeout: 240 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
jenrzzz has quit [Ping timeout: 252 seconds]
nofxx__ has joined #ruby
arooni has quit [Ping timeout: 240 seconds]
nofxx_ has quit [Ping timeout: 260 seconds]
jla has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
Dreamer3 has quit [Quit: Leaving...]
jimms has quit [Quit: Leaving]
jenrzzz has joined #ruby
duderonomy has joined #ruby
istrasci has joined #ruby
goepsilongo has quit [Read error: Connection reset by peer]
goepsilongo has joined #ruby
fernando-basso has quit [Remote host closed the connection]
fernando-basso has joined #ruby
goepsilongo has quit [Quit: Konversation terminated!]
arooni has joined #ruby
robotbee has quit [Ping timeout: 246 seconds]
venmx has quit [Ping timeout: 252 seconds]
TrufflePump has quit [Ping timeout: 258 seconds]
robotbee has joined #ruby
jla has quit [Ping timeout: 240 seconds]
gix has joined #ruby
TrufflePump has joined #ruby
TorpedoSkyline has joined #ruby
evdubs__ is now known as evdubs
jenrzzz has quit [Ping timeout: 252 seconds]
jobewan has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
feriman has quit [Ping timeout: 260 seconds]
hiroaki has joined #ruby
coniptor has quit [Ping timeout: 260 seconds]
cer-0 has quit [Ping timeout: 260 seconds]
coniptor has joined #ruby
explorier has quit [Ping timeout: 240 seconds]
explorier has joined #ruby
MalkbabY has quit [Remote host closed the connection]
explorie1 has joined #ruby
MalkbabY has joined #ruby
venmx has joined #ruby
coniptor has quit [Ping timeout: 246 seconds]
venmx has quit [Ping timeout: 240 seconds]
coniptor has joined #ruby
erpel has quit [Quit: Textual IRC Client: www.textualapp.com]
pyra has joined #ruby
jla has joined #ruby
ur5us__ has joined #ruby
robotbee has quit [Ping timeout: 252 seconds]
evdubs has quit [Ping timeout: 240 seconds]
fernando-basso has quit [Quit: May the force]
evdubs has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 240 seconds]
cthu| has joined #ruby
pyra has quit [Ping timeout: 250 seconds]
cthulchu_ has quit [Ping timeout: 252 seconds]
bamdad has quit [Ping timeout: 240 seconds]
bamdad has joined #ruby
evdubs has joined #ruby
evdubs_ has quit [Ping timeout: 240 seconds]
evdubs has quit [Ping timeout: 240 seconds]
evdubs has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
jla has quit [Remote host closed the connection]
centrx has joined #ruby
cthulchu_ has joined #ruby
cthu| has quit [Ping timeout: 252 seconds]
elcuervo has quit [Read error: Connection reset by peer]
venmx has joined #ruby
RubyBrad has quit [Quit: Leaving]
cthulchu_ has quit [Ping timeout: 240 seconds]
elcuervo has joined #ruby
venmx has quit [Ping timeout: 265 seconds]
DTZUZU has quit [Read error: Connection reset by peer]
stryek has quit [Quit: Connection closed for inactivity]
Rounin has quit [Ping timeout: 265 seconds]
DTZUZU has joined #ruby
ur5us_ has joined #ruby
ur5us__ has quit [Remote host closed the connection]
robotbee has joined #ruby
gearnode has quit [Ping timeout: 276 seconds]
gearnode has joined #ruby