<havenwood>
I agree with the suggestion to use a REPL!
<havenwood>
?irb
<ruby[bot]>
irb is "interactive ruby", it is part of ruby. You can run ruby code and see results immediately. it's useful for testing code. Also see ?pry, a gem which is a popular alternative to irb.
<havenwood>
?pry
<ruby[bot]>
Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<Swyper>
leftylink: I don't see the problem if it was the exact same question, I haven't touched Ruby in a long time so I'm going through some altered versions of the same questions
<Swyper>
but yeah I should use pry, thanks
orbyt_ has joined #ruby
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
tdy has quit [Ping timeout: 255 seconds]
tdy has joined #ruby
faitswulff has quit [Ping timeout: 250 seconds]
tdy1 has joined #ruby
donofrio has joined #ruby
tdy1 has quit [Read error: Connection reset by peer]
tdy1 has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
tdy1 has quit [Read error: Connection reset by peer]
tdy1 has joined #ruby
donofrio has quit [Ping timeout: 245 seconds]
Swyper has quit [Remote host closed the connection]
tdy2 has joined #ruby
jyaworski has joined #ruby
tdy1 has quit [Ping timeout: 250 seconds]
jyaworski has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy2 has quit [Ping timeout: 250 seconds]
tdy3 has joined #ruby
Swyper has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
mangold has joined #ruby
tdy3 has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
blackmesa has joined #ruby
blackmesa1 has quit [Ping timeout: 258 seconds]
donofrio has joined #ruby
blackmesa has quit [Ping timeout: 258 seconds]
jyaworski has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
wolfshappen_ has quit [Ping timeout: 240 seconds]
donofrio has quit [Remote host closed the connection]
jyaworski has quit [Ping timeout: 246 seconds]
wolfshappen has joined #ruby
jyaworski has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
jyaworski has quit [Ping timeout: 246 seconds]
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
conta has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fusl has quit [Ping timeout: 256 seconds]
kapil____ has joined #ruby
Fusl has joined #ruby
faitswulff has joined #ruby
faitswulff has quit [Ping timeout: 264 seconds]
Swyper has quit [Remote host closed the connection]
crankharder has joined #ruby
dellavg__ has joined #ruby
conta has quit [Quit: conta]
t0xik has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
SeepingN has quit [Ping timeout: 255 seconds]
tdy1 has joined #ruby
rippa has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
tdy2 has joined #ruby
tdy2 has quit [Read error: Connection reset by peer]
tdy1 has quit [Ping timeout: 250 seconds]
tdy2 has joined #ruby
hiroaki_ has quit [Ping timeout: 250 seconds]
jyaworski has joined #ruby
jordanm has quit [Ping timeout: 250 seconds]
nwradio has quit [Read error: Connection reset by peer]
nwradio has joined #ruby
jyaworski has quit [Ping timeout: 246 seconds]
jordanm has joined #ruby
sauvin has joined #ruby
nwradio has quit [Quit: Ping timeout (120 seconds)]
nwradio has joined #ruby
agent_white has quit [Quit: latert]
jordanm has quit [Ping timeout: 268 seconds]
iMadper is now known as iMadper|MSGA
jordanm has joined #ruby
reber has joined #ruby
tdy3 has joined #ruby
tdy2 has quit [Ping timeout: 245 seconds]
tdy4 has joined #ruby
tdy has joined #ruby
tdy3 has quit [Ping timeout: 245 seconds]
tdy4 has quit [Ping timeout: 245 seconds]
tdy1 has joined #ruby
dellavg__ has quit [Ping timeout: 245 seconds]
tdy has quit [Ping timeout: 246 seconds]
iMadper|MSGA is now known as iMadper|Qiong
maufart__ has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
faitswulff has joined #ruby
ogres has joined #ruby
faitswulff has quit [Ping timeout: 250 seconds]
t0xik is now known as t0x
n13z has quit [Ping timeout: 246 seconds]
jyaworski has joined #ruby
reber has quit [Remote host closed the connection]
jyaworski has quit [Ping timeout: 250 seconds]
n13z has joined #ruby
aupadhye has joined #ruby
tdy1 has quit [Ping timeout: 240 seconds]
prestorium has joined #ruby
_whitelogger has joined #ruby
dionysus69 has joined #ruby
jyaworski has quit [Ping timeout: 244 seconds]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
aupadhye has quit [Remote host closed the connection]
bruce_lee has joined #ruby
renich has joined #ruby
aupadhye has joined #ruby
blackmesa has joined #ruby
aupadhye has quit [Remote host closed the connection]
akem has quit [Remote host closed the connection]
akem has joined #ruby
ansraliant has quit [Quit: My planet needs me]
aupadhye has joined #ruby
renich has quit [Quit: renich]
faitswulff has joined #ruby
luminous has quit []
faitswulff has quit [Ping timeout: 264 seconds]
olspookishmagus has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
lxsameer has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
al2o3-cr has quit [Quit: WeeChat 2.4]
adgtl- has quit [Ping timeout: 258 seconds]
cd has quit [Quit: cd]
adgtl has joined #ruby
al2o3-cr has joined #ruby
lunarkitty has quit [Ping timeout: 250 seconds]
adgtl has quit [Ping timeout: 255 seconds]
prestorium has quit [Quit: prestorium]
vondruch has joined #ruby
vondruch has quit [Client Quit]
tdy1 has quit [Ping timeout: 255 seconds]
apparition has joined #ruby
wolfshappen has quit [Ping timeout: 244 seconds]
adgtl has joined #ruby
crankharder has joined #ruby
lunarkitty has joined #ruby
wolfshappen has joined #ruby
Mike11 has joined #ruby
johnny56 has joined #ruby
postmodern has quit [Quit: Leaving]
chrisco has joined #ruby
cisco has joined #ruby
wildermind has joined #ruby
marmotini_ has joined #ruby
ropeney has quit [Ping timeout: 250 seconds]
chrisco has quit [Remote host closed the connection]
dellavg__ has joined #ruby
ropeney has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
am0123 has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.4]
faitswulff has joined #ruby
al2o3-cr has joined #ruby
Tuor has joined #ruby
faitswulff has quit [Ping timeout: 268 seconds]
beefjoe has joined #ruby
conta has joined #ruby
jyaworski has joined #ruby
conta has quit [Ping timeout: 250 seconds]
jyaworski has quit [Ping timeout: 255 seconds]
am0123 has quit [Ping timeout: 255 seconds]
arekushi has quit [Ping timeout: 250 seconds]
deathwishdave has joined #ruby
AJA4350 has joined #ruby
am0123 has joined #ruby
am0123 has quit [Ping timeout: 240 seconds]
Snowy has joined #ruby
conta has joined #ruby
jyaworski has joined #ruby
maufart__ has quit [Remote host closed the connection]
conta has quit [Ping timeout: 240 seconds]
jyaworski has quit [Ping timeout: 268 seconds]
camilasan has quit [Ping timeout: 250 seconds]
tjbp has quit [Remote host closed the connection]
tjbp has joined #ruby
jyaworski has joined #ruby
ldnunes has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.4]
Xiti has quit [Quit: Xiti]
blaguvest has joined #ruby
jyaworski has quit [Ping timeout: 246 seconds]
al2o3-cr has joined #ruby
camilasan has joined #ruby
queip has joined #ruby
Mike11 has quit [Quit: Leaving.]
Xiti has joined #ruby
themsay has joined #ruby
faitswulff has joined #ruby
grr12314 has joined #ruby
<grr12314>
wtf ruby, string.sum is giving me a different result from string.bytes.sum
<grr12314>
i wonder how many people fall into that trap tho
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower2 has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
deathwishdave has joined #ruby
gregf_ has quit [Ping timeout: 256 seconds]
aupadhye has joined #ruby
alem0lars has joined #ruby
gensym has joined #ruby
<gensym>
hi, n00b question: i want something like .dig() or safe navigation &. for strings as hashkeys. Both dig() and .& only works for :keys as hashkeys. Any idea?
<gensym>
something like h = {'foo'=>'bar'}; and h&.['foo']&.['baz']
<rubydoc>
stderr: -e:2:in `dig': Integer does not have #dig method (TypeError) (https://carc.in/#/r/6e1y)
marmotini_ has quit [Remote host closed the connection]
<phaul>
dig works under the assumption that the hash either contains right data. the last level there contains 1, which is not right for looking up 'd' in it.
<havenwood>
c-c: yeah, it seemed like a nice approach to me too
<havenwood>
c-c: I should maybe undeprecate ifuture now that Rob has revived ichannel.
<c-c>
yeah I started this rewrite because I kept having problems opening the pipe correctly, Should just open both ends at once and pass the handles around.
alem0lars has quit [Ping timeout: 250 seconds]
axsuul has joined #ruby
sameerynho has joined #ruby
cnsvc_ has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
jottr has joined #ruby
postmodern has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
cthulchu has joined #ruby
<barg>
would anybody use byebug over pry-byebug, if so, why?
<barg>
like, is pry-byebug meant to be an improvement like byebug with pry features?
tdy1 has joined #ruby
renich has joined #ruby
sauvin has quit [Remote host closed the connection]
<havenwood>
barg: The reason to use pry-byebug is all of pry's features.
<havenwood>
barg: The reason to use byebug alone is for the additional features that pry-byebug doesn't support.
themsay has joined #ruby
nchambers has joined #ruby
cnsvc_ has quit [Remote host closed the connection]
<leftylink>
amosbird: if you just want to concatenate them, not caring about uniqueness, the + operator will do. if you want to deduplicate, try | (or I guess you could + and then .uniq, but unnecessary!)
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
djdduty has joined #ruby
tdy1 is now known as tdy
AJA4350 has joined #ruby
skryking has quit [Quit: Leaving]
gravitation has joined #ruby
wilbert has joined #ruby
gravitation has quit [Client Quit]
tdy has quit [Ping timeout: 246 seconds]
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has joined #ruby
jottr has quit [Quit: WeeChat 2.3]
ams__ has quit [Quit: Connection closed for inactivity]
t0x has quit [Quit: Connection closed for inactivity]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Puppet_ has joined #ruby
cd has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Fernando-Basso has joined #ruby
ldnunes has quit [Quit: Leaving]
tdy has joined #ruby
AJA4350 has quit [Ping timeout: 255 seconds]
Fusl has quit [Excess Flood]
Fusl has joined #ruby
cnsvc_ has joined #ruby
themsay has joined #ruby
AJA4350 has joined #ruby
wilbert has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
bmurt has joined #ruby
sameerynho has quit [Ping timeout: 245 seconds]
tdy has quit [Ping timeout: 258 seconds]
moei has quit [Quit: Leaving...]
kapil____ has quit [Quit: Connection closed for inactivity]
orbyt_ has joined #ruby
jcalla has quit [Ping timeout: 244 seconds]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jyaworski has joined #ruby
timeless has quit [Disconnected by services]
_whitelogger has quit [*.net *.split]
teej has quit [*.net *.split]
ec has quit [*.net *.split]
SegFaultAX has quit [*.net *.split]
renich has quit [Ping timeout: 255 seconds]
_whitelogger has joined #ruby
<Darmani>
I need to look at the sort_by documentation.
<leftylink>
nevertheless, yes, reading about sort_by is still encouraged
<leftylink>
sort_by will not explicitly mention what's going on when you have its block yield an array, but it is the consequence of the fact of how arrays compare against each other
sagax has quit [Ping timeout: 245 seconds]
<Darmani>
Bear with me guys
<Darmani>
What's the correct way to write line 12?
jyaworski has quit [Ping timeout: 268 seconds]
<havenwood>
barg: For example, if you want to go right into exploring the stack without executing any code. You can just give the filename with `byebug` like `byebug hola.rb`. I'd image most folk use pry-byebug since Pry is popular.
<leftylink>
if it is a requirement tha tyou use <=>, I suppose you'd have to say `something <=> other.something`, where the `something` is what we discussed above w/ the two-element array
<leftylink>
in which case sort_by would not come into play
<leftylink>
sort_by would only come into play if we have something like `%w(A+ F B- B B+).sort_by { |g| ... }`
<Darmani>
leftylink: It's not a requirement. I've just never done this before.