baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.4.6: 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!
fphilipe has joined #ruby
Swyper has quit [Remote host closed the connection]
tf2ftw has joined #ruby
skryking has quit [Ping timeout: 246 seconds]
skryking has joined #ruby
wolfgangzim has quit [Quit: Page closed]
DarthGandalf has joined #ruby
houhoulis has quit [Ping timeout: 272 seconds]
cthulchu_ has quit [Ping timeout: 258 seconds]
octos has quit [Read error: Connection reset by peer]
CodeHex has joined #ruby
octos has joined #ruby
fphilipe has quit [Ping timeout: 258 seconds]
i1nfusion has quit [Remote host closed the connection]
i1nfusion has joined #ruby
jenrzzz_ has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 244 seconds]
kent\n has quit [Remote host closed the connection]
fphilipe has joined #ruby
kent\n has joined #ruby
gix has quit [Ping timeout: 258 seconds]
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
Swyper has quit [Remote host closed the connection]
tf2ftw has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 258 seconds]
Xeago_ is now known as Xeago
bambanx has joined #ruby
CodeHex has quit [Read error: Connection reset by peer]
tdy has joined #ruby
fphilipe has quit [Ping timeout: 252 seconds]
i1nfusion has quit [Remote host closed the connection]
i1nfusion has joined #ruby
wildermind has quit [Quit: Connection closed for inactivity]
Xeago has quit [Read error: Connection timed out]
Xeago has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
adam12_ is now known as adam12
adam12 is now known as Guest58060
Guest58060 is now known as adam12
houhoulis has joined #ruby
i1nfusion has quit [Remote host closed the connection]
i1nfusion has joined #ruby
tf2ftw has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
duderonomy has joined #ruby
houhouli_ has joined #ruby
houhoulis has quit [Ping timeout: 258 seconds]
Wolland has joined #ruby
Wolland has quit [Client Quit]
houhoulis has joined #ruby
houhoul__ has joined #ruby
haxx0r has joined #ruby
houhouli_ has quit [Ping timeout: 248 seconds]
houhouli_ has joined #ruby
houhoulis has quit [Ping timeout: 248 seconds]
houhoulis has joined #ruby
houhoul__ has quit [Ping timeout: 259 seconds]
gr33n7007h has quit [Ping timeout: 246 seconds]
houhouli_ has quit [Ping timeout: 246 seconds]
gr33n7007h has joined #ruby
fphilipe has joined #ruby
brool has quit [Ping timeout: 252 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
esp32_prog has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
violentE has joined #ruby
gr33n7007h has quit [Ping timeout: 246 seconds]
esp32_prog has quit [Ping timeout: 272 seconds]
gr33n7007h has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
gregf_ has quit [Ping timeout: 256 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
braincrash has quit [Quit: bye bye]
jenrzzz has joined #ruby
fphilipe has quit [Ping timeout: 258 seconds]
braincrash has joined #ruby
tf2ftw has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
mosh has quit [Ping timeout: 252 seconds]
Swyper has quit [Remote host closed the connection]
doodleb64 has quit [Read error: Connection reset by peer]
houhoulis has quit [Remote host closed the connection]
doodlebug has joined #ruby
yield has joined #ruby
DarthGandalf has quit [Ping timeout: 272 seconds]
houhoulis has joined #ruby
DarthGandalf has joined #ruby
kyrylo has joined #ruby
houhoulis has quit [Remote host closed the connection]
dar123 has joined #ruby
dar123 has quit [Client Quit]
dar123 has joined #ruby
cd has quit [Quit: cd]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Wolland has joined #ruby
fphilipe has joined #ruby
dar123 has joined #ruby
SeepingN has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Wolland has quit [Quit: Mutter: www.mutterirc.com]
regedit_ has joined #ruby
renich has quit [Remote host closed the connection]
regedit_ is now known as regedit
esp32_prog has joined #ruby
violentE has quit [Quit: Leaving]
podlech has joined #ruby
esp32_prog has quit [Ping timeout: 258 seconds]
kapilp has joined #ruby
blackmesa1 has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marmotini_ has joined #ruby
blackmesa1 has quit [Ping timeout: 259 seconds]
ShalokShalom has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
podlech has quit [Quit: WeeChat 2.5-dev]
sauvin has joined #ruby
fphilipe has joined #ruby
Wolland has joined #ruby
conta has joined #ruby
sariyar has quit [Ping timeout: 252 seconds]
blackmesa1 has joined #ruby
WA9ACE has quit [Ping timeout: 252 seconds]
Liothen has quit [Ping timeout: 252 seconds]
Iambchop has quit [Ping timeout: 252 seconds]
meinside has quit [Ping timeout: 250 seconds]
nuck has quit [Ping timeout: 252 seconds]
Fenhl has quit [Ping timeout: 276 seconds]
Chew has quit [Read error: Connection reset by peer]
jnix has quit [Ping timeout: 252 seconds]
Wolland has quit [Quit: Mutter: www.mutterirc.com]
stooj has quit [Ping timeout: 246 seconds]
WA9ACE has joined #ruby
jnix has joined #ruby
meinside has joined #ruby
nuck has joined #ruby
Fenhl has joined #ruby
Liothen has joined #ruby
sariyar has joined #ruby
Iambchop has joined #ruby
Chew has joined #ruby
stooj has joined #ruby
schneider has joined #ruby
nowhere_man has joined #ruby
nowhereman has quit [Ping timeout: 245 seconds]
aupadhye has joined #ruby
aupadhye has quit [Ping timeout: 248 seconds]
conta has quit [Ping timeout: 272 seconds]
yield has quit [Remote host closed the connection]
imadper is now known as WhatsGoingOn
yield has joined #ruby
conta has joined #ruby
aupadhye has joined #ruby
jefffrails35 has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
esp32_prog has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
andikr has joined #ruby
esp32_prog has quit [Ping timeout: 246 seconds]
slackmare has joined #ruby
schneider has quit [Ping timeout: 258 seconds]
ellcs has joined #ruby
jenrzzz has joined #ruby
marmotini has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
nowhere_man has quit [Ping timeout: 257 seconds]
marmotini_ has quit [Ping timeout: 258 seconds]
TomyWork has joined #ruby
ellcs has quit [Ping timeout: 252 seconds]
kapilp has quit [Quit: Connection closed for inactivity]
nowhere_man has joined #ruby
blackmesa1 has quit [Ping timeout: 248 seconds]
lxsameer has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
andikr has quit [Ping timeout: 248 seconds]
andikr has joined #ruby
reber has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
blackmesa1 has joined #ruby
Dbugger has joined #ruby
Dbugger has quit [Remote host closed the connection]
alem0lars has joined #ruby
laaron has quit [Remote host closed the connection]
schne1der has joined #ruby
laaron has joined #ruby
deepreds1 has joined #ruby
fphilipe has joined #ruby
Fusl has quit [Excess Flood]
teclator has joined #ruby
Fusl has joined #ruby
alem0lars has quit [Remote host closed the connection]
buckworst has joined #ruby
alem0lars has joined #ruby
alem0lars has quit [Remote host closed the connection]
galaxie has quit [Remote host closed the connection]
galaxie has joined #ruby
mikecmpbll has joined #ruby
andikr has quit [Quit: No Ping reply in 180 seconds.]
andikr has joined #ruby
esp32_prog has joined #ruby
kapilp has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ovnimancer has joined #ruby
DTZUZO_ has quit [Ping timeout: 268 seconds]
weird_error has joined #ruby
buckworst has quit [Quit: Leaving]
teclator has quit [Ping timeout: 258 seconds]
ovnimancer has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
DarthGandalf has quit [Ping timeout: 244 seconds]
teclator has joined #ruby
teclator has quit [Ping timeout: 248 seconds]
teclator has joined #ruby
miskatonic has joined #ruby
ellcs has joined #ruby
tdy has quit [Ping timeout: 272 seconds]
xco has joined #ruby
jenrzzz has joined #ruby
DarthGandalf has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
Nicmavr has quit [Ping timeout: 245 seconds]
Kestrel-029 has joined #ruby
kyrylo_ has joined #ruby
kyrylo has quit [Ping timeout: 272 seconds]
dhollinger has quit [Ping timeout: 258 seconds]
Jonopoly has joined #ruby
andikr has quit [Ping timeout: 272 seconds]
DTZUZO_ has joined #ruby
andikr has joined #ruby
_axx8 has joined #ruby
TheBrayn has quit [Ping timeout: 252 seconds]
_axx has quit [Ping timeout: 252 seconds]
towo has quit [Ping timeout: 252 seconds]
towo has joined #ruby
DTZUZO_ has quit [Ping timeout: 245 seconds]
TheBrayn has joined #ruby
DTZUZO_ has joined #ruby
blackmesa1 has quit [Ping timeout: 248 seconds]
_axx8 is now known as _axx
kyrylo has joined #ruby
dhollinger has joined #ruby
kyrylo_ has quit [Ping timeout: 245 seconds]
weird_error has quit [Quit: weird_error]
bambanx has quit [Quit: Leaving]
tdy has joined #ruby
<marz_d`ghostman> How do I remove characters like "\xe2\x80\x8b" in strings?
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
mosh has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
andikr has quit [Ping timeout: 258 seconds]
arup_r has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron- has joined #ruby
blackmesa1 has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has joined #ruby
arup_r has quit []
kyrylo has quit [Client Quit]
al2o3-cr has joined #ruby
RedSnarf has joined #ruby
al2o3-cr has quit [Read error: Connection reset by peer]
<marz_d`ghostman> '@gmail.com<U+200B>'.encode(Encoding.find('ASCII'), {:invalid => :replace, :replace => ''}) doesn't seem to remove the <U+200B> unicode, how do I remove it?
dar123 has joined #ruby
salerace has joined #ruby
_whitelogger has joined #ruby
DarthGandalf has quit [Ping timeout: 252 seconds]
mikecmpb_ has joined #ruby
marmotini has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Ping timeout: 258 seconds]
lunarkitty7 has quit [Ping timeout: 252 seconds]
lunarkitty7 has joined #ruby
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
haxx0r has quit [Ping timeout: 248 seconds]
regedit has quit [Quit: Connection closed for inactivity]
mikecmpb_ has quit [Read error: Connection reset by peer]
andikr has joined #ruby
mikecmpbll has joined #ruby
apparition has joined #ruby
haxx0r has joined #ruby
AJA4350 has quit [Remote host closed the connection]
DarthGandalf has joined #ruby
marmotini_ has joined #ruby
AJA4350 has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
<Jonopoly> anyone used Ruby & Selenium ?
<Jonopoly> $wait.until { $driver.find_element(:xpath => "//li[div[div[contains(text(), '"+waitFor+"')]]]") }
<Jonopoly> instead of addings sleep(1) on a new line is there another way to wait with try?
<Jonopoly> Try get this, wait 1 second and attempt 3 times or something
noboruma has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
gregf_ has joined #ruby
vondruch_ has joined #ruby
DarthGandalf has quit [Ping timeout: 258 seconds]
vondruch has quit [Ping timeout: 246 seconds]
zapata has quit [Quit: WeeChat 2.4]
vondruch_ is now known as vondruch
blackmesa1 has quit [Ping timeout: 244 seconds]
tf2ftw has joined #ruby
blackmesa1 has joined #ruby
tdy has joined #ruby
GodFather has joined #ruby
za1b1tsu has joined #ruby
ricekrispie2 has joined #ruby
ricekrispie has quit [Ping timeout: 244 seconds]
blackmesa1 has quit [Ping timeout: 257 seconds]
AJA4350 has quit [Ping timeout: 272 seconds]
DarthGandalf has joined #ruby
AJA4350 has joined #ruby
blackmesa1 has joined #ruby
DarthGandalf has quit [Ping timeout: 258 seconds]
tdy has quit [Ping timeout: 248 seconds]
kyrylo has joined #ruby
haxx0r has quit [Remote host closed the connection]
jenrzzz has joined #ruby
nowhere_man has joined #ruby
yield has quit [Remote host closed the connection]
yield has joined #ruby
yield has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 248 seconds]
yield has joined #ruby
yield has quit [Remote host closed the connection]
conta has quit [Ping timeout: 248 seconds]
yield has joined #ruby
yield has quit [Remote host closed the connection]
yield has joined #ruby
yield has quit [Remote host closed the connection]
blackmesa1 has quit [Ping timeout: 250 seconds]
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
conta has joined #ruby
clemens3 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
Nicmavr has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
tf2ftw has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
doodlebug has quit [Read error: Connection reset by peer]
sleetdrop has joined #ruby
doodlebug has joined #ruby
marmotini_ has quit [Quit: Leaving]
queip has quit [Ping timeout: 246 seconds]
doodlebug has quit [Read error: Connection reset by peer]
doodleb76 has joined #ruby
doodleb76 has quit [Read error: Connection reset by peer]
al2o3-cr has joined #ruby
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
AJA4350 has quit [Ping timeout: 248 seconds]
andikr has quit [Remote host closed the connection]
doodleb56 has joined #ruby
queip has joined #ruby
queip has quit [Read error: Connection reset by peer]
sleetdrop has quit [Quit: Textual IRC Client: www.textualapp.com]
yield has joined #ruby
Nicmavr has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
Swyper has quit [Remote host closed the connection]
octos has quit [Remote host closed the connection]
octos has joined #ruby
yield has quit [Ping timeout: 248 seconds]
yield has joined #ruby
aupadhye has quit [Quit: Leaving]
octos has quit [Ping timeout: 245 seconds]
aupadhye has joined #ruby
Swyper has joined #ruby
nowhere_man has quit [Ping timeout: 268 seconds]
octos has joined #ruby
AJA4350 has joined #ruby
SeepingN has joined #ruby
Swyper has quit [Remote host closed the connection]
nowhere_man has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
queip has joined #ruby
apparition has quit [Ping timeout: 272 seconds]
cd has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.4]
al2o3-cr has joined #ruby
conta has quit [Ping timeout: 248 seconds]
schne1der has quit [Ping timeout: 248 seconds]
hightower2 has joined #ruby
WolfgangGrobar has joined #ruby
sylario has joined #ruby
aupadhye has quit [Quit: Leaving]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
jenrzzz has joined #ruby
ryouba has joined #ruby
<ryouba> hi!
<ryouba> is there anything that will do regex=/blah/;yes_or_no=str.match(regex);str.gsub!(regex) in one go?
<ryouba> sorry; `regex=/blah/;yes_or_no=str.match(regex);str.gsub!(regex, '')`
<havenwood> ryouba: with modern Rubies, it's faster and a bit less overhead to: yes_or_no=str.match?(regex)
jenrzzz has quit [Ping timeout: 258 seconds]
<ryouba> havenwood: but that will still not remove the match from the string, right?
<havenwood> ryouba: true, it wont
<ryouba> okay, since you didn't mention anything about that, i guess i'll monkeypatch #match_and_gsub into String
AJA4350 has quit [Ping timeout: 246 seconds]
<bougyman> why do you need that?
<bougyman> why not just str.gsub!(regex)
<bougyman> if the regex doesn't match, that'll just be a noop
<ryouba> bougyman: but does it tell me whether or not it matched?
brool has joined #ruby
<ryouba> oh, hmm, i guess it kind of does
<bougyman> [1] pry(main)> str = 'foo'; str.gsub! /a/, ''; $~
<bougyman> => nil
<bougyman> [2] pry(main)> str = 'foo'; str.gsub! /f/, ''; $~
<bougyman> => #<MatchData "f">
<bougyman> damn what's with all the spacing?
<bougyman> But yes, yes it does.
Rapture has joined #ruby
<bougyman> also: don't use $~ for anything real.
<ryouba> I didn't even know it existed :-P
ua_ has quit [Quit: Leaving]
<ryouba> btw i've started calling arrays of regular expression "regosaurs". as in: `regosaurs = [/one/, /two/, /.../]`. makes coding much more fun.
schne1der has joined #ruby
<WolfgangGrobar> What is more widely used in the ruby community: Test::Unit or Minitest (please ignore rspec)? Also what is usually used for mocking? Is the mocking stuff in minitest enough?
AJA4350 has joined #ruby
ua has joined #ruby
<havenwood> WolfgangGrobar: Minitest
kapilp has quit [Quit: Connection closed for inactivity]
spacesuitdiver has joined #ruby
DarthGandalf has joined #ruby
<Jonopoly> Anyone used Ruby & Selenium for testing?
<havenwood> Jonopoly: Yes, that's popular.
<xco> Jonopoly: Yes :P
<WolfgangGrobar> Thank you, havenwood.
<xco> WolfgangGrobar: as far as i know Test::Unit is quite out-dated. These days it’ only Minitest you’d see around
<WolfgangGrobar> xco: good, then I'll use that
<Jonopoly> havenwood: xco: OH is it? I'm learning it now and its pretty fun
conta has joined #ruby
AJA4350 has quit [Remote host closed the connection]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cliluw has quit [Ping timeout: 248 seconds]
cliluw has joined #ruby
slackmare has quit [Ping timeout: 258 seconds]
spacesuitdiver has joined #ruby
teclator has quit [Ping timeout: 272 seconds]
spacesuitdiver has quit [Client Quit]
cthulchu_ has joined #ruby
zapata has joined #ruby
doodlebug has joined #ruby
doodlebug has quit [Max SendQ exceeded]
Nicmavr has quit [Ping timeout: 245 seconds]
TheBrayn has quit [Ping timeout: 252 seconds]
doodlebug has joined #ruby
Nicmavr has joined #ruby
doodleb56 has quit [Ping timeout: 258 seconds]
TheBrayn has joined #ruby
teclator has joined #ruby
RedSnarf has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
jeremycw has joined #ruby
kaleido_ is now known as kaleido
WolfgangGrobar has quit [Ping timeout: 256 seconds]
galeido has quit [Ping timeout: 246 seconds]
teclator has quit [Ping timeout: 246 seconds]
nowhereman has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
WolfgangGrobar has joined #ruby
code_zombie has joined #ruby
blackmesa1 has joined #ruby
<WolfgangGrobar> What is the idiomatic ruby way to do the equivalent of dependency injection? I ask because of this Yegge quote: "Dependency Injection is [...] a popular new Java design pattern that programmers using Ruby [...] have probably never heard of. And if they've heard of it, they've probably (correctly) concluded that they don't need it."
i1nfusion has quit [Remote host closed the connection]
rippa has joined #ruby
<phaul> not sure about being idiomatic there. it's debatable.
<WolfgangGrobar> This looks like standard constructor dependency injection with default params. What am I missing?
<adam12> WolfgangGrobar: There's a bunch of ways to "dependency inject" in Ruby. The constructor with default params is just one method. I don't think any specific way is "idiomatic".
<WolfgangGrobar> I understood the quote to mean that it would be done somehow different in ruby.
<adam12> WolfgangGrobar: Oh. I think people expect more than what is required.
nowhereman has quit [Ping timeout: 245 seconds]
<adam12> WolfgangGrobar: The simplest solution is indeed accessors and perhaps params to the constructor. At the opposite end of the scale is something like dry-auto_inject which is paired with some sort of IoC container.
doodlebug has quit [Read error: Connection reset by peer]
doodlebug has joined #ruby
<WolfgangGrobar> I see, so it seems not really different.
doodleb87 has joined #ruby
nowhereman has joined #ruby
doodlebug has quit [Ping timeout: 272 seconds]
Jonopoly has quit [Quit: WeeChat 2.4]
blackmesa1 has quit [Ping timeout: 252 seconds]
esp32_prog has quit [Ping timeout: 272 seconds]
graphene has joined #ruby
graphene has quit [Remote host closed the connection]
nowhere_man has joined #ruby
nowhereman has quit [Ping timeout: 248 seconds]
vondruch has quit [Quit: vondruch]
APK is now known as AKPWD
conta has quit [Quit: conta]
ellcs has quit [Ping timeout: 252 seconds]
tdy has joined #ruby
edwardly has quit [Ping timeout: 244 seconds]
AJA4350 has joined #ruby
nowhere_man has quit [Ping timeout: 257 seconds]
conta has joined #ruby
doodleb87 has quit [Read error: Connection reset by peer]
sgen has joined #ruby
doodlebug has joined #ruby
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
brool has quit [Ping timeout: 257 seconds]
jenrzzz has joined #ruby
esp32_prog has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
conta has quit [Quit: conta]
esp32_prog has quit [Ping timeout: 246 seconds]
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
code_zombie_ has joined #ruby
yield has quit []
sameerynho has joined #ruby
code_zombie has quit [Ping timeout: 252 seconds]
al2o3-cr has quit [Quit: WeeChat 2.4]
rprimus has quit [Ping timeout: 244 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
rprimus has joined #ruby
hmaronon has joined #ruby
fphilipe has quit [Ping timeout: 268 seconds]
brool has joined #ruby
duderonomy has joined #ruby
nowhere_man has joined #ruby
laaron- has joined #ruby
laaron has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 246 seconds]
sgen has quit [Ping timeout: 252 seconds]
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
conta has joined #ruby
wildermind has joined #ruby
blackmesa has joined #ruby
al2o3-cr has joined #ruby
hiroaki has quit [Ping timeout: 246 seconds]
brool has quit [Ping timeout: 252 seconds]
hmaronon has quit [Quit: The Lounge - https://thelounge.chat]
blackmesa has quit [Ping timeout: 264 seconds]
za1b1tsu has quit [Remote host closed the connection]
<jeremycw> I think a lot of the cases to use DI go away when using ruby in many circumstances.
clemens3 has quit [Ping timeout: 246 seconds]
WolfgangGrobar has quit [Ping timeout: 256 seconds]
<jeremycw> In java you can't test anything without DI everywhere.
<jeremycw> Since ruby is way more dynamic if your only reason for DI is so you can swap in a mock or something during tests you don't really need it.
fphilipe has joined #ruby
conta has quit [Ping timeout: 272 seconds]
hiroaki has joined #ruby
skryking has quit [Quit: WeeChat 2.2]
<jeremycw> instead you can just stub methods or use other dynamic features to accomplish the same thing.
Kestrel-029 has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
ravenous_ has joined #ruby
gix has joined #ruby
ravenous_ has quit [Client Quit]
ravenous_ has joined #ruby
doodleb97 has joined #ruby
polishdub has joined #ruby
dellavg_ has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
doodlebug has quit [Ping timeout: 258 seconds]
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
blackmesa has joined #ruby
esp32_prog has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
esp32_prog has quit [Ping timeout: 248 seconds]
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
mikecmpbll has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
ta has quit [Quit: WeeChat 2.4]
ta has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ShalokShalom43 has joined #ruby
salerace has quit [Quit: salerace]
jenrzzz has joined #ruby
sauvin has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
ShalokShalom43 has quit [Remote host closed the connection]
ShalokShalom has quit [Remote host closed the connection]
ShalokShalom has joined #ruby
ellcs has joined #ruby
Nicmavr has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
mad_al has quit [Ping timeout: 258 seconds]
DTZUZO_ is now known as DTZUZU
ravenous_ has joined #ruby
mad_al_ has joined #ruby
Kilo`byte has joined #ruby
houhoulis has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
octos has quit [Remote host closed the connection]
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
wildermind has quit [Quit: Connection closed for inactivity]
houhouli_ has joined #ruby
Inline has quit [Ping timeout: 264 seconds]
houhoulis has quit [Ping timeout: 258 seconds]
reaVer has quit [Remote host closed the connection]
Inline has joined #ruby
mad_al_ has quit [Read error: Connection reset by peer]
mad_al has joined #ruby
reaVer has joined #ruby
fredolinhares has joined #ruby
gix has quit [Quit: Client exiting]
esp32_prog has joined #ruby
doodleb97 has quit [Read error: Connection reset by peer]
doodlebug has joined #ruby
stryek has joined #ruby
spiette_ has quit [Quit: ZNC 1.7.3 - https://znc.in]
esp32_prog has quit [Ping timeout: 272 seconds]
spiette has joined #ruby
happyhans has joined #ruby
fphilipe has quit [Ping timeout: 252 seconds]
brool has joined #ruby
gix has joined #ruby
happyhans has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
varesa_ is now known as varesa
fphilipe has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
AJA4350 has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
octos has joined #ruby
Swyper_ has joined #ruby
Swyper has quit [Read error: Connection reset by peer]
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has joined #ruby
jenrzzz has joined #ruby
AJA4350 has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
octos has quit [Remote host closed the connection]
octos has joined #ruby
fphilipe has joined #ruby
jeremycw has quit [Ping timeout: 246 seconds]
jeremycw has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
dellavg_ has quit [Ping timeout: 272 seconds]
nevada1 has joined #ruby
<nevada1> Is there a more elegant way to split a number into groups of 3 digits? number.to_s.reverse.scan(/\d{1,3}/).map(&:reverse).map(&:to_i)
<nevada1> (and then getting the integer out of each group)
octos has quit [Ping timeout: 258 seconds]
Tempesta has quit [Quit: See ya!]
<mikecmpbll> nevada1 : what's all the reversing about?
jenrzzz has joined #ruby
<mikecmpbll> ah, so the incomplete group is always at the front?
<nevada1> e.g. 1_326_767 => '7676231' => ['767', '623', '1'] => (now comes reversing each one, because 623 should be 326) => ['767', '326', '1'] => [767, 326, 1]
luminousnine has quit [Quit: Goodbye ~ Powered by LunarBNC]
xfbs has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
<nevada1> It's basically 767 for hundreds, 326 for thousands, 1 for millions.
<nevada1> mikecmpbll: Hope I was clear enough.
<mikecmpbll> i see, yeah.
<mikecmpbll> there is a way without dealing with strings but i'm doubtful it'll be more elegant.
Exuma has joined #ruby
code_zombie_ has quit [Quit: Leaving]
luminousnine has joined #ruby
luminousnine has quit [Changing host]
luminousnine has joined #ruby
reber has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 248 seconds]
<nevada1> Ah, I see.
jenrzzz has joined #ruby
xfbs has joined #ruby
octos has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
octos has quit [Remote host closed the connection]
octos has joined #ruby
schne1der has quit [Ping timeout: 246 seconds]
hiroaki has quit [Ping timeout: 248 seconds]
fphilipe has quit [Ping timeout: 252 seconds]
octos has quit [Remote host closed the connection]
gix has quit [Ping timeout: 258 seconds]
octos has joined #ruby
SeepingN has joined #ruby
fphilipe has joined #ruby
octos has quit [Ping timeout: 246 seconds]
esp32_prog has joined #ruby
gix has joined #ruby
sameerynho has quit [Ping timeout: 246 seconds]
esp32_prog has quit [Ping timeout: 272 seconds]
Tempesta has joined #ruby
jenrzzz has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.4]
ellcs has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
<havenwood> &>> 1326767.digits.each_slice(3).map(&:join).join('_').reverse # nevada1
mad_al has quit [Quit: Textual IRC Client: www.textualapp.com]
<rubydoc> # => "1_326_767" (https://carc.in/#/r/6ykv)
<mikecmpbll> never knew digits :>
octos has joined #ruby
AJA4351 has joined #ruby
jenrzzz has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
<nevada1> havenwood: Thanks, never knew digits gave them in reverse order.
<nevada1> That's helpful.
<mikecmpbll> should be poss with a regexp but i'm useless at it.
jenrzzz has quit [Ping timeout: 245 seconds]
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> &>> 1326767.to_s.reverse.gsub(/(.{1,3})(?!$)/, '\1_').reverse # mikecmpbll
<rubydoc> # => "1_326_767" (https://carc.in/#/r/6ykx)
jenrzzz has joined #ruby
mad_al has joined #ruby
Fernando-Basso has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
<nevada1> I actually only needed to end up with [767, 326, 1]
<nevada1> &>> 1326767.digits.each_slice(3).map(&:join).map(&:reverse).map(&:to_i)
<rubydoc> # => [767, 326, 1] (https://carc.in/#/r/6yl3)
fphilipe has quit [Ping timeout: 252 seconds]
<havenwood> nevada1: 1326767.digits.each_slice(3).map { |a| a.join.reverse.to_i }
<nevada1> Even better.
laaron has quit [Remote host closed the connection]
<nevada1> It would be cool if Ruby allowed something like map(&:join, &:reverse, &:to_i)
laaron has joined #ruby
<nevada1> But the block version is great.
fphilipe has joined #ruby
<mikecmpbll> how about ...
<mikecmpbll> do you need them in that reverse order, or?
<nevada1> I do, yes.
<mikecmpbll> &>> num = 1326767; (0...num.to_s.size).step(3).map{ |i| (num/10**i) % 1000 }
<rubydoc> # => [767, 326, 1] (https://carc.in/#/r/6yl6)
<mikecmpbll> that's my fav :p
xco has quit [Quit: xco]
<havenwood> &>> 1326767.digits.each_slice(3).map { |a, b = 0, c = 0| a + b * 10 + c * 100 }
<rubydoc> # => [767, 326, 1] (https://carc.in/#/r/6yl7)
<nevada1> If this isn't TIMTOWTDI at its finest, I don't know what is.
fphilipe_ has joined #ruby
fphilipe has quit [Ping timeout: 259 seconds]
<nevada1> havenwood: I think this last version may be the most efficient since it's just adding and multiplying for each slice.
<mikecmpbll> b-b-bu ...
<nevada1> Actually, I don't know how Ruby does things in the backstage. map { |a| a.join.reverse.to_i} might be just as fast for all I know.
<havenwood> &>> 1326767.then { |n| 0.step(by: 3, to: Math.log10(n.abs).floor.succ).map { |i| n / 10 ** i % 1000 } }
<rubydoc> # => [767, 326, 1] (https://carc.in/#/r/6yl8)
<havenwood> nevada1: Math is fast.
jeremycw has quit [Ping timeout: 245 seconds]
<nevada1> Dear lord, the last one seems like an overkill.
<havenwood> Yeah, just being silly. ;)
<havenwood> Mathy!
fphilipe_ has quit [Ping timeout: 252 seconds]
<nevada1> In the end, I think this is the most readable. 1326767.digits.each_slice(3).map { |a| a.join.reverse.to_i }
houhouli_ has quit [Remote host closed the connection]
<havenwood> nevada1: And the mathy `a + b * 10 + c * 100` one is fastest.
<havenwood> nevada1: It's super fast either way, so more readable might be nicer than 3x faster.
<nevada1> Thanks, man.
<nevada1> I am in such a love and hate relationship right now with Ruby.
<havenwood> Embrace the love.
<nevada1> You can do a lot if you know the right one-liners, or you can suffer terribly if you don't.
<leitz> nevada1, it took me a while to get over some frustrations but Ruby is my favorite language by far.
<leitz> First one I ever wanted to read the reference manual for.
rocx has joined #ruby
<nevada1> For a guy (me) who came from a background of verbose languages like Java or C#, Ruby's "less is more" style was a real struggle.
<havenwood> There's an ISO spec now to read! https://www.ipa.go.jp/files/000011432.pdf
<mikecmpbll> |a, b = 0, c = 0|: 440984.8 i/s - 1.48x slower >> in ruby 2.5.1
<mikecmpbll> /shrug
<mikecmpbll> (than step(3).map)
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<havenwood> mikecmpbll: I was checking on the nightly build, hmmmm. I'm curious now.
<leitz> nevada1, I come from shell, with some python, perl, C, Go, PHP. When I tell people what's "the best language" I suggest they try several in whatever domain they want to program in. Ruby is the most joy for me.
laaron has joined #ruby
<rocx> nevada1: ruby has the advantage of being quicker and in a sense more pure when it comes to objects.
<leitz> havenwood, how relevant is that spec? It's 10 years old.
<leitz> I remember getting yelled at for using old Ruby. :)
<havenwood> leitz: It's mostly relevant, but yeah, it doesn't cover anything recent.
<leitz> Then I got yelled at for using new Ruby...
<nevada1> I mainly faced issues with Rubocop telling me how to do things. < 10 lines per method, too many assignments, blah-blah. I needed to adapt my way of thinking.
<leitz> nevada1, I quit using Rubocop. It's not a bad idea, but it's not the law.
<havenwood> mikecmpbll: I can reproduce your results... Intriguing!
<havenwood> mikecmpbll: It looks like it changes between 2.5 and 2.6.
<mikecmpbll> odd!
<mikecmpbll> all benched on 2.5.1 here anyways; https://gist.github.com/mikecmpbll/a1523af6b84d2cf1553b6b89050740df
<mikecmpbll> most readable is slowest ;))
<mikecmpbll> i'm sure that speed is critical to your application!
<havenwood> mikecmpbll: step(3) is faster on 2.4 & 2.5 but b = 0, c = 0 is faster on 2.6 and dev. I guess 2.6 optimizations are paying off.
doodleb45 has joined #ruby
<mikecmpbll> question is, is b = 0, c = 0 on 2.6 faster than step(3) on 2.5 ?
<havenwood> yup!
<mikecmpbll> a-ha ;)
<havenwood> err
<havenwood> actually...
<havenwood> hah, no!
<mikecmpbll> 😂
<havenwood> mikecmpbll: ah, I betcha that it's Enumerator Instruction Sequence...
<havenwood> yeah, that's gotta be it
doodlebug has quit [Ping timeout: 272 seconds]
<havenwood> that adds a penalty that's noticeable in this tight loop
<nevada1> In case you are curious why I needed such a silly thing in the first place. https://dpaste.de/z25P
<nevada1> I was working on that.
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
<nevada1> It's now a (somewhat) decent number wordifier.
mochiyoda_ has joined #ruby
polishdub has quit [Quit: leaving]
xco has joined #ruby
mochiyoda has quit [Ping timeout: 248 seconds]
<nevada1> I'm open to any suggestions if you see something that hurts your eyes.
<leitz> nevada1, smarter people than me have said you must code to get better at coding. Finding a language you enjoy coding in helps motivate that process.
skryking has joined #ruby
<nevada1> leitz: That sounds like a reasonable statement.
Xiti has quit [Quit: Xiti]
<leitz> I have been in Perl for a few months. Powerful language, makes me feel as worn out as Frodo and Sam crossing the wastes before going to Mordor. A day back with Ruby and I'm enjoying code again.
mikecmpbll has quit [Quit: inabit. zz.]
fphilipe_ has joined #ruby
<nevada1> I was more or less forced to learn Ruby because of my job.
<nevada1> Still in a love and hate relationship with it.
<rocx> nevada1: if you think ruby's pretty good, wait until you try crystal.
<rocx> then you'll know the true meaning of a love-hate relationship. ;p
<nevada1> rocx: I did try it, actually.
<rocx> heh.
<nevada1> I have only good things to say about it so far.
<rocx> makes me miss method overloading to be honest.
<leitz> Yeah, a job requirement can cause issues.
<nevada1> Specifying types is something I would love to be able to do in Ruby sometimes.
<nevada1> As in having that in the core language, not using some gem.
Xiti has joined #ruby
<rocx> hence the overloading. change how a method works based on type.
jenrzzz has quit [Ping timeout: 268 seconds]
esp32_prog has joined #ruby
<leitz> There's some good to be said for Go. Not a bad language, typed, and the object system is much simpler.
Nicmavr has quit [Ping timeout: 245 seconds]
Kestrel-029 has joined #ruby
doodleb45 has quit [Read error: Connection reset by peer]
<nevada1> I like it because it's pretty C-like. Anything that resembles C is enjoyable for me.
weird_error has joined #ruby
<leitz> Yup. I'm glad your brain rejoices in C. Mine just barely gets it.
<nevada1> It's the first language I learned.
doodlebug has joined #ruby
<leitz> Wow. You're smarter than me then. I started on Pascal.
esp32_prog has quit [Ping timeout: 272 seconds]
<nevada1> If smarter means needing to learn it for Computer Science, then yeah, haha.
<nevada1> But along the way came Ruby and it shattered everything.
gr33n7007h is now known as al2o3-cr
<leitz> I was an electronics guy but needed some computer credits. Pascal, C, and Netware 3.
<nevada1> Another thing I kinda dislike about Ruby is that function calls can lack ( ).
<leitz> I've been an apprentice in a few languages but found Ruby and really started to understand more about OOP, testing, etc.
weird_error has quit [Quit: weird_error]
<leitz> "Whereever you go, there you are." I'd suggest leaving other language idioms with the other languages, it just makes your joy less.
<nevada1> Before diving into it, I thought it's only used with Rails and that's about it.
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
stryek has quit [Quit: Connection closed for inactivity]
<nevada1> But maybe there's some truth in that. Before Rails, I don't think too many people knew about Ruby outside of Japan.
<nevada1> Or so I've heard.
<leitz> Sadly, that's most of the Ruby market. There are other web options and most anything you can do with Python or Perl you can do with Ruby. You can drop directly into C as needed.
<rocx> nevada1: first heard of it in RPG Maker XP. but that might still be the "japan" part.
weird_error has joined #ruby
<leitz> I first heard of it in Chef and Puppet, which is why I started learning it.
weird_error has quit [Client Quit]
<nevada1> So yeah, 1996 to 2005, Ruby not as popular, then Rails comes along and books about it. You could create a blog in 15 minutes and that appealed to people. As other programming languages evolved and their respective frameworks, and new ones popped up, I think Ruby started declining a bit since... 2015?
<rocx> shame. it's a beautiful...ish language.
jenrzzz has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
<nevada1> The community seems to be trying to branch out a bit from developing mainly with Rails. Dry-rb appears to be an alternative, or so it was stated in a 2017 Ruby conference.
<nevada1> But what do I know, I'm probably trying to preach to the pope here.
darix has quit [Quit: may the packets be with you...]
<rocx> nanoc's also a good site generator for the fact you can make it nearly do bloody well anything.
<leitz> Sinatra, Roda, for web. Puppet and Chef for Config mgmt. Really, lots of other stuff possible. The colleges seem to be moving to Python though.
<nevada1> Yeah, Python is in CS 101.
<rocx> > implying colleges will be moving away from java
<leitz> rocx, yes.
<nevada1> There's C, Python and Java in CS, mainly.
<rocx> ...C? in college? you sure undergrads will be able to understand pointers?
<leitz> The new Java license will spook a lot of folks and Python is winning the Data Science slot over R.
<rocx> because half of my java classes can't even grasp objects. some can't even grasp methods.
<nevada1> rocx: You bet, haha, it's what I had to do.
<nevada1> There's always OpenJDK, thankfully.
fphilipe_ has quit [Ping timeout: 252 seconds]
<nevada1> I also learned that you can run Ruby on the JVM, with JRuby.
<nevada1> Though I don't know how popular that is.
<rocx> probably not so popular since ruby's popularity is declining thanks to everyone moving everything to js.
<rocx> (and it's a righteous pain in the butt if your hardware isn't top-of-the-line)
<nevada1> It's amazing to see how a language that was never intended to deliver anything more than a little DOM manipulation became what it is today.
<nevada1> (js)
<rocx> and a poor one at that.
<nevada1> It appeals to people because it's easy to write.
<brool> i hate the js craze
<nevada1> Preach.
<brool> we need more c++ and websites should be written in WASM
* brool runs
<rocx> nevada1: and then how it handles types becomes problematic.
<rocx> typeof([] + []) for example
<rocx> and "0" == 0 and 0 == [] but "0" != []
<nevada1> You have TypeScript that... tries to solve that.
<brool> one thing that's evidently very bad about the js craze is how people are writing native desktop applications with it using electron
sagax has quit [Remote host closed the connection]
<brool> discord makes my fans spin just by being idle
<rocx> brool: and that's just chrome.
darix has joined #ruby
<brool> firefox with 20 tabs and multiple windows doesn't do that
<brool> coffeescript best javascript
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<brool> it's like ruby and python had a javascript baby
<nevada1> Can you imagine the layers of abstraction? You have the hardware, the OS, the graphical environment, a (headless) browser that runs on top of it and needs to make OS calls and an interpreter inside it.
fphilipe_ has joined #ruby
jenrzzz has quit [Ping timeout: 259 seconds]
<nevada1> It's huge.
* brool runs back to gcc
* brool clings to machine code
jenrzzz has joined #ruby
<brool> AND you have people trying to use and learn OOP design patterns in a language that doesn't even really do OOP
<nevada1> OOP is weird because every language implements it differently.
<nevada1> Python doesn't even have proper encapsulation.
<brool> javascript does OLOO :^)
<nevada1> You prefix variables with __ to make them appear private.
<nevada1> That's a joke.
<brool> heh yeah python is pretty ugly
<brool> it's like the nerdy kid at school who went on to be a scientist but nobody will ever date him
<nevada1> More like the guy who tries to do everything but does a lot of things badly.
AJA4350 has joined #ruby
<brool> " ".join(reverse(string.split())) [iirc]
<nevada1> Maybe except Machine Learning.
<brool> eugh
Kestrel-029 has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
<brool> why no string.split("").reverse.join(" ")
<brool> cus that's pretty
<brool> you see what's going on in the order it makes sense to think about it
fphilipe_ has quit [Ping timeout: 252 seconds]
Freshnuts has joined #ruby
<nevada1> How do you add functionality do Ruby? Do you write C programs using the ruby header files?
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
<brool> you write ruby
<brool> :^)
nevada1 has left #ruby [#ruby]