<leftylink>
well... I suppose I would like to remember the things that are most important to me
dualfade has joined #ruby
<al2o3-cr>
leftylink: ok. still, you're not going remember everything.
<al2o3-cr>
things slip the mind.
<leftylink>
that is true. we are but human
<al2o3-cr>
leftylink: absolutely, that is all we are.
DarthGandalf has joined #ruby
<leftylink>
I think, at least, remembering that such a thing is possible will be good. then, we have expanded the range of possibilities open to our minds, added a tool to the toolbox, etc.
<leftylink>
I will be happy to do that
<al2o3-cr>
store it in your memory box leftylink :P
<al2o3-cr>
they're ruby staff too, sheesh!
lightstalker has quit [Ping timeout: 240 seconds]
<al2o3-cr>
clueless.
alfiemax has joined #ruby
lightstalker has joined #ruby
alexherbo2 has quit [Ping timeout: 246 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
<al2o3-cr>
if you know what self is, you can't get lost. dave thomas.
Secret-Fire has quit [Remote host closed the connection]
Secret-Fire has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
greengriminal has quit [Quit: This computer has gone to sleep]
<al2o3-cr>
&>> class << (a = [116, 117, 98, 98, 111]); def to_name; map(&:chr).join; end; end; a.to_name
justache has quit [Read error: Connection reset by peer]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
Secret-Fire has quit [Remote host closed the connection]
justache has joined #ruby
Guest34119 has joined #ruby
Secret-Fire has joined #ruby
Guest34119 has quit [Remote host closed the connection]
Secret-Fire has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Secret-Fire has joined #ruby
Secret-Fire has quit [Remote host closed the connection]
Technodrome has joined #ruby
UncleCid has joined #ruby
gix has joined #ruby
gix- has quit [Ping timeout: 256 seconds]
konsolebox has quit [Read error: Connection reset by peer]
konsolebox has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
alnk has joined #ruby
gix has quit [Ping timeout: 244 seconds]
drincruz has joined #ruby
zacts has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
konsolebox has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
alfiemax has quit [Remote host closed the connection]
dionysus69 has joined #ruby
akem has quit [Remote host closed the connection]
alfiemax has joined #ruby
dionysus69 has quit [Remote host closed the connection]
Secret-Fire has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
Uncle_Cid has joined #ruby
UncleCid has quit [Ping timeout: 240 seconds]
greengriminal has quit [Quit: Leaving]
akem has joined #ruby
alfiemax_ has joined #ruby
wymillerlinux has quit [Ping timeout: 246 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
skape has quit [Quit: Connection closed for inactivity]
baojg has quit [Remote host closed the connection]
zacts has quit [Quit: WeeChat 2.8]
alfiemax_ has quit [Remote host closed the connection]
baojg_ has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
Uncle_Cid has quit [Ping timeout: 240 seconds]
bocaneri has joined #ruby
drincruz has quit [Ping timeout: 246 seconds]
Secret-Fire has quit [Remote host closed the connection]
Secret-Fire has joined #ruby
UncleCid has joined #ruby
rose_nd_ash has joined #ruby
schne1der has joined #ruby
skape has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
david224 has joined #ruby
<david224>
Hi all,
rose_nd_ash has quit [Remote host closed the connection]
UncleCid has quit [Ping timeout: 246 seconds]
<david224>
I have a question regarding ruby modules (actually implementing this in rails). I have a main module that has a private method and I want to use that method in two classes belonging to the module. I know about extend but I feel like it should not be necessary to use extend the way i'm implementing it? This is the paste https://dpaste.org/rSro
rose_nd_ash has quit [Remote host closed the connection]
baojg has quit [Remote host closed the connection]
shenghi1 has quit [Quit: WeeChat 2.9]
alfiemax has quit [Ping timeout: 256 seconds]
shenghi1 has joined #ruby
baojg has joined #ruby
rose_nd_ash has joined #ruby
alfiemax has joined #ruby
shenghi1 has quit [Client Quit]
shenghi has quit [Quit: WeeChat 2.0.1]
shenghi has joined #ruby
rose_nd_ash has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 258 seconds]
shenghi has quit [Client Quit]
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
dualfade has quit [Ping timeout: 256 seconds]
shenghi has joined #ruby
dualfade has joined #ruby
alfiemax has joined #ruby
rose_nd_ash has joined #ruby
dualfade has quit [Remote host closed the connection]
dualfade has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
shenghi1 has joined #ruby
shenghi has quit [Ping timeout: 272 seconds]
dualfade has quit [Ping timeout: 240 seconds]
dualfade has joined #ruby
MadLamb has joined #ruby
<MadLamb>
In RxJS the tap operator allow u to run a function for every emission. Ruby has the tap method, but when I use it in a collection it seems to receive the whole collection. Is there a similar alternative that works like the rxjs one?
<adam12>
MadLamb: each or map?
shenghi1 has quit [Quit: WeeChat 2.9]
<MadLamb>
adam12, does each return the original collection?
<adam12>
MadLamb: Yes. Map will return a modified collection.
<MadLamb>
adam12, right, so each is the one. Thanks :D
shenghi has joined #ruby
rose_nd_ash has quit [Remote host closed the connection]
rose_nd_ash has joined #ruby
<adam12>
MadLamb: If you're not familiar with the Enumerable module I encourage you to check it out. Lots of good methods in Enumerable that are automatically available in Hash and Array objects. Just an FYI. https://rubyapi.org/2.7/o/enumerable
<MadLamb>
adam12, hmm I see. Indeed very helpful for many scenarios. I just wanted to debug a sort/map, so the each was mostly to call a console print between the steps, but I know its not really the way its supposed to be done.
<adam12>
MadLamb: Ah. tap is often used for that, but indeed you get the entire collection.
<adam12>
(in that scenario; tap just yields the object it's called on then returns it as self)
<MadLamb>
adam12, yeah but I didnt want to fiddle with the map lambda, rather do a functional style.
<MadLamb>
adam12, in rxjs it returns each element instead
<MadLamb>
adam12, i dont get this behavior tbh. I could tap and call each inside the tap, but calling each in the collection is equivalent
rose_nd_ash has quit [Remote host closed the connection]
<MadLamb>
those are equivalent
<adam12>
MadLamb: Ah. I thought you meant tap and each were the same.
<adam12>
Yes. each returns self when it's done. You can use it in place of `tap` if you want to enumerate but obviously not always because some objects aren't enumerable.
aurelius has joined #ruby
roadt_ has quit [Ping timeout: 264 seconds]
roadt_ has joined #ruby
aurelius has left #ruby [#ruby]
<MadLamb>
adam12, I would expect tap to work like the each does
<MadLamb>
adam12, I was expecting*
<MadLamb>
because this way is a bit useless. If I am receiving the whole collection, I might also use the collection itself
<MadLamb>
like "pp coll"
<MadLamb>
vs coll.tap { |x| pp x }
rose_nd_ash has joined #ruby
aurelius has joined #ruby
<adam12>
MadLamb: tap's frequently used inside a chain of operations, if trying to debug one. Your example is not equivalent and I don't see how it's useless.
rose_nd_ash has quit [Remote host closed the connection]
alfiemax has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
rose_nd_ash has joined #ruby
dionysus69 has quit [Remote host closed the connection]
gitter1234 has joined #ruby
dionysus69 has joined #ruby
rose_nd_ash has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Remote host closed the connection]
aurelius2 has joined #ruby
aurelius2 has quit [Remote host closed the connection]
gray_-_wolf has joined #ruby
ChmEarl has joined #ruby
alfiemax has quit [Remote host closed the connection]
aurelius2 has joined #ruby
aurelius2 has quit [Remote host closed the connection]
rose_nd_ash has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
MrCrackPot has quit [Quit: Leaving]
gray_-_wolf has quit [Quit: WeeChat 2.8]
dualfade has quit [Ping timeout: 240 seconds]
dualfade has joined #ruby
alfiemax_ has joined #ruby
gray_-_wolf has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
alfiemax has joined #ruby
alfiemax_ has quit [Ping timeout: 256 seconds]
rose_nd_ash has quit [Remote host closed the connection]
rose_nd_ash has joined #ruby
alfiemax has quit [Ping timeout: 244 seconds]
alfiemax has joined #ruby
<MadLamb>
argh, sunspot is awful. I have some logic on searchable and it only works the second time I save (it runs the logic before updating the model with its latest values)
<MadLamb>
it could also be some active record stuff
<MadLamb>
like you have to read from some magic property
gray_-_w- has joined #ruby
aurelius has quit [Remote host closed the connection]
colins has joined #ruby
xall__ has joined #ruby
skape has joined #ruby
gray_-_w- has quit [Client Quit]
MrCrackPot has joined #ruby
rose_nd_ash has quit [Remote host closed the connection]
troulouliou_div2 has quit [Ping timeout: 240 seconds]
dualfade has quit [Ping timeout: 258 seconds]
<MadLamb>
does anyone know a way to access the local state (dirty state) values in a activerecord model instead of the current persisted state (database stored before save)?
<deimos_>
why does this still generate ArgumentError "invalid byte sequence" when encounters random binary chars in a logfile? IO.foreach(file, encoding: "UTF-8", invalid: :replace, undef: :replace) { |x| something }
<deimos_>
shouldn' the invalid and undef catch and replace all invalid binary?
rose_nd_ash has quit [Remote host closed the connection]
impermanence has quit [Quit: Connection closed]
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
drincruz has quit [Ping timeout: 258 seconds]
dualfade has joined #ruby
dualfade has quit [Client Quit]
dualfade has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]