havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.0, 2.7.2, 2.6.6: 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
coniptor has quit [Ping timeout: 260 seconds]
coniptor has joined #ruby
<adam12> plujon: It shouldn't.
<plujon> adam12: If PLATFORMS contains 'ruby' and not 'x86_64-linux', bundler 2.2.2 on linux updates the Gemfile.lock.
<plujon> (upon bundle exec rackup)
<plujon> It adds the [missing?] platform, and changes the BUNDLED WITH value.
cthulchu has quit [Ping timeout: 272 seconds]
<adam12> plujon: Weird. I'm not sure I've noticed that before.
ellcs has quit [Ping timeout: 260 seconds]
stryek has quit [Quit: Connection closed for inactivity]
emptyflask has joined #ruby
Rounin has joined #ruby
dviola has quit [Quit: WeeChat 3.0]
roshanavand1 has joined #ruby
roshanavand1 has quit [Ping timeout: 246 seconds]
roshanavand has quit [Ping timeout: 264 seconds]
kwilczynski has quit [Ping timeout: 268 seconds]
cliluw has joined #ruby
DerekNonGeneric has quit [Ping timeout: 264 seconds]
fowl has quit [Ping timeout: 264 seconds]
DerekNonGeneric has joined #ruby
fowl has joined #ruby
kwilczynski has joined #ruby
cliluw has quit [Ping timeout: 264 seconds]
FastJack_ has joined #ruby
FastJack has quit [Ping timeout: 272 seconds]
Rudd0 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Remote host closed the connection]
Emmanuel_ChanelW has joined #ruby
gix has quit [Ping timeout: 264 seconds]
<havenwood> leah2: Yeah, but I haven't actually used it like I have async-io, async-http, async-websocket and friends.
<havenwood> mark1909: If you come back, just share a gist with what you'd like tested on macOS and there are plenty of folk here who will share results with you if they can.
<leah2> havenwood: i filed a bug ;)
coniptor has quit [Ping timeout: 265 seconds]
<havenwood> plujon: Yeah... `bundle check` and `bundle exec` do make changes to Gemfile.lock, which isn't intuitive to expect.
<havenwood> leah2: Hmmmm, interesting.
<leah2> i think either the pipe is wrong or i do something wrong
<havenwood> leah2: I don't spot anything wrong from the Issue but I'm not familiar enough for that to mean much.
<leah2> or the pipe is blocking for some reason
<leah2> but then 'yes' should still work
<havenwood> leah2: I like how little code async-process is... ioquatix is dang good at composing primitives. also a great mantainer so i'd expect a response.
Illianthe has quit [Quit: Leaving]
<havenwood> Too bad a Thread is necessary.
<havenwood> leah2: Yeah, I don't get why it's blocking.
coniptor has joined #ruby
<leah2> on linux one could use a pidfd instead :)
noizex has quit [Quit: No Ping reply in 180 seconds.]
noizex has joined #ruby
umjisus has quit [Ping timeout: 265 seconds]
umjisus has joined #ruby
eldritch has quit [Ping timeout: 260 seconds]
eldritch has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
znz_jp has quit [Remote host closed the connection]
znz_jp has joined #ruby
adu has joined #ruby
Rudd0 has joined #ruby
coniptor has quit [Ping timeout: 264 seconds]
_whitelogger has joined #ruby
coniptor has joined #ruby
m27frogy has quit [Ping timeout: 264 seconds]
coniptor has quit [Ping timeout: 265 seconds]
coniptor has joined #ruby
TomyWork has joined #ruby
_whitelogger has joined #ruby
plujon has quit [Quit: ERC (IRC client for Emacs 26.3)]
maryo has joined #ruby
adu has quit [Quit: adu]
chovy has joined #ruby
<chovy> what does this do? extra = args.join(",")[1...-1]
<chovy> i get the join but what's the [1...-1]
<leftylink> &ri Array#[]
<leftylink> we see that Array#[] may take a range argument
<leftylink> and we see from there what it will do with that range argument
<chovy> would this removef first and last character?
<leftylink> pinkpandabot: what's experiment?
<pinkpandabot> experiment is: I defer to an experiment-based approach, which will answer those questions far more effectively than I can
<leftylink> oh sorry
<leftylink> I was wrong, that's a String not an array
<leftylink> &ri String#[]
<leftylink> very sorry to have misled
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leftylink> we see that String#[] may take a Range argument, and we see from thsoe docs what a string will do with that range argument
<leftylink> so possible experiments to run are, using `irb`, run s[1...-1] for various values of s, and seeing what happens
<chovy> yup. that's the bug
<chovy> leftylink: fthanks
<chovy> been awhile since i did ruby
<leftylink> 👍
<chovy> 👍
ChmEarl has quit [Quit: Leaving]
swaggboi has quit [Ping timeout: 260 seconds]
FastJack_ has quit [Quit: leaving]
FastJack has joined #ruby
cliluw has joined #ruby
cliluw has quit [Ping timeout: 264 seconds]
jmcgnh has quit [Ping timeout: 256 seconds]
jmcgnh has joined #ruby
jack1901 has quit [Ping timeout: 260 seconds]
schaerli_ has joined #ruby
akem has quit [Ping timeout: 246 seconds]
SeepingN has joined #ruby
emptyflask has quit [Ping timeout: 264 seconds]
Emmanuel_ChanelW has quit [Read error: Connection reset by peer]
mozzarella has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Read error: Connection reset by peer]
jack1901 has joined #ruby
al2o3-cr has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
mozzarella has joined #ruby
swaggboi has joined #ruby
roshanavand has joined #ruby
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
roshanavand1 has joined #ruby
burgestrand has joined #ruby
orbyt_ has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
roshanavand1 is now known as roshanavand
Furai has quit [Quit: WeeChat 3.0]
Furai has joined #ruby
vondruch has joined #ruby
burgestrand has quit [Quit: burgestrand]
code_zombie has quit [Quit: Leaving]
burgestrand has joined #ruby
spacesuitdiver has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
roshanavand1 has joined #ruby
roshanavand has joined #ruby
TomyWork has quit [Remote host closed the connection]
TomyWork has joined #ruby
roshanavand1 has quit [Ping timeout: 264 seconds]
roshanavand has quit [Ping timeout: 264 seconds]
roshanavand has joined #ruby
jinie has quit [Quit: ZNC 1.8.2 - https://znc.in]
jack1901 has quit [Ping timeout: 264 seconds]
jinie has joined #ruby
deimos_ has joined #ruby
dfucci has joined #ruby
x0n has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
x0n has joined #ruby
cd has quit [Quit: cd]
catbeard has quit [Quit: The Lounge - https://thelounge.chat]
zapata has joined #ruby
phage has joined #ruby
roshanavand has quit [Ping timeout: 265 seconds]
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
naftilos76 has joined #ruby
<naftilos76> Hi, i have been trying to find a way to tel whether connecting to mysql was successfull or not but i couldn't. I used => db = ActiveRecord::Base.establish_connection() and then i tried db.connected? but even if i provided a fake db name the method connected? would always return true . Can anybody help?
<naftilos76> Is there another method that can tell whether all the options provided to the establish_connection were valid thus resulting to a valid connection?
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
extrowerk has left #ruby [#ruby]
akem has joined #ruby
snapcase_ has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
snapcase has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jack1901 has joined #ruby
dfucci has quit [Ping timeout: 265 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
burgestrand has quit [Quit: burgestrand]
akem has quit [Remote host closed the connection]
akem has joined #ruby
akem has quit [Remote host closed the connection]
vondruch has quit [Ping timeout: 240 seconds]
akem has joined #ruby
dfucci has joined #ruby
plant_enjoyer has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
bsdband33 has joined #ruby
bsdbandit-01 has quit [Ping timeout: 260 seconds]
bsdband33 has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
bsdbandit-01 has joined #ruby
schaerli__ has joined #ruby
akem_ has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
akem has quit [Ping timeout: 264 seconds]
schaerli_ has quit [Ping timeout: 260 seconds]
naftilos76 has quit [Quit: Leaving]
somazero has joined #ruby
somazero has quit [Client Quit]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
akem_ has quit [Remote host closed the connection]
akem_ has joined #ruby
plant_enjoyer has quit [Quit: Leaving]
akem_ has quit [Remote host closed the connection]
akem has joined #ruby
dfucci has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
somazero has joined #ruby
vondruch has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
m27frogy has joined #ruby
akem has quit [Ping timeout: 264 seconds]
jack1901 has quit [Ping timeout: 260 seconds]
schne1der has joined #ruby
dfucci has joined #ruby
somazero has quit [Quit: Leaving]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
vondruch has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
bsdbandit-01 has joined #ruby
rzjian has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
rzjian has quit [Quit: WeeChat 3.0]
rzjian has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
rzjian has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
bsdbandit-01 has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 272 seconds]
rzjian has joined #ruby
BTRE has quit [Remote host closed the connection]
naftilos76 has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
BTRE has joined #ruby
<naftilos76> Hi, i have been using net/smtp with my postfix server to send emails. That was until i setup an additional vps. Trying to use net/smtp in my second vps gives me an error : #<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)> . Is there a path where the certificate of the email server i am trying to use should be located? like in the same path with the ruby script?
<naftilos76> having an extension like .crt, pem or anything else?
prion has joined #ruby
<naftilos76> I could not find any references in ruby net/smtp class documentation
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
dfucci has joined #ruby
<adam12> naftilos76: Does it verify when conncting manually? ie with `openssl s_client`?
<naftilos76> i do not understand, is it something i should test in a terminal with openssl?
<adam12> naftilos76: Yeah. I don't know the incarnation off hand, but it's something like `openssl s_client -connect yourmailserver:yourmailport`
<naftilos76> ok let me try
<adam12> naftilos76: It won't say yay or nay, but maybe you can paste the output somewhere and we can see if the certificate chain is valid.
<naftilos76> does this mean anything to you?
<adam12> Doesnt' send any certificates.
dfucci has quit [Ping timeout: 272 seconds]
<naftilos76> i do not define where any certificate files are located in the ruby script that is using net/smtp
<adam12> Probably outside of the scope of this channel but either: setup a self signed cert or LetsEncrypt, or connect across the plaintext port.
<adam12> Nah. I think this is related to your postfix server.
<naftilos76> i have already got a ssl certificate
<naftilos76> question is
<adam12> naftilos76: It doesnt' look like it's being served correctly.
<adam12> naftilos76: What port did you use for connecting?
<naftilos76> where should i place it at the ruby script side i mean
<naftilos76> 587
<adam12> naftilos76: It doesn't belong on the ruby script side.
<adam12> naftilos76: The ruby script side will use the ca bundle that ships with your OS.
<adam12> Unless you have a self signed cert? But still, the output you pasted from openssl shows nothing being served up. Try it on another working URL (like google.com:443) and you'll see what I mean.
<naftilos76> ok thanks i will give it a try
<adam12> naftilos76: Do you have port 465 open? Maybe try the openssl command against that port.
<adam12> naftilos76: I think 465 is explicit TLS and 587 is STARTTLS.
<naftilos76> no i do not
<naftilos76> let me do the test with google first
<naftilos76> my bad
ellcs has joined #ruby
<naftilos76> i had 465 open and clearly i saw something being sent
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
dfucci has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
compufre_ has joined #ruby
<compufre_> Is ruby aware of cgroup memory limits? I seem to remember Java originally having some problems adjusting VM memory usage/GC originally
rzjian has quit [Quit: WeeChat 3.0]
<compufre_> Wondering in the context of rails processes potentially slowing down but not OOMing when there's memory pressure
bsdbandit-01 has joined #ruby
TomyWork has quit [Remote host closed the connection]
stryek has joined #ruby
Lynx_ has left #ruby [#ruby]
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
ellcs1 has joined #ruby
ellcs has quit [Read error: Connection reset by peer]
robotmay has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 264 seconds]
robotmay has joined #ruby
akem has joined #ruby
lucasb has joined #ruby
howdoi has joined #ruby
phage has quit [Ping timeout: 240 seconds]
cthulchu_ has joined #ruby
va5c0 has joined #ruby
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
ChmEarl has joined #ruby
linoge has joined #ruby
burgestrand has joined #ruby
spacesuitdiver has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Glumetu has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
<adam12> compufre_: I don't believe it is.
al2o3-cr-tmp has joined #ruby
<adam12> compufre_: If the process is slowing, maybe the GC is running too frequently? There's some tunables (like MALLOC_ARENA_MAX) that can sometimes help.
al2o3-cr has quit [Ping timeout: 256 seconds]
<compufre_> Yeah, about to explore--it's only happening in production afaik so was trying to get a little background before poking too much :)
al2o3-cr-null has joined #ruby
al2o3-cr-tmp has quit [Ping timeout: 256 seconds]
emptyflask has joined #ruby
prion has quit [Ping timeout: 260 seconds]
junaidnaseer2 has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
<naftilos76> adam12: finally all i had to do was to add the ca certificate to vps os. creating the file in /usr/share/ca-certificates and then running sudo dpkg-reconfigure ca-certificates
junaidnaseer2 has quit [Remote host closed the connection]
<naftilos76> and it just worked...
bsdbandit-01 has joined #ruby
jeromelanteri has joined #ruby
<adam12> naftilos76: Nice.
<adam12> naftilos76: What distro?
<naftilos76> ubuntu 16.04
vondruch has joined #ruby
tankf33der has joined #ruby
<adam12> naftilos76: Surprised the file didn't exist already. Assuming ca-certificates was installed
<naftilos76> yes i did check that ca certificates was already installed
<naftilos76> i was surprized too
<naftilos76> or maybe not
<naftilos76> this was a wildcard for all subdomains of my domain which i paid around 40-50 $ for a year
<adam12> /usr/share/ca-certificates is a folder on my Ubuntu machine.
Glumetu has left #ruby [#ruby]
<naftilos76> maybe it was too cheap
<adam12> naftilos76: Oh. You installed your cert there?
<naftilos76> yes
<adam12> Nah. I've used those certs before (AlphaSSL).
<adam12> I think that was the wrong location for your cert tho.
<adam12> can you curl google over https? `curl https://google.com`
<naftilos76> well i just followed a guide which looked straightforward which went very smoothly
<naftilos76> i get 301
<adam12> Ah OK. That's correct if it's working. I would of expected a certificate error if it wasn't.
<compufre_> what was the original issue..? (curious)
<naftilos76> i was using net/smtp trying to use my email server on another vps
<naftilos76> and after bought a second vps - leaving my email server on the first - i tried with as i said net/smtp gem and i got an error from openssl:
<naftilos76> #<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)>
<compufre_> ahh yeah so sometimes you need to include an intermediary with the cert on the server
<compufre_> that was the case with startssl when that was a thing
<naftilos76> after using OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE i got rid of the error
bsdbandit-01 has quit [Read error: Connection reset by peer]
<compufre_> my cert signed by intermediary signed by Root CA and only Root CA is trusted in the default trust store
schaerli__ has quit [Ping timeout: 264 seconds]
<naftilos76> but that was not something i would do in a production server
<compufre_> So then you just add intermediary to the cert file and it works without changing the trust store
<naftilos76> so i had to did deeper
bsdbandit-01 has joined #ruby
<naftilos76> to be honest i would have found the culprit earlier but at some point i realised i did not understand SSL/TLS very much so i watched a video and then i concluded that the missing ca certificate was probably the missing piece
<naftilos76> i am suggesting that i understand SSL/TLS well now :)
bsdbandit-01 has quit [Read error: Connection reset by peer]
<naftilos76> i am not (meant to say)
<compufre_> if you paid for a cert it seems strange you'd need to modify the default ca-certificates to include the CA
<naftilos76> well i got it from GoGetSSL
<naftilos76> i wanted something cheap - not sure if it was too cheap!
<compufre_> you can generate your own for free if you want to manually add them to the trust store
<naftilos76> well it something i intend to use on a public server
<naftilos76> that is why i had to buy it
<naftilos76> i have generated my own in many cases
<adam12> naftilos76: If you had already installed the .crt for Postfix, and it was causing errors, you likely just needed to cat the ca-bundle and cert from GoGetSSL together to build the chain.
<adam12> naftilos76: If this is working for you great, but I'm _suspicious_ of what you modified ;)
<naftilos76> modified where?
<naftilos76> in postfix conf files you mean?
<adam12> naftilos76: /usr/share/ca-certificates
<naftilos76> all i did was to create a dir in there then cp the ca cert i downloaded from gogetssl
<naftilos76> and then run sudo dpkg-reconfigure ca-certificate
<naftilos76> i got a text-mode config tool there showing all the ca certificates already installed with the one i cp right at the top UNCHECKED
<naftilos76> all i had to do was to check the one i cp and then tab to the ok button
<compufre_> yeah so you did a legit operation to install a new CA but I don't think you should have had to do that
<naftilos76> after a sec it tld me that one ca certificate was added to the trusted ones
<naftilos76> if you mean that it should have already been there - yes i agree
<naftilos76> it felt strange for me too
<naftilos76> the vps is a fresh install so i did not mesh things too much
<naftilos76> meaning installing/uninstalling packages etc
<adam12> Nah. None of that should of been necessary.
burgestrand has quit [Quit: burgestrand]
<adam12> I'm surprised it's working tbh.
<naftilos76> well to make it stranger - it worked in my first cps which is an ubuntu 14.04 distro
<naftilos76> without having to do al that add-ca-cert-process
<naftilos76> not sure if there was another path
<adam12> Your postfix config will have paths to pem / key files. If you didn't get a chain cert from GoGetSSL, you'd make one by `cat`ing your cert and their cert together (the order matters tho), and placing it in the .pem location for postfix. And you'd put your key there. That would make it work.
<naftilos76> this is where my not-so-deep-knowledge of ssl certs comes in play
<naftilos76> probably yes but i did not know how to do that
<adam12> If you were using your own CA and self-signing, then the installation of your own CA cert into /usr/share/ca-certificates would make sense. But since it's from a signer that has _some_ trust, it doesn't.
<adam12> naftilos76: I know. It's something that you learn through installing many certs :)
tankf33der has left #ruby [#ruby]
<naftilos76> really it was frustrating...i spent almost all day trying to find the culprit
<naftilos76> fortunately i had nothing else to do since i am unemployed! tada...
dfucci has joined #ruby
<naftilos76> i had to deal with all these issues after deciding i wanted to migrate to ruby 3.0.0 by the way but i was definitely worth it
<naftilos76> i got a huge performance boost
dfucci has quit [Ping timeout: 260 seconds]
prion has joined #ruby
va5c0 has quit [Ping timeout: 260 seconds]
ua has quit [Remote host closed the connection]
Sina has joined #ruby
dfucci has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
schne1der has quit [Ping timeout: 240 seconds]
vondruch has quit [Read error: Connection reset by peer]
ua has joined #ruby
SeepingN has joined #ruby
bvdw has quit [Quit: The Lounge - https://thelounge.chat]
bvdw has joined #ruby
BrianWGray has joined #ruby
kristian_on_linu has joined #ruby
impermanence has joined #ruby
naftilos76 has quit [Quit: Leaving]
somazero has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
schne1der has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
cow[moo] has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
ua has quit [Ping timeout: 264 seconds]
dfucci has quit [Ping timeout: 246 seconds]
ua has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
maryo87 has joined #ruby
dviola has joined #ruby
maryo has quit [Ping timeout: 260 seconds]
maryo87 has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
dfucci has joined #ruby
_aeris_ has quit [Remote host closed the connection]
maryo has joined #ruby
_aeris_ has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua is now known as ua_
bsdbandit-01 has joined #ruby
cd has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
spacesuitdiver has joined #ruby
dfucci has quit [Ping timeout: 272 seconds]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
jack1901 has joined #ruby
dfucci has joined #ruby
akem has quit [Ping timeout: 260 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
Rudd0 has quit [Ping timeout: 240 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
Iarfen has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
prion has quit [Ping timeout: 265 seconds]
TCZ has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
cliluw has quit [Ping timeout: 256 seconds]
maryo has quit [Ping timeout: 256 seconds]
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
akem has joined #ruby
schne1der has quit [Quit: schne1der]
kristian_on_linu has quit [Remote host closed the connection]
cliluw has joined #ruby
bsdbandit-01 has joined #ruby
jack1901 has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Client Quit]
Emmanuel_Chanel has quit [Read error: No route to host]
arahael has quit [Ping timeout: 256 seconds]
howaboutyes has joined #ruby
howaboutyes1 has joined #ruby
howaboutyes has quit [Client Quit]
howaboutyes1 has quit [Remote host closed the connection]
bsdbandit-01 has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
linoge has quit [Remote host closed the connection]
yokel has quit [Ping timeout: 240 seconds]
Rudd0 has joined #ruby
yokel has joined #ruby
cloud69 has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
jack1901 has joined #ruby
gix has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
orbyt_ has joined #ruby
jeromelanteri has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
ellcs has quit [Ping timeout: 264 seconds]
BSaboia has joined #ruby
somazero has quit [Quit: Leaving]
Emmanuel_Chanel has joined #ruby
somazero has joined #ruby
gueorgui_ is now known as gueorgui
TCZ has quit [Quit: Kindergarten is elsewhere!]
GankMove has joined #ruby
jack1901 has quit [Disconnected by services]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
plujon has joined #ruby
dionysus69 has joined #ruby
greengriminal has joined #ruby
cthulchu_ has quit [Ping timeout: 260 seconds]
<greengriminal> Hey all I'm dynamically trying to organise an array of hashes using their value. For example I have an input `[ {"x": 1, "y": 2, "z": 3}, {"x": 2, "y": 2, "z": 2} ]` and it is sorted by the number of keys you pass in for instance: `minByOrder(table8, ["x", "y", "z"])` returns "{"x": 1, "y": 2, "z": 3}" now I've got it working by doing: "table.sort_by{|hash| [hash[:x], hash[:y], hash[:z]]}.first"
<greengriminal> which works great. However what i'm trying to dynamically read in the column values by doing something like: `callers = columns.map{|c| "hash[#{c}]"}; table.sort_by{|hash| send(callers)}.first`
<greengriminal> note that the variable "columns" is an array of symbols "[:x, :y, :z]".
<greengriminal> Given the suggestion I'm going with it doesn't sit nice and I get: "TypeError: ["hash[x]", "hash[y]", "hash[z]"] is not a symbol nor a string"
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
cacheerror has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
TCZ has joined #ruby
<havenwood> greengriminal: Share a gist of your code? Do you have a minimal reproduction with desired result?
<havenwood> greengriminal: I don't follow the "dynamically read in the column values" part. Say more?
bsdbandit-01 has quit [Read error: Connection reset by peer]
BSaboia has quit [Quit: This computer has gone to sleep]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]