havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.org | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3 | Can't talk? Register/identify with NickServ
nickb has quit [Ping timeout: 240 seconds]
en10n has quit [Read error: Connection reset by peer]
jerme_ has quit [Ping timeout: 260 seconds]
fowl has quit [Read error: Connection reset by peer]
fowl has joined #ruby
proc has quit [Ping timeout: 264 seconds]
en10n has joined #ruby
nickb has joined #ruby
jerme_ has joined #ruby
proc has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mjacob> nakilon: is there something specific which you don't like?
SeepingN has quit [Ping timeout: 240 seconds]
SeepingN_ has joined #ruby
adu has quit [Quit: adu]
<adam12> mjacob: I just put them in Gemfile, because after all these years I never remember how to install dev dependencies.
pienkowb has quit [Remote host closed the connection]
ur5us has joined #ruby
SeepingN_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
cthu| has quit [Ping timeout: 246 seconds]
imMute has joined #ruby
SeepingN has joined #ruby
TCZ has quit [Quit: Leaving]
adu has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
znz_jp has quit [Quit: kill -QUIT $$]
znz_jp has joined #ruby
pwnd_sfw has quit [Read error: Connection reset by peer]
ua has quit [Ping timeout: 256 seconds]
ua has joined #ruby
queip has quit [Ping timeout: 256 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
Technodrome has joined #ruby
ua_ has joined #ruby
ua has quit [Ping timeout: 260 seconds]
mozzarella has quit [Quit: WeeChat 2.8]
queip has joined #ruby
imMute has left #ruby [#ruby]
DTZUZU_ has quit [Ping timeout: 256 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
DTZUZU_ has joined #ruby
bmurt has quit [Ping timeout: 256 seconds]
ivz_hh has quit [Remote host closed the connection]
Rudd0 has joined #ruby
ivz_hh has joined #ruby
queip has quit [Ping timeout: 260 seconds]
queip_ has joined #ruby
mozzarella has joined #ruby
queip_ is now known as queip
znz_jp has quit [Remote host closed the connection]
znz_jp has joined #ruby
DTZUZU_ is now known as DTZUZU
ChmEarl has quit [Quit: Leaving]
elcontrastador has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
mr_rich101 has quit [Quit: ZNC - http://znc.in]
mr_rich101 has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kindwindfall__ has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Remote host closed the connection]
shoshin has quit [Quit: Ping timeout (120 seconds)]
shoshin has joined #ruby
hiroaki_ has joined #ruby
hiroaki has quit [Ping timeout: 258 seconds]
Rudd0 has quit [Ping timeout: 256 seconds]
powerhouse has quit [Read error: Connection reset by peer]
powerhouse has joined #ruby
akem has quit [Ping timeout: 272 seconds]
titanbiscuit has quit [Ping timeout: 265 seconds]
BSaboia has joined #ruby
adu has quit [Quit: adu]
cd has quit [Quit: cd]
BSaboia has quit [Quit: This computer has gone to sleep]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BSaboia has joined #ruby
`Alison has quit [Ping timeout: 240 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
Glumetu has joined #ruby
BSaboia has quit [Client Quit]
cnsvc has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
`Alison has joined #ruby
imode has quit [Ping timeout: 246 seconds]
imode has joined #ruby
TvL2386 has joined #ruby
_whitelogger has joined #ruby
teclator has quit [Ping timeout: 264 seconds]
BTRE has quit [Ping timeout: 258 seconds]
BTRE has joined #ruby
dionysus69 has joined #ruby
Ediz has joined #ruby
<Ediz> Hello to all, hope you're having a good day
universa1 has quit [Ping timeout: 272 seconds]
nyuszika7h_ has joined #ruby
Kilo`byte has joined #ruby
imode has quit [Ping timeout: 265 seconds]
universa1 has joined #ruby
jhass|off has joined #ruby
marahin has quit [Ping timeout: 272 seconds]
RushPL has quit [Ping timeout: 272 seconds]
nyuszika7h has quit [Ping timeout: 272 seconds]
jhass has quit [Ping timeout: 272 seconds]
jhass|off is now known as jhass
Kilobyte22 has quit [Ping timeout: 260 seconds]
<Ediz> I've a question and its about testing and mocking - I've a class that uses SecureRandom.base64 in its constructor to test a connection - because the secure random is used directly in the constructor I can't mock what its returning in my tests. If I passed SecureRandom as a dependency, I would be able to do it but it feels weird to do that. Any ideas? suggestions? Thanks in advance.
<Ediz> oh and here's a paste : https://dpaste.org/6cnw
nyuszika7h_ is now known as nyuszika7h
Rudd0 has joined #ruby
marahin has joined #ruby
<Ediz> ok stupid question, ignore me :D
<Ediz> actually still stuck
<Ediz> because I can't know the test_hash that is generated by SecureRandom I can't mock redis so that it returns this same hash for the logic I'm testing
<Ediz> only way I see is to pass SecureRandom to the class from outside and mock that too
<Ediz> which feels weird to do
DarthGandalf has joined #ruby
rippa has joined #ruby
burgestrand has joined #ruby
Technodrome has joined #ruby
<isene> Use Case = Autocompletion for files and dirs: In curses, user enters part of a path and hits TAB, code autocompletes like usual in a shell. Caveat: I cannot use any external module for this (like Readline) since the curses module cannot interface with such. Hence, I must create this autocompletion from scratch - matching parts of paths using Dir, File or any other built-in Ruby module. Any tips?
vondruch_ has joined #ruby
<phaul> Ediz: I think you wanted && in the condition but prly doesn't matter that much result == 'OK' || @redis.get('test') == test_hash
<phaul> just makes more sense with &&
vondruch_ has quit [Quit: vondruch_]
<Ediz> phaul the code works, I want to know how to test that bit of code in the constructor
<isene> OK, I found a way using Dir.glob
TCZ has joined #ruby
rapha has left #ruby ["WeeChat 2.3"]
<phaul> Ediz: sure, I wasn't saying it wasn't working just that the condition is probably wrong. If only one of your conditions fail you still want to report the error I assume. If result is 'OK' and the other condition is false this is true, in which case no exception raised, which is weird. To answer your question: a common trick in dependency injection is to take the dependency as a default argument :
<phaul> initialize(redis, random = SecureRandom). An other way is to allow(SecureRandom).to receive(:base64) etc. also works
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
<Ediz> thank you
dviola has quit [Quit: WeeChat 2.9]
<Glumetu> hello can ask a noob question? i have some variables like c1 c2 ... c100 how can i do a loop and assign new values to them?
<Glumetu> i do not kwow the sintax on how to append a number to a leter some thing like while $i < $num do c[$i] = a*b $i +=1 end
<leftylink> you are correct that using an array would be better. if it must not be an array for unadvisable reasons out of the coder's control, then the search term to use on one's preferred search engine might be "ruby dynamic variable name"
<leftylink> as will be seen on those search results, they will still recommend using an array
ruurd has joined #ruby
impermanence has joined #ruby
burgestrand has quit [Quit: burgestrand]
burgestrand has joined #ruby
lucasb has joined #ruby
TCZ has quit [Quit: Leaving]
bmurt has joined #ruby
ta has quit [Quit: WeeChat 2.9]
adu has joined #ruby
BSaboia has joined #ruby
ta has joined #ruby
impermanence has quit [Ping timeout: 256 seconds]
SeepingN has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
ChmEarl has joined #ruby
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
TCZ has joined #ruby
chouhoulis has joined #ruby
Fridtjof has quit [Quit: ZNC - http://znc.in]
Fridtjof has joined #ruby
<adam12> Ediz: A couple thoughts; I wouldn't do all that work in the constructor. I'd make a new constructor and then call a method on the new instance that does the work.
<Ediz> thx adam12, care to elaborate a little bit?
<adam12> Ediz: I'd pass in the random method. Rely on the fact that a lot of things can respond to call, which means as a default you could do `random = SecureRandom.method(:base64); random.call(value)` and then for testing, pass a lambda or proc. `new(->(_) { "i'm random" })`
cliluw has quit [Ping timeout: 265 seconds]
cliluw has joined #ruby
<Ediz> okay, thanks again
<Tuor> Hi, how is it called that an array is expanded into arguments?: `arg=['echo', '*']; system(*arg)`
<adam12> Tuor: splat?
<adam12> Ediz: This gives you 3 construction methods: normal `new` which doesn't talk to anything outside of itself, `build` which accepts a redis connection and gives you a working random number generator and validates the connection, and `example` which gives you a fake random number generator and still expects something that quacks like Redis.
burgestrand has quit [Quit: burgestrand]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Ediz> ohh interesting, checking all out. tyvm
<adam12> Ediz: I just noticed it's called RedisLogRepository, so my comment about another class is probably invalid. But I'd maybe not suffix everything with `logs`.
<Tuor> adam12: yes. thx.
<adam12> Ediz: Ie. maybe trim_logs is trim_by_ip, and get_logs is by_ip. log is fine but maybe it should be record?
<adam12> Ediz: In the weeds now but just an observation.
<Ediz> yes definately appreciate the feedback
SeepingN has joined #ruby
<Ediz> and you're right
<Ediz> so hard naming things :)
<adam12> Yeah it 100% is
burgestrand has joined #ruby
TCZ has quit [Quit: Leaving]
Glumetu has quit [Quit: Glumetu]
burgestrand has quit [Quit: burgestrand]
cthu| has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
akem has joined #ruby
elcontrastador has joined #ruby
entel has quit []
entel has joined #ruby
impermanence has joined #ruby
teardown has quit [Ping timeout: 240 seconds]
impermanence has quit [Quit: Connection closed]
impermanence has joined #ruby
orbyt_ has joined #ruby
Rudd0 has quit [Ping timeout: 258 seconds]
Azure has quit [Read error: Connection reset by peer]
howdoi has joined #ruby
elxbarbosa has joined #ruby
<elxbarbosa> join /rails
<apotheon> no thanks
bamdad has quit [Ping timeout: 240 seconds]
<adam12> ಠ_ಠ
dviola has joined #ruby
imode has joined #ruby
entel has quit []
entel has joined #ruby
entel has quit [Client Quit]
entel has joined #ruby
bamdad has joined #ruby
bamdad has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
fandre1986 has joined #ruby
BSaboia has joined #ruby
powerhouse has quit [Quit: Leaving]
impermanence has quit [Ping timeout: 246 seconds]
powerhouse has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
Sina has quit [Quit: Connection closed for inactivity]
cthulchu_ has joined #ruby
cthulchu_ has quit [Max SendQ exceeded]
cthulchu_ has joined #ruby
powerhouse has quit [Remote host closed the connection]
cthulchu_ has quit [Max SendQ exceeded]
BSaboia has joined #ruby
cthulchu_ has joined #ruby
cthu| has quit [Ping timeout: 256 seconds]
powerhouse has joined #ruby
BSaboia has quit [Client Quit]
dhollinger has quit [Ping timeout: 264 seconds]
dhollinger has joined #ruby
fippy has quit [Ping timeout: 256 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
BSaboia has joined #ruby
cnsvc has joined #ruby
BSaboia has quit [Client Quit]
fippy_ has joined #ruby
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
fippy_ is now known as fippy
BSaboia has joined #ruby
fandre1986 has quit [Ping timeout: 260 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
burgestrand has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
johnny56 has joined #ruby
burgestrand has quit [Client Quit]
adu has quit [Quit: adu]
BSaboia has quit [Quit: Leaving]
adu has joined #ruby
<isene> Did a blog post about my Ruby Terminal File Manager (RTFM) adventure here: https://isene.org/2020/11/RTFM.html
<apotheon> nice license on it
<apotheon> I'll see if I have time to read that in the near future.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<isene> apotheon: That's my prefered license
ur5us has joined #ruby
<fippy> isene: firefox says that rtfm-screencast.mp4 is corrupt
elxbarbosa has quit [Ping timeout: 272 seconds]
<isene> Firefox is wrong.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12> "ecoder may not have the capability to handle the requested video format with YUV444 chroma subsampling."
<apotheon> The screencast seems to play fine in Vimb.
<apotheon> The video and audio seem very out-of-sync for me, though.
<adam12> isene: Watched the video. Neat project.
<apotheon> Just giving the filename to mpv plays with no sync issue, though, so that's nice.
<isene> adam12: Thanks
<apotheon> isene: I think this is the first time I've seen a file manager (other than just the shell itself) that looks potentially interesting for me to use.
<apotheon> I might have to give that a try, now.
<isene> apotheon: 😊
pwnd_sfw has joined #ruby
bamdad has joined #ruby
imode has quit [Ping timeout: 240 seconds]
rowendy has joined #ruby
rowendy has left #ruby [#ruby]
rowendy has joined #ruby
<apotheon> isene: How configurable is it? Is there a way to change keybindings?
rowendy_ has joined #ruby
rowendy has left #ruby [#ruby]
<isene> apotheon: Nope. Not yet.
<apotheon> ahh
<isene> But the bindings are perfect as they are
<apotheon> My interest wanes for the moment, but it's worth mentioning to other people who like the idea of console-based file managers.
<apotheon> They aren't perfect for me. I don't like moving my hands away from home row, so I was hoping for a way to turn things like arrow keys into vi-like keybindings.
adu has quit [Quit: adu]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
<isene> I could easily add the standard motion keys from VIM. That's like 3 mins including a remapping of h and documentation
Rudd0 has joined #ruby
TCZ has quit [Ping timeout: 258 seconds]
cd has joined #ruby
SeepingN has joined #ruby
szqdsegrhrdgdrg has joined #ruby
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
TCZ has joined #ruby
iNs has quit [Quit: bubye]
iNs has joined #ruby
rowendy_ has quit [Quit: Leaving...]
orbyt_ has joined #ruby
weaksauce has joined #ruby
elcontrastador has quit [Ping timeout: 256 seconds]
bamdad has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
bamdad has joined #ruby
szqdsegrhrdgdrg has quit [Remote host closed the connection]
tpanarch1st has joined #ruby
DTZUZU_ has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
ellcs has quit [Ping timeout: 244 seconds]
DTZUZU has quit [Ping timeout: 258 seconds]
chouhoulis has quit [Remote host closed the connection]
Azure has joined #ruby
TCZ has joined #ruby
cloud69 has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
ruurd has quit [Quit: ZZZzzz…]
Technodrome has joined #ruby
ruurd has joined #ruby
ur5us has joined #ruby
andremedeiros has quit [Quit: ZNC 1.8.2 - https://znc.in]
andremedeiros has joined #ruby
imode has joined #ruby