<Tuor>
Hi, I can't remember, there are multiple methods which have some resemblance: select, map, reduce, and what?
<baweaver>
Enumerable methods?
<leftylink>
it seems difficult to understand what is meant by resemblance here. perhaps it would be easier to look at the list of Enumerable methods and see for oneself ... I was just beaten
cd has quit [Quit: cd]
dfucci has joined #ruby
<leftylink>
punished for typing a long message instead of a short one
<Tuor>
That's a good idea. Thank you!
<baweaver>
Har
<baweaver>
leftylink: Wanna read something fun?
<leftylink>
"used to be a mushroom and now is a fungi" (doesn't make sense, fungi is plural)
<leftylink>
anyway, I will read
Pixi__ has quit [Quit: Leaving]
crawler has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
crawler has joined #ruby
<Tuor>
there are a lot of enumerable methods... map_filter, love it :)
blackwhale has quit [Remote host closed the connection]
blackwhale has joined #ruby
ta has quit [Quit: WeeChat 2.9]
ta has joined #ruby
postmodern has quit [Quit: Leaving]
fanta1 has joined #ruby
venmx has joined #ruby
rzjian has quit [Quit: WeeChat 3.0]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
arahael1 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Arahael has quit [Ping timeout: 264 seconds]
cloud69 has joined #ruby
naftilos76 has joined #ruby
makara1 has joined #ruby
<naftilos76>
Hi everyone, is there a way to tell the name of the script that is calling a method? Basically i am looking for a way to tell, while being inside a method not located in the script, the name of the calling script. __FILE__ works fine only if you are looking for the name of the file that the __FILE__ statement is located!
<makara1>
hi. I'm trying to grab the last segment of a string in an erb template. So `codeTableClass = "#{codeTable}"` where codeTableClass is a.b.c.d and I want d
<makara1>
does this make sense? `codeTableClass = "#{codeTable}.split(".")[-1]"`
<naftilos76>
try it
<makara1>
irb says unexpected literal: Class = "#{codeTable}.split(".")[-1]"
<naftilos76>
so you have a string "a.b.c.d" and you want to get d?
<makara1>
im getting mixed up. `codeTableClass = codeTable.split(".")[-1]`
<makara1>
print codeTableclass gives me "nil"
<makara1>
naftilos76: yes
<naftilos76>
what does d look like?
<naftilos76>
is it a string or just "d" ?
<makara1>
nothing
<makara1>
jsut d
<wnd>
naftilos76, if you run out of better options, you may want to take a look Kernel.caller
<makara1>
ok it works
<makara1>
haven't used ruby for ages
<naftilos76>
if you are dealing with a string "a.b.c.d" then one way to get d is to do "string".split(".")[-1]
<naftilos76>
if the string is indeed "a.b.c.d" then it should work
<alexherbo2>
I can modify my private #update method for having arguments, but I feel like my #update will do too much work, as I initially have #create and #update private just to do the sql work called by #save
akem has quit [Remote host closed the connection]
<alexherbo2>
pokemon.update(name: 'Pika')
akem has joined #ruby
<alexherbo2>
adam12: how would you write the #update(index:, name:) method?
<alexherbo2>
It could be nice my #update be short like the .create
<alexherbo2>
i.e. updating the index and name attributes, and calling #save
<alexherbo2>
but I'm not sure where to put the sql code
jla has joined #ruby
<alexherbo2>
adam12: do you think I should remove the private #create and #update and put the whole code back in #save, so that I have the namespace #update to do: update pokemon name/index, and all save.
<alexherbo2>
call*
<adam12>
alexherbo2: I'm not sure what you're really optimizing for. Just because you were able to delegate .create doesn't mean you can delegate #update
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
<alexherbo2>
.create and #update look a bit similar, they take attributes to set the object properties and call #save to store in the db, so I was tend to see a parallel in the implem
<adam12>
Ah.
<adam12>
I don't have any ideas right now, tbh.
Cubixusin[m] has quit [*.net *.split]
PaulB[m] has quit [*.net *.split]
Furai has quit [*.net *.split]
JoL1hAHN has quit [*.net *.split]
Kilo`byte has quit [*.net *.split]
tosaraja has quit [*.net *.split]
mnemon has quit [*.net *.split]
Rush has quit [*.net *.split]
JanHebler[m] has quit [*.net *.split]
bthompson90 has quit [*.net *.split]
jordanh has quit [*.net *.split]
bvdw has quit [*.net *.split]
shaman42 has quit [*.net *.split]
Iambchop has quit [*.net *.split]
ec has quit [*.net *.split]
ghormoon has quit [*.net *.split]
snapcase has quit [*.net *.split]
yokel has quit [*.net *.split]
Furai has joined #ruby
PaulB[m] has joined #ruby
Cubixusin[m] has joined #ruby
JoL1hAHN has joined #ruby
tosaraja has joined #ruby
Kilo`byte has joined #ruby
mnemon has joined #ruby
Rush has joined #ruby
Furai has quit [Max SendQ exceeded]
Kilo`byte has quit [Max SendQ exceeded]
bthompson90 has joined #ruby
jordanh has joined #ruby
bvdw has joined #ruby
JanHebler[m] has joined #ruby
Iambchop has joined #ruby
shaman42 has joined #ruby
snapcase has joined #ruby
ec has joined #ruby
yokel has joined #ruby
ghormoon has joined #ruby
yokel has quit [Max SendQ exceeded]
ghormoon has quit [Max SendQ exceeded]
bthompson90 has quit [Max SendQ exceeded]
bvdw has quit [Max SendQ exceeded]
Kilo`byte has joined #ruby
Furai has joined #ruby
ghormoon has joined #ruby
yokel_ has joined #ruby
bvdw4 has joined #ruby
yokel_ is now known as yokel
Jello_Raptor has quit [Ping timeout: 246 seconds]
klaas has quit [*.net *.split]
hsiktas[m] has quit [*.net *.split]
jo-so has quit [*.net *.split]
znz_jp has quit [*.net *.split]
phaul has quit [*.net *.split]
rubydoc has quit [*.net *.split]
iamgr00t has quit [*.net *.split]
nemesit|znc has quit [*.net *.split]
Fusl has quit [*.net *.split]
lightstalker has quit [Ping timeout: 267 seconds]
itok has quit [Ping timeout: 267 seconds]
PaulB[m] has quit [Ping timeout: 244 seconds]
rubydoc has joined #ruby
jo-so has joined #ruby
klaas has joined #ruby
znz_jp has joined #ruby
Fusl has joined #ruby
phaul has joined #ruby
nemesit|znc has joined #ruby
iamgr00t has joined #ruby
tfreedman has quit [Ping timeout: 240 seconds]
jordanh has quit [Ping timeout: 265 seconds]
Fusl has quit [Max SendQ exceeded]
klaas has quit [Max SendQ exceeded]
kinduff[m] has quit [Ping timeout: 240 seconds]
linuus[m] has quit [Ping timeout: 240 seconds]
Fusl has joined #ruby
klaas has joined #ruby
Cubixusin[m] has quit [Ping timeout: 244 seconds]
Hanma[m] has quit [Ping timeout: 260 seconds]
swann11[m] has quit [Ping timeout: 260 seconds]
turt2live has quit [Ping timeout: 260 seconds]
itok has joined #ruby
JanHebler[m] has quit [Ping timeout: 265 seconds]
jo-so has quit [Ping timeout: 258 seconds]
ec has quit [Ping timeout: 265 seconds]
Jello_Raptor has joined #ruby
dviola has quit [Ping timeout: 272 seconds]
lightstalker has joined #ruby
sagax has joined #ruby
dviola has joined #ruby
serge[m] has quit [Ping timeout: 246 seconds]
ec has joined #ruby
DanielCarlsson[m has quit [Ping timeout: 260 seconds]
Emmanuel_Chanel has joined #ruby
dviola has left #ruby ["WeeChat 3.0"]
dviola has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has quit [Remote host closed the connection]
vondruch has quit [Ping timeout: 256 seconds]
lucasb has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ritsch_master has quit [Remote host closed the connection]
kristian_on_linu has quit [Remote host closed the connection]
Mrgoose has quit [Ping timeout: 260 seconds]
makara1 has quit [Ping timeout: 264 seconds]
postmodern has joined #ruby
asdasdzzzzzz has joined #ruby
<asdasdzzzzzz>
Hi guys. I am new to ruby on rails and I'm currently working on a react/rails app using webpack. Right now I want to deploy my app on heroku but I do not know the proper configuration to deploy it correctly. I have tried to deploy to heroku and only the backend works. Do you guys have any suggestions? :)
<adam12>
asdasdzzzzzz: Not much to go on. Frontend never loads? Frontend can't talk to backend?
<asdasdzzzzzz>
It loads, but it looks awful and it seems that my dependencies are not installed
<adam12>
asdasdzzzzzz: Errors in browser dev console?
<adam12>
Either paths are wrong or no asset precompile happened.
maryo has joined #ruby
bambanx has quit [Quit: Leaving]
naftilos76 has quit [Quit: Leaving]
maryo_87 has quit [Ping timeout: 264 seconds]
<asdasdzzzzzz>
So, how can I check if the paths are correct or not, or that no asset precompile happend. And how can I compile it? And thank you for your time :)
<asdasdzzzzzz>
About the errors in my console. I do not have errors
<adam12>
asdasdzzzzzz: Can you share your Heroku URL?
<asdasdzzzzzz>
Ok. In which script tag I should add 'defer', and why?
makara1 has joined #ruby
<adam12>
asdasdzzzzzz: I don't know. But my guess is that the script tag loads, the DOM isn't ready, so it just skips booting your React app. Deferring the script tag will wait for the DOM to be ready.
<adam12>
asdasdzzzzzz: But without errors and anything looking wrong, your guess is as good as mine :)
blackmesa has quit [Ping timeout: 265 seconds]
blackmesa has joined #ruby
Rudd0 has quit [Ping timeout: 246 seconds]
Technodrome has joined #ruby
mahlon_ has quit [Quit: WeeChat 3.0]
mahlon has joined #ruby
Edomaia6 has quit [Quit: Ping timeout (120 seconds)]
maryo has quit [Ping timeout: 240 seconds]
fandre1986 has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neshpion has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
gix has joined #ruby
fandre1986 has quit [Ping timeout: 240 seconds]
blackmesa has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
weaksauce has joined #ruby
dfucci has joined #ruby
Edomaia6 has joined #ruby
dinfuehr_ has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
jla has quit [Ping timeout: 256 seconds]
neshpion has quit [Quit: neshpion]
dfucci has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
jla has joined #ruby
jla has quit [Ping timeout: 246 seconds]
jla has joined #ruby
dfucci has joined #ruby
Taserface has joined #ruby
asdasdzzzzzz has quit [Quit: Leaving]
dfucci has quit [Ping timeout: 260 seconds]
Eiam has quit [Quit: (╯°□°)╯︵ ǝpouǝǝɹɟ]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Axy has quit [Ping timeout: 240 seconds]
stryek has quit []
neshpion has joined #ruby
jla has quit [Ping timeout: 256 seconds]
blackmesa has quit [Ping timeout: 264 seconds]
Eiam has joined #ruby
Rudd0 has joined #ruby
neshpion has quit [Quit: neshpion]
blackwhale has quit [Ping timeout: 246 seconds]
istrasci has joined #ruby
<istrasci>
Hello all, is there a way to check that a Hash has a key and the value is truthy that is quicker than `hash.key?(:key) && hash[:key]`? Or is checking `hash[:key]` enough?
<Taserface>
simply `hash[:key]` does that
<Taserface>
(if in doubt, try it in a RPEL)
<Taserface>
(*REPL)
ur5us has quit [Quit: Leaving]
neshpion has joined #ruby
claw has quit [Read error: Connection reset by peer]
ruby[bot] has quit [Remote host closed the connection]
madhatter has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
claw has joined #ruby
linoge has quit [Remote host closed the connection]