havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
ElFerna has quit [Ping timeout: 272 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
m3ssia has quit [Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in]
skryking has joined #ruby
thomas_25 has joined #ruby
skryking_ has quit [Ping timeout: 245 seconds]
agent_white has joined #ruby
cow[moo] has joined #ruby
psilly0 has quit [Quit: psilly0]
fkg has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu has quit [Ping timeout: 272 seconds]
bmurt has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
brool has joined #ruby
yann-kaelig has quit [Quit: yann-kaelig]
Technodrome has joined #ruby
bambanx has joined #ruby
amateur_rubyist has quit [Remote host closed the connection]
bambanx has quit [Client Quit]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanx has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 268 seconds]
cagomez has joined #ruby
fphilipe_ has joined #ruby
fkg has quit [Quit: Leaving]
fphilipe_ has quit [Ping timeout: 268 seconds]
schneider has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
jenrzzz_ has quit [Ping timeout: 272 seconds]
wildtrees has quit [Quit: Leaving]
jenrzzz has joined #ruby
Freshnuts has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
agent_white has quit [Quit: bbl]
tsujp has joined #ruby
AJA4350 has quit [Quit: AJA4350]
s3nd1v0g1us has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
john2496 has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
bmurt has joined #ruby
john2496 has quit [Ping timeout: 272 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
bambanx has quit [Quit: Leaving]
blizzow has joined #ruby
SeepingN has joined #ruby
troulouliou_div2 has joined #ruby
meinside has joined #ruby
troulouliou_div2 has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
fphilipe_ has joined #ruby
bmurt has quit [Client Quit]
fphilipe_ has quit [Ping timeout: 250 seconds]
brool has quit [Ping timeout: 264 seconds]
x86sk has joined #ruby
cagomez has quit []
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
mochiyoda has quit [Remote host closed the connection]
mochiyoda has joined #ruby
orbyt_ has joined #ruby
orbyt_ has quit [Client Quit]
code_zombie has quit [Quit: Leaving]
lalitmee has joined #ruby
dionysus69 has joined #ruby
SeepingN has joined #ruby
SeepingN has quit [Client Quit]
Azure|dc has quit [Read error: Connection reset by peer]
Azure has joined #ruby
dionysus69 has quit [Quit: dionysus69]
riceandbeans has joined #ruby
<riceandbeans> What is *foo in Ruby?
<riceandbeans> I just saw that for the first time today
<riceandbeans> list.first(*n)
<riceandbeans> Where n was a method arg
<leftylink> https://docs.ruby-lang.org/en/2.6.0/syntax/calling_methods_rdoc.html#label-Array+to+Arguments+Conversion says "You can turn an Array into an argument list with * (or splat) operator:
<riceandbeans> thanks leftylink
fphilipe_ has joined #ruby
oetjenj has joined #ruby
thomas_25 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has joined #ruby
lalitmee has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 272 seconds]
chalkmonster has quit [Quit: WeeChat 2.5]
tpanarch1st_ has quit [Quit: Thanks for your help, nice to see you, take care.]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
lalitmee has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
lalitmee has quit [Max SendQ exceeded]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
hiroaki has quit [Ping timeout: 258 seconds]
lalitmee has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
lalitmee has quit [Max SendQ exceeded]
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
jenrzzz has joined #ruby
esrse has joined #ruby
jottr has joined #ruby
Inline has quit [Quit: Leaving]
jottr has quit [Ping timeout: 248 seconds]
sauvin has joined #ruby
lalitmee has joined #ruby
greypack has quit [Ping timeout: 245 seconds]
thomas_25 has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
yasumi2136 has joined #ruby
greypack has joined #ruby
fphilipe_ has quit [Ping timeout: 276 seconds]
thomas_25 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenous_ has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
ravenous_ has quit [Ping timeout: 252 seconds]
jottr has quit [Ping timeout: 245 seconds]
emptyflask has quit [Ping timeout: 272 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe_ has joined #ruby
gigetoo has quit [Ping timeout: 248 seconds]
snickers has joined #ruby
xall has joined #ruby
bitwinery has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deepreds1 has joined #ruby
gigetoo has joined #ruby
xall has quit [Quit: xall]
leitz has joined #ruby
deepreds1 has quit [Ping timeout: 245 seconds]
galaxie has quit [Remote host closed the connection]
<leitz> With an "if/else" nested in a for loop, if a variable is set in one loop iteration, it is out of scope in the next iteration, correct?
galaxie has joined #ruby
suukim has joined #ruby
<phaul> no, if else does not make a lexical scope for locals. nor does for loops afaik
<leftylink> I thought "well crap, I don't know the answer since I've never used a for loop in Ruby ever". guess that can be my TIL for today?
<leitz> Let me post the code, it's from "Programming Ruby".
<leftylink> &24>> for i in 1..5; x = 3 if i == 3; puts x if i == 5; end
<rubydoc> # => 3 (https://carc.in/#/r/7gkh)
<leftylink> &24>> for i in 1..5; puts x if i == 5; x = 3 if i == 3; end
<rubydoc> stderr: -e:2:in `block in <main>': undefined local variable or method `x' for main:Object (NameError) (https://carc.in/#/r/7gkk)
<leftylink> lol :)
<leitz> It's way to early for me to get one-liners.
<leftylink> well it seems like you already have your answer then
<leftylink> since you already have the results in a comment
ged has quit [Ping timeout: 245 seconds]
<leitz> Yeah, I was just confused by it, and it's so early in the AM that I assumed I was wrong.
mahlon has quit [Ping timeout: 258 seconds]
<phaul> oh god. And I thought I had local vars figured out :D
<leitz> I'm still not sure why line 11 prints out what it does, with the "def" uncommented.
lxsameer has joined #ruby
<leftylink> well maybe it will become clearer if you switch the loop body to `if i == 1; a = 1; print "a=", a, "\n"; else print "a=", a, "\n" end`
<leitz> I would have thought it would print "a=Functionally 'a'\n\n"
<leftylink> I see, so you are wondering when things get evaluated. lazily or eagerly.
lalitmee has quit [Ping timeout: 244 seconds]
<leitz> Yes. The print statement seems to call the method before it prints "a=".
<leftylink> just like all functions in Ruby
<leftylink> s/all/all other/
<leftylink> since print is also a function
<leftylink> it acts like all other functions in this regard
<leftylink> if one wanted it to print "a=Functionally 'a'\n\n", then one should instead write `print "a="; print a; print "\n"
<leitz> My comprehension of lazy evaluation isn't strong enough to function at 3 AM.
mahlon has joined #ruby
<leitz> So the 'a' is nested, and print runs it first?
jottr has joined #ruby
<leftylink> https://ruby-doc.org/core-2.6.3/doc/syntax/calling_methods_rdoc.html#label-Arguments says "All arguments in ruby are passed by reference and are not lazily evaluated."
<leftylink> I don't know if there is any language-design reason why args are eagerly evaluated or if it was just "we had to choose one or the other so we chose eager"
<leftylink> so all I know right now is that this is the way it is
envex has quit []
<leitz> I'm mostly an apprentice level coder. Not really skilled enough to say it should be this, or that. Just trying to understand it.
<leitz> It's good to learn something.
deepreds1 has joined #ruby
jenrzzz has joined #ruby
ged has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
andikr has joined #ruby
<leitz> Okay, back later. Hopefully I can get some sleep.
jenrzzz has quit [Ping timeout: 258 seconds]
<leftylink> wow, while trying to figure shit out... it is... not pleasant if to_s does not return a string
<leftylink> I guess they figured "if anyone does that, they're asking for it"
<leftylink> yeah so since by definition the language eagerly evaluates, if you want lazy evaluation... uh I guess you can use thunks?
<leftylink> &24>> def a; print "THANK YOU FOR CALLING a, THE FUNCTION!!!"; 99 end; class Thunk def initialize(&b) @b=b end; def to_s; @b[].to_s end end; print Thunk.new { "a=" }, Thunk.new { a }, Thunk.new { "\n" }
<rubydoc> # => a=THANK YOU FOR CALLING a, THE FUNCTION!!!99 (https://carc.in/#/r/7gku)
<leftylink> woo hoo, I guess?
rsenic has joined #ruby
jottr has joined #ruby
snickers has joined #ruby
snickers has quit [Client Quit]
<leftylink> as the `for i in 1..5; x = 3 if i == 3; puts x if i == 5; end` and `for i in 1..5; puts x if i == 5; x = 3 if i == 3; end` examples showed though, another iteration of the loop doesn't cause the variables to go out of scope. but lexical rules still apply; can't use a variable at a point in the program that comes lexically before its definition
<leftylink> by the way this happens with `(1..5).each { |i| ... }` as well, which I suppose should not be any more suprising than the above
bitwinery has quit [Quit: Leaving]
<leftylink> &24>> (1..5).each { |i| x = 3 if i == 3; puts x if i == 5 }
<rubydoc> # => (https://carc.in/#/r/7gkv)
<phaul> right. It's the lexical appearance that counts, before any execution. that's why x = 1 if false still makes x declared
<leftylink> &24>> (1..5).each { |i| puts x if i == 5; x = 3 if i == 3 }
<rubydoc> stderr: -e:2:in `block in <main>': undefined local variable or method `x' for main:Object (NameError) (https://carc.in/#/r/7gkw)
rsenic has quit [Quit: Leaving]
<leftylink> also I polluted my irb the first time around lol
<phaul> I new the rules, but this loop thing managed to fool me ;)
<leftylink> it's my TIL for today
dionysus69 has joined #ruby
jottr has quit [Ping timeout: 272 seconds]
amateur_rubyist has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
<leftylink> btw
<leftylink> "correct! nil! wat"
<leftylink> totally relevant
cow[moo] has quit [Quit: Textual IRC Client: www.textualapp.com]
queip has quit [Ping timeout: 248 seconds]
lalitmee has joined #ruby
thomas_25 has joined #ruby
queip has joined #ruby
amateur_rubyist has quit [Remote host closed the connection]
rsenic has joined #ruby
rsenic has quit [Client Quit]
rsenic has joined #ruby
involans has joined #ruby
jenrzzz has joined #ruby
gregf_ has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
lalitmee has quit [Remote host closed the connection]
vircung has quit [Quit: Nothing to do here]
gregf_ has quit [Remote host closed the connection]
dbugger has joined #ruby
gigetoo has quit [Ping timeout: 245 seconds]
vircung has joined #ruby
gigetoo has joined #ruby
lalitmee has joined #ruby
lalitmee has quit [Max SendQ exceeded]
thomas_25 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lalitmee has joined #ruby
jenrzzz has joined #ruby
rsenic has quit [Ping timeout: 260 seconds]
Freshnuts has quit [Quit: Leaving]
ur5us_ has joined #ruby
ur5us_ has quit [Read error: Connection reset by peer]
amateur_rubyist has joined #ruby
ur5us_ has joined #ruby
amateur_rubyist has quit [Remote host closed the connection]
queip has quit [Ping timeout: 248 seconds]
amateur_rubyist has joined #ruby
thomas_25 has joined #ruby
thomas_25 has quit [Client Quit]
thomas_25 has joined #ruby
queip has joined #ruby
dbugger has quit [Remote host closed the connection]
dbugger has joined #ruby
ellcs has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
tdy has quit [Ping timeout: 248 seconds]
jottr has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
Doow has joined #ruby
<Doow> what's the current status of ruby gems for 2.6 on windows? https://rubyinstaller.org/ claims that support isn't very good yet, but that was in january. They have not posted any updates about it since then from what I can see.
john2496 has joined #ruby
john2496 has quit [Read error: Connection reset by peer]
john2496 has joined #ruby
john2496 has quit [Remote host closed the connection]
Swyper has joined #ruby
nius has quit [Ping timeout: 268 seconds]
nius has joined #ruby
jottr has quit [Ping timeout: 258 seconds]
dannysantos has joined #ruby
<dannysantos> I'm trying to write a jekyll plugin. hte language is ruby. Can someone help me with this question https://stackoverflow.com/questions/57653792/jekyll-plugin-how-to-convert-file ? Thank you for listening
schneider has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
x86sk has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
tsujp has joined #ruby
thomas_25 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsujp has quit [Ping timeout: 258 seconds]
schneider has quit [Ping timeout: 245 seconds]
Swyper has quit [Remote host closed the connection]
dionysus69 has quit [Remote host closed the connection]
yasumi2136 has quit [Remote host closed the connection]
Swyper has joined #ruby
thomas_25 has joined #ruby
thomas_25 has quit [Ping timeout: 268 seconds]
drnerdius has joined #ruby
drnerdius has quit [Client Quit]
dionysus69 has joined #ruby
drnerdius has joined #ruby
drnerdius has quit [Read error: Connection reset by peer]
drnerdius has joined #ruby
drnerdius has quit [Client Quit]
tsujp has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
al2o3-cr has quit [Ping timeout: 246 seconds]
esrse has quit [Ping timeout: 248 seconds]
Tuor has quit [Read error: Connection reset by peer]
Tuor has joined #ruby
Tuor has quit [Changing host]
Tuor has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
absolutejam has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
<dannysantos> no help, for newcomers...?
<mjacob> dannysantos: it's unclear what you're asking
ur5us_ has quit [Remote host closed the connection]
<dannysantos> ok mjacob
<dannysantos> you have read the stackoverflow link right?
<mjacob> yes
<dannysantos> ok
<dannysantos> so, ask me more to help me better explain it
<mjacob> dannysantos: what exactly doesn't work?
<dannysantos> well, I'm making an Jekyll Plugin... I don't know if you familiar with Jekyll...?
<mjacob> no, i'm not
<mjacob> it's probably a good idea to ask in #jekyll, if you haven't already
<dannysantos> yeah, those guys dont seem to know either how to hit the keyboard or reply to people
<dannysantos> ://
<dannysantos> probably is reply to people
<mjacob> dannysantos: irc is not a paid support channel
<mjacob> people might be in different time zones etc.
<dannysantos> yeah, irc is the right place because my plugin won't be paied also, i'm not receiving any money to write it, and it will be open-source
<dannysantos> ok
<mjacob> i'd suggest to wait for a few hours more
<dannysantos> yeah, already did that yestaerday without success
<dannysantos> me comming to #ruby is a desperate measure
<mjacob> in the stackoverflow question you're saying "I need help with this "Jekyll processing" part", but it's a bit unclear what doesn't work exactly
<dannysantos> ok :)
<phaul> is there a development forum for jekyl, maybe on github issues
tsujp has joined #ruby
<dannysantos> jekyll processes files that have front-matter and also processes .md and .scss and .sass files so what I meant is to do that processing. What is a better way to phrase this?
<dannysantos> render?
<phaul> dannysantos: there are a few options mentioned here https://jekyllrb.com/docs/community/
<phaul> it seems they are also on gitter, maybe it's more popular with them than irc
<dannysantos> ok phaul
<dannysantos> I will follow your advice
<dannysantos> thank you so much ;)
<dannysantos> good day phaul and mjacob
gigetoo has quit [Ping timeout: 268 seconds]
<mjacob> dannysantos: stackoverflow questions seem to work best when the structure is background, concrete question, and what you already tried
thomas_25 has joined #ruby
donofrio_ has quit [Remote host closed the connection]
<dannysantos> ok mjacob
gigetoo has joined #ruby
jottr has joined #ruby
donofrio has joined #ruby
grilix has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
al2o3-cr has joined #ruby
ElFerna has joined #ruby
dannysantos has quit [Remote host closed the connection]
jottr has joined #ruby
AJA4350 has joined #ruby
ElFerna has quit [Remote host closed the connection]
GodFather has joined #ruby
GodFather__ has joined #ruby
queip has quit [Ping timeout: 248 seconds]
DTZUZO has joined #ruby
lalitmee has quit [Read error: Connection reset by peer]
jottr has quit [Ping timeout: 268 seconds]
queip has joined #ruby
jottr has joined #ruby
GodFather has quit [Remote host closed the connection]
GodFather__ has quit [Remote host closed the connection]
GodFather has joined #ruby
lucasb has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.5]
<jhass> &>> puts "hi"
<rubydoc> stderr: playpen: timeout triggered! (https://carc.in/#/r/7glm)
<jhass> heh
<jhass> &>> puts "hi"
<rubydoc> # => hi (https://carc.in/#/r/7gln)
<jhass> phaul: ^ sorry it took me so long
<phaul> cool, thank you!
<phaul> np
<jhass> also no idea what's up with the machine, resource usage is actually fairly low
<phaul> that happened before as well, but we mostly just retried and then it worked
al2o3-cr has joined #ruby
<phaul> also 2.5 was affected
<phaul> &25>> :try
<rubydoc> stderr: playpen: timeout triggered! (https://carc.in/#/r/7glo)
<phaul> &25>> :again
<rubydoc> # => :again (https://carc.in/#/r/7glp)
<phaul> nice
<jhass> yeah I just regenerated all the wrappers
jenrzzz has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
grilix has quit [Ping timeout: 244 seconds]
krandi has joined #ruby
andikr has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
throstur has joined #ruby
<throstur> I have a problem with multiline string with double quote literal, I have an XML string with "quotes" inside it, all of it is enclosed in """ triple quotes """, what am I doing wrong?
<throstur> I read something about HEREDOC, is this use case right for that construct?
<throstur> (it seems to work, I'm just not confident about the usage being okay)
<adam12> throstur: I always prefer heredoc to tripple quotes. Bonus points if you can use a squiggly heredoc (> Ruby 2.3 I think?)
<throstur> thanks adam12! that's what I've ended up using for that more beautiful indentation
<adam12> >= Ruby 2.3 rather.
<throstur> could you recommend some ruby cheat-sheet resources that you like? I've just read why's poignant guide to ruby and that isn't exactly the best resource to look things up in :)
bmurt has joined #ruby
<adam12> throstur: The Ruby docs are tucked away but OK. Specifically: https://ruby-doc.org/core-2.6.3/
<throstur> thank you
<adam12> zverok has been working on something too I believe. Let me find the URL.
<adam12> throstur: Possibly this site too. https://rubyreferences.github.io/rubyref/
Francisco has joined #ruby
<adam12> throstur: The squiggly is specifically in literals. Also has a few other ways to create strings (tho I think Squiggly is best for you for this): https://ruby-doc.org/core-2.6.3/doc/syntax/literals_rdoc.html
Fr4n has quit [Ping timeout: 272 seconds]
jottr has quit [Ping timeout: 244 seconds]
<throstur> Thank you again, I should be set for now :)
<adam12> throstur: Cheers!
poontangmessiah has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Francisco has quit [Ping timeout: 268 seconds]
Fr4n has joined #ruby
suukim has quit [Quit: Konversation terminated!]
grilix has joined #ruby
sh7d_ has joined #ruby
sh7d has quit [Ping timeout: 268 seconds]
ElFerna has joined #ruby
ellcs has quit [Ping timeout: 246 seconds]
bmurt has joined #ruby
bmurt has quit [Client Quit]
SCHAPiE has quit [Quit: ZNC - https://znc.in]
krandi has quit [Quit: No Ping reply in 180 seconds.]
SCHAPiE has joined #ruby
andikr has joined #ruby
Rapture has joined #ruby
blizzow has quit [Ping timeout: 268 seconds]
ElFerna has quit [Read error: Connection reset by peer]
<havenwood> Think of how Clang feels!
<adam12> Heh
<phaul> C ... yuck ..
greengriminal has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
<leitz> I woke up around 0115 this morning. By 2-ish I was pulling out a Go lang book, but switched back to Ruby.
<nius> lol
<nius> go's cool
brool has joined #ruby
<phaul> Go to C is what Plan9 is to Unix :)
<leitz> nius, I was in a webinar by Jay McGavren; he wrote "Head First Ruby" and also "Head First Go". I asked if Go was as fast as Ruby in prototyping new code, he said that nothing is as fast as Ruby, for that.
<leitz> phaul, Go is to C what Linux is to Unix.
<havenwood> UNIX is to UNIX what UNIX is to UNIX.
* leitz thinks havenwood needs an "L" key...
<havenwood> LUNIX?
yann-kaelig has joined #ruby
<havenwood> Interesting looking at Dart's stab at the lonely person operator: https://github.com/dart-lang/language/issues/376
<havenwood> What they call the "null-aware token," apparently. It's the first time I've heard that one.
<havenwood> Ruby certainly isn't currently non-nilable by default.
john2496 has joined #ruby
iffraff has joined #ruby
akem-hp has joined #ruby
Fr4n has quit [Ping timeout: 258 seconds]
fran__ has joined #ruby
SeepingN has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
conta1 has joined #ruby
queip has quit [Ping timeout: 244 seconds]
za1b1tsu has joined #ruby
queip has joined #ruby
absolutejam has quit [Ping timeout: 246 seconds]
havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.4, 2.5.6, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
jenrzzz has joined #ruby
Inline has joined #ruby
conta1 has quit [Ping timeout: 272 seconds]
poontangmessiah has quit [Remote host closed the connection]
lalitmee has joined #ruby
reber has joined #ruby
dbugger has quit [Ping timeout: 264 seconds]
dbugger has joined #ruby
throstur has quit [Remote host closed the connection]
involans has quit [Quit: involans]
involans has joined #ruby
deepreds1 has quit [Ping timeout: 244 seconds]
deepreds1 has joined #ruby
andikr has quit [Remote host closed the connection]
fphilipe_ has quit [Ping timeout: 245 seconds]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
cthulchu_ has joined #ruby
lalitmee has quit [Ping timeout: 246 seconds]
deepreds1 has quit [Ping timeout: 244 seconds]
involans has quit [Quit: involans]
involans has joined #ruby
rippa has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
jottr has joined #ruby
wildtrees has joined #ruby
lalitmee has joined #ruby
wildtrees has quit [Max SendQ exceeded]
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
wildtrees has joined #ruby
lalitmee has quit [Ping timeout: 248 seconds]
lxsameer has quit [Quit: out]
queip has quit [Ping timeout: 246 seconds]
thomas_25 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lalitmee has joined #ruby
orbyt_ has joined #ruby
lalitmee has quit [Max SendQ exceeded]
lalitmee has joined #ruby
rsenic has joined #ruby
queip has joined #ruby
fran__ has quit [Quit: fran__]
psilly0 has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
nowhere_man has joined #ruby
<psilly0> hi all, i am using sequel gem to write one row in a DB. What would be a good spec test for this?
lalitmee has quit [Remote host closed the connection]
<phaul> psilly0: I think this depends. First thing that comes to mind: don't test that your gems do what they promise they do. A bunch of integration tests are good to make sure the app is put together correctly, but otherwise you can assume that sequel is bug free (from testing perspective)
<psilly0> would it be a good spec test to just open a db connection and read the table its going to write to?
<phaul> I think if you already buy into the idea of reaching the real DB with the tests, then you would need to set up a test DB rails style.
<phaul> A separate DB with predictable and fixed content prior to run each test case.
<phaul> Otherwise after some time you would end up with tests passing/failing based on test order
<phaul> But stubbing out the sequel layer altogether could also work.
<leitz> psilly0, doing what phaul says is something I'm learning. Everything I've seen says that it's the way to go, I'm just still getting up my "go".
sh7d_ has quit [Quit: meh]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has quit [Quit: Leaving]
sh7d has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
<psilly0> ok thanks all
<psilly0> i am very new to ruby
za1b1tsu has quit [Remote host closed the connection]
thomas_25 has joined #ruby
Tempesta has joined #ruby
orbyt_ has joined #ruby
orbyt_ has quit [Client Quit]
shwouchk has joined #ruby
gix has joined #ruby
kitallis- has joined #ruby
kitallis- has quit [Client Quit]
thomas_25 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thomas_25 has joined #ruby
wickedbloodfart has joined #ruby
orbyt_ has joined #ruby
amateur_rubyist has quit [Remote host closed the connection]
hiroaki has joined #ruby
amateur_rubyist has joined #ruby
r29v has joined #ruby
amateur_rubyist has quit [Ping timeout: 248 seconds]
amateur_rubyist has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amateur_rubyist has quit [Remote host closed the connection]
amateur_rubyist has joined #ruby
Ven`` has joined #ruby
amateur_rubyist has quit [Read error: Connection reset by peer]
ravenous_ has joined #ruby
jenrzzz has joined #ruby
za1b1tsu has joined #ruby
queip has quit [Ping timeout: 272 seconds]
kitallis| has joined #ruby
deepreds1 has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
<leftylink> so the scoping thing was my TIL for today, but I'm also wondering, "am I ever going to have an occasion to use this knowledge"
tdy has joined #ruby
<leftylink> well, none comes to mind immediately, but I guess that's the thing with some of these things. you just don't know, so you just have to file it away and hope it comes back to you at an appropriate time
<leftylink> and maybe more about building the intuition so that you can apply it to a wide variety of situations
<leftylink> "the scoping thing" being my messages from 07:03:58 today (it's 17:44 now)
queip has joined #ruby
deepredsky has joined #ruby
x86sk has joined #ruby
deepreds1 has quit [Ping timeout: 245 seconds]
Inline has joined #ruby
deepredsky has quit [Ping timeout: 272 seconds]
za1b1tsu has quit [Ping timeout: 245 seconds]
r29v has quit [Ping timeout: 248 seconds]
<nius> leftylink: what's that?
<nius> if/else having their own variable scopes?
jenrzzz has joined #ruby
za1b1tsu has joined #ruby
dionysus69 has joined #ruby
r29v has joined #ruby
ropeney_ has joined #ruby
ropeney has quit [Ping timeout: 258 seconds]
Freshnuts has joined #ruby
al-damiri has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
za1b1tsu has quit [Read error: Connection reset by peer]
za1b1tsu has joined #ruby
<phaul> nius: they don't have their own variable scope
<nius> ah but for loops do?
<phaul> no
<phaul> defs are lexical scopes and there are a bunch of others. blocks can make a scope with variables explicitly declared block local. But flow control structures aren't
<nius> why does above code result in "undefined local variable or method `a'" then, phaul?
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
<phaul> because if the declaration like a = 1 appears lexically (phisically in the source file) after the usage it is undeclared
<phaul> swap the useage and the declaration and it works
ellcs has joined #ruby
<phaul> what matters is where it is in the code, within a single lexical scope
<nius> oh just the physical location in the code matters?
<nius> why is it that way?
<phaul> yes. it's a confusing feature of Ruby
<phaul> things like a = 1 if false # make a declared! even if a = 1 doesn't ever run
<phaul> but only declared after it appears
<nius> that makes a bit more sense to me
<phaul> but this is the same with loops. while false; a = 1; end also makes a declared. But then it also doesn't matter on which iteration a = 1 happens
<phaul> if at all
tdy has quit [Ping timeout: 245 seconds]
<phaul> &>> while false; a = 1; end; a
<rubydoc> stderr: playpen: timeout triggered! (https://carc.in/#/r/7gnk)
<phaul> &>> while false; a = 1; end; a
<phaul> # => nil
<rubydoc> stderr: playpen: timeout triggered! (https://carc.in/#/r/7gnl)
<phaul> the other way around would throw exception: x = a; while false; a = 1; end # because it's *before* where its declared
SuperL4g has joined #ruby
<leftylink> and remember the famous
<leftylink> &>> a = a
<rubydoc> # => nil (https://carc.in/#/r/7gnm)
<leftylink> "correct! nil! wat."
<nius> lol
<phaul> oh yes. one of my favourites :)
SuperLag has quit [Ping timeout: 268 seconds]
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
grilix has quit [Ping timeout: 258 seconds]
rsenic_ has joined #ruby
rsenic has quit [Remote host closed the connection]
grilix has joined #ruby
leitz has quit [Quit: Leaving]
za1b1tsu has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
<leftylink> lol "In spite of these Ruby's behaviors, we have a good news! The present SAT sover does not suffer from the issues because the program cannot return solutions in practical time for inputs with variables more than 40.
<leftylink> best sentence I read today so far
<psilly0> HAHAHAHA [:)
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
dbugger has quit [Quit: Leaving]
retromode has joined #ruby
r29v has quit [Quit: r29v]
Ven`` has quit [Quit: Textual IRC Client: www.textualapp.com]
rippa has quit [Ping timeout: 245 seconds]
Ven`` has joined #ruby
ellcs has joined #ruby
rippa has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
wickedbloodfart has quit [Quit: wickedbloodfart]
dbugger has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
GodFather has quit [Ping timeout: 268 seconds]
za1b1tsu_ has joined #ruby
za1b1tsu_ has quit [Remote host closed the connection]
schneider has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
dbugger has quit [Quit: Leaving]
GodFather has joined #ruby
retromode has quit [Remote host closed the connection]
greengriminal has quit [Quit: Leaving]
jottr has joined #ruby
impermanence has joined #ruby
Rapture has joined #ruby
yann-kaelig has quit [Quit: yann-kaelig]
orbyt_ has joined #ruby
amateur_rubyist has joined #ruby
poontangmessiah has joined #ruby
poontangmessiah has quit [Max SendQ exceeded]
MrCrackPot has quit [Ping timeout: 268 seconds]
poontangmessiah has joined #ruby
gb_away has quit [Ping timeout: 245 seconds]
r29v has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
GodFather has quit [Ping timeout: 244 seconds]
poontangmessiah has quit [Remote host closed the connection]
poontangmessiah has joined #ruby
Tuor has quit [Ping timeout: 248 seconds]
GodFather has joined #ruby
emptyflask has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
Swyper has quit [Remote host closed the connection]
amateur_rubyist has quit [Remote host closed the connection]
ellcs has joined #ruby
absolutejam has joined #ruby
envex has joined #ruby
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
amateur_rubyist has joined #ruby
GodFather has quit [Ping timeout: 248 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grilix has quit [Ping timeout: 245 seconds]
grilix has joined #ruby
fphilipe_ has joined #ruby
schneider has quit [Ping timeout: 258 seconds]
x86sk has quit [Quit: Connection closed for inactivity]
robotcars has joined #ruby
<robotcars> service I use is going to deploy a breaking change tomorrow, and i'm trying to set the code up to switch to it without issue. the column is being renamed from 'name' to 'asset_name' and I want to ensure that right now it, uses name, but when asset_name is implemented I don't have to restart… it will just pick it up when the new messages are polled…
<robotcars> asset_name: body['asset_name']&.to_s || body['name']&.to_s,
<robotcars> is there anything wrong with doing it this way?
fphilipe_ has quit [Ping timeout: 245 seconds]
john2496 has quit [Remote host closed the connection]
<phaul> you are not talking about hot swapping code, right?
za1b1tsu has quit [Remote host closed the connection]
m3ssia has joined #ruby
<phaul> Oh I see I think, the code is already swapped to the new one, but the service will change later. got it.
<robotcars> i'm swapping code, table columns everything… this one line takes the value from the message
<robotcars> but I don't want there to be an interruption.. ie all real time traffic.
GodFather has joined #ruby
<robotcars> i dont want to restart the daemon to get the update and i want it to be seemless until i remove the old 'name'
<robotcars> so that's the edit I'm trying to make, all other refereces to 'name' are now 'asset_name', but the current messages are sending 'name', sometime in the next 24 hours it will send 'asset_name'
<havenwood> robotcars: A #fetch might be nice.
ellcs has quit [Ping timeout: 264 seconds]
<havenwood> robotcars: body.fetch('asset_name') { body['name'] }&.to_s
<robotcars> thanks havenwood. I will try that…
<robotcars> my way is working in test, but was wondering if there's a safer way
<phaul> or just (body['asset_name'] || body['name'])&.to_s ?
<robotcars> all 3 seem to work
absolutejam has quit [Ping timeout: 268 seconds]
<robotcars> thanks havenwood and phaul. i think I'm going with the fetch.
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
hays has quit [Ping timeout: 264 seconds]
<leftylink> hmm, those seem clear. if the problem were that the value could be at one of, say, 10 different keys, one would likely try somethng different, but with just two these all seem good
wildtrees has quit [Remote host closed the connection]
john2496 has joined #ruby
wildtrees has joined #ruby
sameerynho has joined #ruby
grilix has quit [Ping timeout: 272 seconds]
thomas_25 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cd has joined #ruby
reber has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 246 seconds]
sameerynho has quit [Ping timeout: 248 seconds]
jottr has joined #ruby
orbyt_ 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!]
a0s510 has joined #ruby
a0s510 has quit [Quit: Leaving]
a0s510 has joined #ruby
jinie has quit [Ping timeout: 268 seconds]
jottr has quit [Ping timeout: 268 seconds]
a0s510 has quit [Quit: Leaving]
a0s510 has joined #ruby
a0s510 has quit [Client Quit]
a0s510 has joined #ruby
jinie has joined #ruby
matthewd has quit [Ping timeout: 252 seconds]
matthewd has joined #ruby
aecepoglu[m] has quit [Ping timeout: 252 seconds]
iotatron[m] has quit [Ping timeout: 252 seconds]
teej has joined #ruby
aecepoglu[m] has joined #ruby
iotatron[m] has joined #ruby
a0s510 has quit [Quit: Leaving]
a0s510 has joined #ruby
SeepingN has joined #ruby
orbyt_ has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
Swyper has joined #ruby
<leftylink> ah yes I mentioned I managed to shoot myself in the foot and get confused when to_s doesn't return a string
<leftylink> so you should probably not do that
<leftylink> &>> class Thing; def initialize(x) @x = x end; def to_s; @x end end; puts "#{Thing.new(1)} #{Thing.new(?a)}"
<rubydoc> # => #<Thing:0x000056243a601d28> a (https://carc.in/#/r/7go6)
<leftylink> had me going "WAT???" for a few minutes until I figured out what was wrong
<leftylink> but
<leftylink> what is the deal here
<leftylink> does it just walk up until it finds a good to_s ?
Swyper has quit [Ping timeout: 272 seconds]
<leftylink> no, it does not just walk up
<leftylink> &>> class A; def to_s; ?a end end; class B < A; def to_s; :b end end; puts "#{B.new}"
<leftylink> if it just walked up, it would have shown A
<rubydoc> # => #<B:0x000055d017400ca8> (https://carc.in/#/r/7go7)
<leftylink> also laugh at me for doing `puts "#{x}"` instead of just `puts x`
Swyper has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Swyper has quit [Remote host closed the connection]
Nicmavr has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
CrazyEddy has quit [Ping timeout: 245 seconds]
Swyper has quit [Remote host closed the connection]
impermanence has quit [Ping timeout: 245 seconds]
akem-hp has quit [Remote host closed the connection]
akem-hp has joined #ruby
poontangmessiah has quit [Ping timeout: 272 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]