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
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has quit [Ping timeout: 240 seconds]
bambanx_ has quit [Quit: Leaving]
bambanx has joined #ruby
roshanavand has quit [Quit: Quitting...]
TCZ has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
drincruz_ has quit [Ping timeout: 256 seconds]
BTRE has joined #ruby
Azure|dc is now known as Azure
bkuhlmann has joined #ruby
BTRE has quit [Remote host closed the connection]
Atro has quit [Ping timeout: 244 seconds]
KnownSyntax has quit [Ping timeout: 244 seconds]
rann has quit [Ping timeout: 244 seconds]
graphicsv has quit [Ping timeout: 244 seconds]
JayDoubleu has quit [Ping timeout: 244 seconds]
d10n-work has quit [Ping timeout: 244 seconds]
CustosLimen has quit [Ping timeout: 244 seconds]
ec has quit [Ping timeout: 244 seconds]
dcunit3d has joined #ruby
Atro has joined #ruby
d10n-work has joined #ruby
ec has joined #ruby
graphicsv has joined #ruby
CustosLimen has joined #ruby
JayDoubleu has joined #ruby
rann has joined #ruby
KnownSyntax has joined #ruby
swaggboi has quit [Ping timeout: 264 seconds]
BTRE has joined #ruby
helpa has quit [Remote host closed the connection]
helpa-bot has joined #ruby
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
drincruz_ has joined #ruby
swaggboi has joined #ruby
moldorcoder7 has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
moldorcoder7 has joined #ruby
meinside has joined #ruby
AndyC has quit [Ping timeout: 246 seconds]
drincruz_ has quit [Ping timeout: 256 seconds]
aremaref has quit [Ping timeout: 272 seconds]
AndyC has joined #ruby
aremaref has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
baojg_ has quit [Remote host closed the connection]
baojg has joined #ruby
TCZ has quit [Ping timeout: 240 seconds]
gix has quit [Ping timeout: 240 seconds]
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
aremaref has quit [Ping timeout: 246 seconds]
TCZ has joined #ruby
aremaref has joined #ruby
AndyC has quit [Ping timeout: 256 seconds]
aremaref has quit [Ping timeout: 246 seconds]
TCZ has quit [Quit: Diabe? tkwi w szczegó?ach]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
bkuhlmann has quit [Remote host closed the connection]
stanrifkin has joined #ruby
ule has quit [Quit: WeeChat 2.9]
<stanrifkin> what does yield and block_given? mean?
ule has joined #ruby
ule has quit [Changing host]
ule has joined #ruby
bkuhlmann has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
bkuhlmann has quit [Remote host closed the connection]
<havenwood> stanrifkin: Sec, I'll show an example.
elcuervo has quit [Read error: Connection reset by peer]
baojg has quit [Remote host closed the connection]
ChmEarl has quit [Quit: Leaving]
elcuervo has joined #ruby
baojg has joined #ruby
zacts has joined #ruby
zacts has quit [Client Quit]
<havenwood> stanrifkin: These ^ examples show passing a regular function compared with an explicit or yielded block.
<havenwood> stanrifkin: In the block variants, #block_given? will return `true` or `false` depending on whether the method was called with a block.
<havenwood> stanrifkin: So with `def foo(&block); block_given? end` you'd get `foo #=> false` but `foo { } #=> true`.
<stanrifkin> i'm irritated :)
<havenwood> stanrifkin: Say more?
<stanrifkin> that what i was looking
<stanrifkin> simple fibonacci but with this yield ... if block_given? line
bambanx has quit [Quit: Leaving]
<havenwood> stanrifkin: So if you `fibUpTo(30)` a block wasn't given.
<havenwood> stanrifkin: But if you `fibUpTo(30) {|n| print "#{n} "}` the `n` is the `n1` from `yield n1`.
<havenwood> stanrifkin: Does that make sense?
<stanrifkin> so fibUpTo(30) gives just the array back
<havenwood> stanrifkin: Yes.
<stanrifkin> and fibUpTo(30) {....} yields to a formal parameter |n| which i can use
<havenwood> stanrifkin: Yeah. The `yield n1` provides the `|n|` value `n`.
<stanrifkin> ok. makes sense now
cthu| has quit [Ping timeout: 256 seconds]
xiq has quit [Ping timeout: 246 seconds]
zacts has joined #ruby
<stanrifkin> havenwood: is it somewhat related to a function hook?
<stanrifkin> havenwood: from other programming languages perspective
<stanrifkin> havenwood: i'm coming from perl/c++
<stanrifkin> havenwood: somewhat a for_each with a lambda which captures a variable....
<stanrifkin> havenwood: thank you. i don't understand your examples yet but slowly i get the idea
cloud69 has joined #ruby
stanrifkin_ has joined #ruby
stanrifkin has quit [Ping timeout: 264 seconds]
drincruz_ has joined #ruby
aremaref has joined #ruby
dcunit3d has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sagax has joined #ruby
mr_rich101 has quit [Quit: ZNC - http://znc.in]
mr_rich101 has joined #ruby
Nahra has joined #ruby
drincruz_ has quit [Ping timeout: 240 seconds]
zacts has quit [Quit: leaving]
pwnd_sfw0 has joined #ruby
factormystic has quit [Read error: Connection reset by peer]
pwnd_sfw has quit [Ping timeout: 260 seconds]
pwnd_sfw0 is now known as pwnd_sfw
BTRE has quit [Ping timeout: 265 seconds]
BTRE has joined #ruby
nbm has left #ruby ["WeeChat 3.0"]
donofrio has quit [Remote host closed the connection]
aremaref has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
orbyt_ has joined #ruby
aremaref has joined #ruby
aremaref has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
hassox_ has joined #ruby
blackmesa has quit [Quit: WeeChat 3.0]
blackmesa has joined #ruby
hassox has quit [Ping timeout: 264 seconds]
blackmesa has quit [Client Quit]
blackmesa has joined #ruby
Rudd0 has quit [Ping timeout: 240 seconds]
blackmesa has quit [Quit: WeeChat 3.0]
blackmesa has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Client Quit]
blackmesa has joined #ruby
<blackmesa> ˚˚?∆˚∆∆˚KJK
blackmesa has quit [Client Quit]
blackmesa has joined #ruby
blackmesa has quit [Client Quit]
blackmesa has joined #ruby
<cloud69> blackmesa: that's not how you do it
<cloud69> noob
<cloud69> blackmesa: ✿*゚¨゚✎・ ✿.。.:* *.:。✿*゚¨゚✎・✿.。.:* ♡LOVE♡LOVE♡ ✿*゚¨゚✎・ ✿.。.:*
vondruch has joined #ruby
stanrifkin_ has quit [Quit: Leaving]
jdeen has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<blackmesa> cloud69: :D nice
<blackmesa> I ws
teclator has quit [Remote host closed the connection]
aremaref has joined #ruby
blackmesa has quit [Quit: WeeChat 3.0]
dionysus69 has joined #ruby
blackmesa has joined #ruby
aremaref has quit [Ping timeout: 240 seconds]
blackmesa has quit [Client Quit]
blackmesa has joined #ruby
jenrzzz has joined #ruby
Bish has quit [Ping timeout: 264 seconds]
akem_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
akem has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 240 seconds]
jdeen has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
blackmesa has joined #ruby
teclator has joined #ruby
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 256 seconds]
jdeen has joined #ruby
jinie has quit [Quit: ZNC 1.8.2 - https://znc.in]
jinie has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
akem has quit [Ping timeout: 264 seconds]
akem has joined #ruby
Rudd0 has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 260 seconds]
aphel has joined #ruby
aremaref has joined #ruby
al2o3-cr has joined #ruby
aremaref has quit [Ping timeout: 246 seconds]
jdeen has joined #ruby
gix has joined #ruby
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 260 seconds]
gix has joined #ruby
jdeen has joined #ruby
postmodern has quit [Quit: Leaving]
jenrzzz has joined #ruby
nofxx has quit [Remote host closed the connection]
donofrio has joined #ruby
TCZ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
rubydoc has quit [Ping timeout: 256 seconds]
rubydoc has joined #ruby
phaul has quit [Ping timeout: 264 seconds]
phaul has joined #ruby
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jdeen has joined #ruby
weaksauce has quit [Ping timeout: 240 seconds]
rubydoc has quit [Ping timeout: 246 seconds]
phaul has quit [Ping timeout: 260 seconds]
rubydoc has joined #ruby
e is now known as demiurge
phaul has joined #ruby
akem_ is now known as akem
meinside has quit [Quit: Connection closed for inactivity]
dionysus69 has quit [Quit: dionysus69]
aremaref has joined #ruby
njstewart has joined #ruby
<njstewart> Hi All, hope your all well. I have a question on Stackoverflow that I'd be grateful for some help with. https://stackoverflow.com/q/65142841/6097917
cd has joined #ruby
tempate has left #ruby [#ruby]
aremaref has quit [Ping timeout: 256 seconds]
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
blackmesa1 has joined #ruby
crankharder has joined #ruby
TCZ is now known as Hayato
Hayato is now known as TCZ
blackmesa has quit [Ping timeout: 260 seconds]
drincruz_ has joined #ruby
<jhass> ?crosspost
<ruby[bot]> Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
akem has quit [Ping timeout: 264 seconds]
<njstewart> Am guessing that's at me. Fair enough. It's my first time on these channels. My post above is also on #RubyOnRails. Thanks!
bkuhlmann has joined #ruby
lucasb has joined #ruby
roshanavand has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 256 seconds]
al2o3-cr has joined #ruby
al2o3-cr has quit [Client Quit]
jdeen has joined #ruby
al2o3-cr has joined #ruby
njstewart has quit [Remote host closed the connection]
drincruz_ has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Diabe? tkwi w szczegó?ach]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
jenrzzz has joined #ruby
_aeris has joined #ruby
BH23 has joined #ruby
vondruch has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
blackmesa1 has quit [Quit: WeeChat 3.0]
blackmesa has joined #ruby
rubydoc has quit [Ping timeout: 260 seconds]
phaul has quit [Ping timeout: 260 seconds]
phaul has joined #ruby
crankharder has joined #ruby
drincruz_ has joined #ruby
phaul has quit [Ping timeout: 256 seconds]
AndyC has joined #ruby
TCZ has joined #ruby
rubydoc has joined #ruby
vondruch has joined #ruby
phaul has joined #ruby
TCZ is now known as toxic_worm
dionysus69 has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
drincruz_ has quit [Ping timeout: 256 seconds]
akem has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
dviola has quit [Ping timeout: 256 seconds]
Garb0 has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
<Garb0> Hey, really question how do you get resolv to resolve local IPs?
<jhass> iirc you cant't unless you got a local stub resolver running
<jhass> like dnsmasq or systemd-resolved
<Garb0> hm. bummer. i guess i'll have to edit local IPs out of my regex
<jhass> I mean I took your question as resolving local hostnames to local IPs
drincruz_ has joined #ruby
<jhass> "resolving an IP" doesn't make a whole lot of sense
<Garb0> jhass, crap, i'm drunk, i meant get names from IPs
<Garb0> as in hostnames
<jhass> okay, I'm not aware of libnss doing that, so that'd always be your local network's resolver providing that
<jhass> what are you trying and how does it work outside ruby?
<jhass> .. for your setup
crankharder has quit [Ping timeout: 256 seconds]
<Garb0> jhass, i figured it out lol, just regex'd out local IPs, thanks for the help
aremaref has joined #ruby
crankharder has joined #ruby
factormystic has joined #ruby
deadbee has joined #ruby
aremaref has quit [Ping timeout: 264 seconds]
_aeris_ has quit [Quit: ZNC - http://znc.sourceforge.net]
_aeris is now known as _aeris_
drincruz_ has quit [Ping timeout: 240 seconds]
Garb0 has quit [Remote host closed the connection]
drincruz_ has joined #ruby
BSaboia has joined #ruby
dviola has joined #ruby
AndyC has quit [Ping timeout: 256 seconds]
deadbee has quit [Quit: WeeChat 2.9]
junaidnaseer2 has joined #ruby
Mrbuck has joined #ruby
toxic_worm has quit [Read error: Connection reset by peer]
blackmesa has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Quit: WeeChat 2.9]
DTZUZU has joined #ruby
jenrzzz has joined #ruby
Mrbuck has quit [Ping timeout: 240 seconds]
ChmEarl has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
Mrbuck has joined #ruby
Guest13 has joined #ruby
cuerbot has joined #ruby
x0n has quit [Excess Flood]
elcuervo has quit [Read error: Connection reset by peer]
x0n has joined #ruby
nofxx has joined #ruby
lightstalker has quit [Ping timeout: 256 seconds]
MarkPryor has joined #ruby
MarkPryor has quit [Remote host closed the connection]
lightstalker has joined #ruby
ChmEarl has quit [Ping timeout: 240 seconds]
dfucci has quit [Ping timeout: 256 seconds]
phaul has quit [Ping timeout: 246 seconds]
rubydoc has quit [Ping timeout: 264 seconds]
pienkowb has joined #ruby
Swyper has joined #ruby
junaidnaseer2 has quit [Ping timeout: 244 seconds]
rubydoc has joined #ruby
ChmEarl has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
jdeen has quit [Ping timeout: 260 seconds]
bkuhlmann has quit []
phaul has joined #ruby
aremaref has joined #ruby
k_sze has joined #ruby
<k_sze> What's the proper way to install rvm for single user if I use zsh instead of bash?
rubydoc has quit [Ping timeout: 256 seconds]
aremaref has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
phaul has quit [Ping timeout: 246 seconds]
cthu| has joined #ruby
phaul has joined #ruby
rubydoc has joined #ruby
BSaboia has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
roshanavand has joined #ruby
<havenwood> k_sze: The same.
<havenwood> k_sze: Install from a non-root user and don't use sudo.
<k_sze> Shall I pipe the install script to zsh instead of to bash?
<havenwood> k_sze: Ah, I see what you're saying.
vondruch has quit [Read error: Connection reset by peer]
<havenwood> k_sze: The installer script is written in bash alone. I'm not aware of any port of the installer to zsh.
<summerisle> afaik zsh is compatible, but I'm not a full-time zsh user for that matter
<havenwood> summerisle: RVM is zsh compatible but the installer requires bash.
<summerisle> perhaps there's an oh-my-zsh plugin
<havenwood> k_sze: You could use chruby/ruby-install as an alternative to RVM if bash isn't available to install RVM.
<summerisle> honestly, if you know what you're doing it should not be terribly difficult to install rvm by hand
<summerisle> just set up the rvm directory and then source the functions from zshrc
dionysus69 has joined #ruby
<havenwood> summerisle: agreed that it's not hard to get it an unpack it yourself then source the functions
<havenwood> k_sze: You can follow the "Installing RVM offline" steps but unpack it yourself" https://rvm.io/rvm/offline#installing-rvm-offline
<k_sze> I see.
<pienkowb> Hi folks! If you tend to use a lot of timestamp fields in your ActiveRecord models, you can check out a gem I recently released called active_record-events: https://github.com/pienkowb/active_record-events
<havenwood> pienkowb: Nifty!
<havenwood> It almost feels like a state machine, but simpler to use and tailored to a common need.
duderonomy has quit [Ping timeout: 264 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
carbone5 has joined #ruby
<pienkowb> havenwood: Thanks! Yes, exactly. I see it as middle ground between a boolean flag and a full-blown state machine.
dfucci has quit [Ping timeout: 240 seconds]
aremaref has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
junaidnaseer2 has joined #ruby
phaul has joined #ruby
Mrbuck has quit [Ping timeout: 240 seconds]
mcr has quit [Ping timeout: 240 seconds]
AndyC has joined #ruby
cow[moo] has quit [Read error: Connection reset by peer]
r29v has joined #ruby
dfucci has joined #ruby
mcr has joined #ruby
rubydoc has quit [Ping timeout: 260 seconds]
aremaref has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 240 seconds]
AndyC has quit [Remote host closed the connection]
<adam12> pienkowb: Interesting! I can see where this would be useful.
AndyC has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
aremaref has joined #ruby
dviola has left #ruby ["WeeChat 2.9"]
orbyt_ has joined #ruby
blackmesa has joined #ruby
<pienkowb> adam12: Thanks! I hope you'll benefit from using it.
<adam12> pienkowb: I don't use ActiveRecord but I could see it maybe being useful for Sequel, so I'd have to port it.
<pienkowb> adam12: I think it's a great idea
dviola has joined #ruby
weaksauce has joined #ruby
rubydoc has joined #ruby
phaul has joined #ruby
carbone5 has quit [Quit: carbone5]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
phaul has quit [Ping timeout: 260 seconds]
phaul has joined #ruby
phaul has quit [Remote host closed the connection]
phaul has joined #ruby
AndyC has quit [Ping timeout: 256 seconds]
phaul has quit [Remote host closed the connection]
phaul has joined #ruby
pienkowb has quit [Remote host closed the connection]
zacts has joined #ruby
r29v has quit [Quit: r29v]
m27frogy has quit [Quit: ZNC - https://znc.in]
phaul has quit [Ping timeout: 256 seconds]
phaul has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
pwnd_sfw8 has joined #ruby
pwnd_sfw has quit [Ping timeout: 260 seconds]
pwnd_sfw8 is now known as pwnd_sfw
dionysus69 has quit [Ping timeout: 260 seconds]
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 256 seconds]
BSaboia has joined #ruby
bambanx has joined #ruby
phaul has joined #ruby
rubydoc has joined #ruby
TCZ has joined #ruby
zacts has quit [Quit: leaving]
TCZ is now known as toxic_worm
toxic_worm is now known as TCZ
<al2o3-cr> `cd /usr/local/src; git clone https://github.com/ruby/ruby.git; autoconf; ./configure --prefix=/opt; make; sudo make install; chruby_use /opt` then experiment with ruby3.0.0dev
<al2o3-cr> just wondering how others install dev to play
dionysus69 has joined #ruby
aremaref has quit [Ping timeout: 265 seconds]
zacts has joined #ruby
<havenwood> al2o3-cr: I run this little script: https://gist.github.com/havenwood/823382815cbdcfddadd798d4042023a8
<havenwood> al2o3-cr: It's like a mini-ruby-install but macOS specific and only nightly dev builds.
<havenwood> I should update it to remove the hardcoded jemalloc. I think I did that in my non-gist version.
dionysus69 has quit [Ping timeout: 246 seconds]
<havenwood> I do like a with jemalloc default though.
<al2o3-cr> havenwood: ah, nice!
<al2o3-cr> yeah, i should of added --with-jemalloc
vondruch has joined #ruby
rubydoc has quit [Ping timeout: 246 seconds]
<al2o3-cr> might create a little script like yours.
phaul has quit [Ping timeout: 240 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
ignorand has joined #ruby
<ignorand> How can I better understand what the 'render' command in the controller does?
<ignorand> render json: @posts displays the posts as json code. But what are the functions and what are the arguments?
<ignorand> it looks to be the same as render(json: @posts)
<leftylink> that is true
phaul has joined #ruby
rubydoc has joined #ruby
aremaref has joined #ruby
phaul has quit [Ping timeout: 264 seconds]
rubydoc has quit [Ping timeout: 264 seconds]
phaul has joined #ruby
rubydoc has joined #ruby
TCZ is now known as toxic_worm
junaidnaseer2 has quit [Read error: Connection reset by peer]
rubydoc has quit [Ping timeout: 256 seconds]
phaul has quit [Ping timeout: 264 seconds]
rubydoc has joined #ruby
phaul has joined #ruby
zacts has quit [Ping timeout: 264 seconds]
m27frogy has joined #ruby
bambanx has quit [Ping timeout: 256 seconds]
roshanavand has joined #ruby
bambanx has joined #ruby
zacts has joined #ruby
bambanx has quit [Remote host closed the connection]
rubydoc has quit [Ping timeout: 260 seconds]
phaul has quit [Ping timeout: 240 seconds]
bambanx has joined #ruby
bambanx has quit [Remote host closed the connection]
bambanx has joined #ruby
BH23 has quit [Quit: Connection closed for inactivity]
zacts has quit [Quit: leaving]
ignorand has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 264 seconds]
roshanavand has joined #ruby
rubydoc has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
rubydoc has quit [Ping timeout: 240 seconds]
bambanx has quit [Remote host closed the connection]
bambanx has joined #ruby
cthu| has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
bambanx_ has joined #ruby
toxic_worm has quit [Remote host closed the connection]
bambanx_ has quit [Client Quit]
dviola has quit [Ping timeout: 272 seconds]
crankharder has quit [Quit: leaving]
dviola has joined #ruby
dviola has left #ruby [#ruby]
bambanx_ has joined #ruby
akem has quit [Ping timeout: 246 seconds]
bambanx_ has quit [Client Quit]
bambanx has quit [Quit: Leaving]
bambanx has joined #ruby
akem has joined #ruby
TCZ has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
AndyC has joined #ruby
roshanavand has joined #ruby
rubydoc has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
rubydoc has quit [Excess Flood]
rubydoc has joined #ruby
Nowaker has joined #ruby
<Nowaker> How do I pass all arguments from one method to another method, pre-Ruby 2.7? For example, bleh(1, 2, 3, val4: 4, val5: 5), then how do I write my def bleh to execute something(1, 2, 3, val4: 4, val5: 5) dynamically? I tried def bleh *args, and something(*args) and I think it doesn't pass the kwargs. I tried def bleh *args, **kwargs and something(*args, **kwargs) and it didn't seem to work either.
rubydoc has quit [Ping timeout: 272 seconds]
<leftylink> huh, the *args **kwargs one is what I would have tried. now you are making me curious about how this is supposed to be done...
<Nowaker> yeah... my knowledge around splat and double splat has always been murky. I tried one way, and if it didn't work, I tried another way, until it worked. But can't get it to work this time lol
<leftylink> give an example of it not working, maybe that will at least get the ball rolling and let me know what I shouldn't try to do
<Nowaker> ok, writing down to a pastie, one moment
bambanx has quit [Ping timeout: 240 seconds]
<leftylink> } #{c} #{val4} #{val5}" end; foo(1, 2, 3, val4: 4, val5: 5)
<leftylink> oops
<leftylink> was not ready to show my own tries
<leftylink> hmm
<leftylink> &>> def foo(*args, **kwargs); bar(*args, **kwargs) end; def bar(a, b, c, val4:, val5:); "you provided #{a} #{b} #{c} #{val4} #{val5}" end; foo(1, 2, 3, val4: 4, val5: 5)
<leftylink> oh rubydoc JUST disappted
<leftylink> >> def foo(*args, **kwargs); bar(*args, **kwargs) end; def bar(a, b, c, val4:, val5:); "you provided #{a} #{b} #{c} #{val4} #{val5}" end; foo(1, 2, 3, val4: 4, val5: 5)
<ruby[bot]> leftylink: # => "you provided 1 2 3 4 5" (https://carc.in/#/r/a24y)
<leftylink> indeed, I sure did provide that
duderonomy has joined #ruby
<Nowaker> Here is the "before" and "after"
bambanx has joined #ruby
<Nowaker> leftylink: regarding what you typed in the channel, yeah, it looks exactly like what I have in my pastie, and it doesn't seem to work, at least with Rack::Attack... i wonder why
dfucci has quit [Quit: Lost terminal]
<leftylink> could it have anything at all to do with the fact that previously, throttle was called with a block? there's the do |req| bit, you see
<leftylink> in which case, &blk after **kwargs in both locations to pass the block
<Nowaker> aaaaah
<Nowaker> forgot about the block!
<Nowaker> will pass the &block!
<Nowaker> thanks!
<leftylink> 👍
<Nowaker> i focused too much on kwargs which I barely ever passed therefore assumed it's where the problem is
<Nowaker> and it was the &block i forgot about
<Nowaker> thanks again
rubydoc has joined #ruby
phaul has joined #ruby
Guest13 has quit [Quit: Idle time exceeded]
BSaboia has quit [Quit: This computer has gone to sleep]
ignorand_ has joined #ruby
akem_ has joined #ruby
<ignorand_> I am trying to parse a jsonapi page. sort seems to be a parameter, and it can be split on ',', and a '-' in front indicates descending.
ignorand_ is now known as ignorand
dviola has joined #ruby
BSaboia has joined #ruby
<ignorand> so 'name, last_name, -day_of_birth' would need to be transformed into .order(name: :asc, last_name: :asc, day_of_birth: :desc)
akem has quit [Ping timeout: 265 seconds]
pienkowb has joined #ruby
pinkpandabot has joined #ruby
<leftylink> that seems doable
BSaboia has quit [Quit: Leaving]