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!
witlesswonder has quit [Remote host closed the connection]
witlesswonder has joined #ruby
roaet has quit [Ping timeout: 265 seconds]
witlesswonder has quit [Ping timeout: 260 seconds]
ElFerna has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
witlesswonder has joined #ruby
Jonopoly has quit [Ping timeout: 265 seconds]
banisterfiend has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
Jonopoly has joined #ruby
fredolinhares has joined #ruby
Guest51714 has quit [Ping timeout: 276 seconds]
banisterfiend has joined #ruby
ap4y has quit [Ping timeout: 276 seconds]
gell5 has joined #ruby
BrenoPerucchi has joined #ruby
banister_ has joined #ruby
tdy has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
banisterfiend has quit [Ping timeout: 245 seconds]
bhaak has quit [Ping timeout: 276 seconds]
<BrenoPerucchi> https://dpaste.de/7Dhp try this regex with ruby 2.6.4 but https://rubular.com/ works. :/ ??
ElFerna has quit [Quit: ElFerna]
gell5 has quit [Ping timeout: 276 seconds]
jmcgnh has quit [Ping timeout: 240 seconds]
jmcgnh has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davor_ has joined #ruby
davor has quit [Ping timeout: 246 seconds]
davor_ is now known as davor
<Iambchop> &>> "UsdChf sell now @ 0.9915\nSl @ 1.0015 \nTp1 @ 0.9885\nTp2 @ 0.9830".match(/(@(.*?)$)/m)
<rubydoc> # => #<MatchData "@ 0.9915" 1:"@ 0.9915" 2:" 0.9915"> (https://carc.in/#/r/7jzy)
ElFerna has joined #ruby
<Iambchop> the rubular test regex is different than the one in the paste
<Iambchop> BrenoPerucchi: ^
bruce_lee has quit [Ping timeout: 240 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
codefriar has joined #ruby
cnsvc has joined #ruby
ElFerna has quit [Quit: ElFerna]
cthulchu has quit [Ping timeout: 276 seconds]
duderonomy has joined #ruby
jenrzzz has joined #ruby
ElFerna has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
drincruz has quit [Ping timeout: 240 seconds]
BrenoPerucchi has quit [Remote host closed the connection]
throstur_ has quit [Ping timeout: 246 seconds]
gell5 has joined #ruby
throstur_ has joined #ruby
BrenoPerucchi has joined #ruby
CPngN has quit [Quit: The system is going down for reboot NOW!]
gell5 has quit [Ping timeout: 240 seconds]
<BrenoPerucchi> thanks Iambchop
ap4y has joined #ruby
ap4y has quit [Remote host closed the connection]
ap4y has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<BrenoPerucchi> .msg Iambchop thanks
ElFerna has quit [Ping timeout: 276 seconds]
codefriar has quit [Quit: Textual IRC Client: www.textualapp.com]
codefriar has joined #ruby
_whitelogger has joined #ruby
duderonomy has joined #ruby
sounx has joined #ruby
duderonomy has quit [Client Quit]
elphe has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
sounx has quit [Quit: leaving]
jenrzzz has quit [Ping timeout: 276 seconds]
alfiemax has joined #ruby
cthulchu has quit [Ping timeout: 276 seconds]
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
GodFather has quit [Ping timeout: 276 seconds]
poontangmessiah has joined #ruby
grilix has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
r29v has joined #ruby
tdy has joined #ruby
AJA4350 has quit [Quit: AJA4350]
elphe has quit [Ping timeout: 246 seconds]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fredolinhares has quit [Quit: WeeChat 1.9.1]
hutch has joined #ruby
gell5 has joined #ruby
SeepingN has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
throstur_ has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
witlesswonder has quit [Quit: Leaving]
gell5 has quit [Ping timeout: 240 seconds]
hutch has quit [Ping timeout: 276 seconds]
gix- has joined #ruby
gix has quit [Disconnected by services]
alfiemax has joined #ruby
absolutejam1 has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
absolutejam1 has quit [Ping timeout: 246 seconds]
grilix has joined #ruby
DTZUZU has quit [Quit: WeeChat 2.2]
duderonomy has joined #ruby
DTZUZU has joined #ruby
BrenoPerucchi has quit [Remote host closed the connection]
hutch has joined #ruby
jenrzzz has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donofrio has quit [Remote host closed the connection]
MrCrackPot has joined #ruby
Tempesta has joined #ruby
poontangmessiah_ has joined #ruby
ap4y has quit [Ping timeout: 246 seconds]
poontangmessiah has quit [Ping timeout: 265 seconds]
tdy has quit [Ping timeout: 246 seconds]
regedit has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 265 seconds]
hutch has quit [Ping timeout: 246 seconds]
SuperLag has joined #ruby
SuperL4g has quit [Ping timeout: 276 seconds]
grilix has quit [Ping timeout: 245 seconds]
duckpupp- has joined #ruby
duckpuppy has quit [Ping timeout: 276 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
sauvin has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
oetjenj has joined #ruby
vondruch has quit [Quit: vondruch]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has joined #ruby
tpendragon has quit [Quit: ZNC - http://znc.in]
bhaak has joined #ruby
duderonomy has joined #ruby
duderonomy is now known as Guest1497
Guest1497 has quit [Client Quit]
schaerli has joined #ruby
gell5 has joined #ruby
jemish has joined #ruby
tsujp has joined #ruby
r29v has quit [Quit: r29v]
tdy has joined #ruby
r29v has joined #ruby
r29v has quit [Client Quit]
gell5 has quit [Ping timeout: 265 seconds]
tdy has quit [Ping timeout: 246 seconds]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
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]
Inline has quit [Quit: Leaving]
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]
alfiemax has quit [Remote host closed the connection]
oetjenj has joined #ruby
alfiemax 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]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
emptyflask has quit [Ping timeout: 276 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
absolutejam1 has joined #ruby
oetjenj has joined #ruby
bitwinery has joined #ruby
oetjenj has quit [Client Quit]
roaet has joined #ruby
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]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
roaet has quit [Ping timeout: 276 seconds]
queip has quit [Ping timeout: 265 seconds]
queip has joined #ruby
banisterfiend has joined #ruby
jmcgnh has quit [Ping timeout: 265 seconds]
jmcgnh has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
dionysus69 has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
alfiemax has quit [Remote host closed the connection]
banister_ has joined #ruby
banister_ has quit [Client Quit]
banisterfiend has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
banisterfiend has joined #ruby
alfiemax has joined #ruby
absolutejam1 has quit [Ping timeout: 265 seconds]
banisterfiend has quit [Ping timeout: 240 seconds]
banisterfiend has joined #ruby
schne1der has joined #ruby
TomyWork has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Intelo has quit [Remote host closed the connection]
queip has quit [Ping timeout: 276 seconds]
banisterfiend has joined #ruby
dbugger has joined #ruby
pradiprwt has joined #ruby
queip has joined #ruby
levifig has quit [Ping timeout: 246 seconds]
<pradiprwt> Hi Everyone, I am planning to upgrade my ruby to latest stable version. The current version is "ruby 2.0.0p648 (2015-12-16)" which is pretty old and the application which is using the ruby that is also old. Can any one please suggest me what are the things I need to consider while upgrading the ruby.
nowhere_man has quit [Ping timeout: 276 seconds]
<pradiprwt> And What is the latest stable version I should go for ?
<phaul> 2.6.4. I beleive there is no general rule there, you just try and see. A thorough test suite can give you confidence. Many gem dependencies can make it a nightmare
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 245 seconds]
queip has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
banisterfiend has joined #ruby
absolutejam1 has joined #ruby
queip has joined #ruby
tdy has joined #ruby
cd has quit [Quit: cd]
<pradiprwt> Thanks for reply @phaul , It is installed on centos 7. Just trying find the clean way to upgrade from older to new.
gell5 has joined #ruby
thexa4 has joined #ruby
gell5 has quit [Ping timeout: 276 seconds]
Huck777 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has joined #ruby
ravenousmoose has quit [Ping timeout: 246 seconds]
<Teckuro> Morning all
envex has joined #ruby
gix- has quit [Ping timeout: 265 seconds]
alfiemax has quit [Remote host closed the connection]
banister_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banister_ has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
alfiemax has joined #ruby
ravenousmoose has joined #ruby
x86sk has joined #ruby
fphilipe has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
Intelo has joined #ruby
jud has joined #ruby
ravenousmoose has quit [Ping timeout: 246 seconds]
reber has joined #ruby
throstur_ has joined #ruby
throstur_ is now known as throstur
user01 has joined #ruby
<user01> Hi all
user01 is now known as Guest48946
<Guest48946> Can someone help me with FFI?
<Guest48946> How to import .Net library with FFI?
stooj has quit [Quit: ZNC 1.7.3 - https://znc.in]
stooj has joined #ruby
<Guest48946> .Net dll eg. System.Drawing
levifig has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
tsujp has joined #ruby
<Guest48946> anyone? :)
tdy has quit [Ping timeout: 240 seconds]
involans has joined #ruby
deathwishdave has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bitwinery has quit [Quit: Leaving]
deathwishdave has quit [Read error: Connection reset by peer]
snickers has joined #ruby
schne1der has quit [Remote host closed the connection]
witlesswonder has joined #ruby
schne1der has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has joined #ruby
ravenousmoose has joined #ruby
deathwishdave has joined #ruby
ravenousmoose has quit [Ping timeout: 246 seconds]
ellcs has joined #ruby
Guest48946 has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
gell5 has joined #ruby
gell5 has quit [Ping timeout: 240 seconds]
zapata has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
roaet has joined #ruby
roaet has quit [Ping timeout: 240 seconds]
johnny56 has joined #ruby
ElFerna has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
Nicmavr has joined #ruby
queip has quit [Ping timeout: 276 seconds]
queip has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
jenrzzz has joined #ruby
toomus_ has joined #ruby
<throstur> can someone help me, I'm having a brain fart, I am doing transitions.map { |tr| {tr['name'] => tr['id'] } to create a reverse map from name back to ID, but I get an array instead of a hash, what am I doing wrong?
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
Fernando-Basso has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
<phaul> map returns arrays.
ElFerna has quit [Quit: ElFerna]
<phaul> you can pass a block with new ruby to to_h
<toomus_> Does anyone know how to import .Net dll using ffi into ruby?
<throstur> hmm.. maybe map isn't what I want then, honestly
<phaul> &ri Enumerable#to_h, throstur
<throstur> I actually already have a hash { "id" => foo, "name" => bar } and I'm just trying to find foo from bar
<throstur> I think what I'm trying definitely isn't best practise
<phaul> I don't understand the relation between foo and bar in that example
<throstur> well, I have an array of hashes that is
fphilipe has quit [Read error: Connection reset by peer]
<throstur> I have [ {"id", "name"}, {"id2", "name2"} ] and I want to find idX from nameX
<throstur> where the values are always keyed as "id" and "name"
<phaul> don't you mean finding id from foo? and name from bar?
<throstur> no, I have the "name" (bar) and I want to find the "id" (foo)
<throstur> in an array of hashes
<throstur> I don't know why my brain is broken today
<phaul> sorry. I don't get what the task is, if you give us an example input and a desired output we can help. Just make sure it's syntactically correct. [ {"id", "name"}, {"id2", "name2"} ] is not a valid expression
<throstur> sure, give me a second
cyclonis has joined #ruby
<leftylink> there seems to be something implicit here. because if the task was just to fid the id corresponding to one name, then you would just use Enumerable#find and that's it. but it seems to be impleid that one would want to look up multiple of them and wants the lookup to be fast
ElFerna has joined #ruby
<leftylink> a reminder that in 2.6.4, Enumerable#to_h takes a block and can be thought of as map followed by to_h.
<throstur> leftylink: that might just be it, as I said, my brain is a bit broken today, I was feeling a bit ill yesterday and maybe that's my problem
<leftylink> er, in 2.6.x
<throstur> I'll check out the docs and see if it works
<phaul> sometimes things have to be said twice :)
<throstur> yeah that was it leftylink
<throstur> thank you
<throstur> I didn't realize that enumerable had that find method, definitely all I was looking for really
AJA4350 has joined #ruby
<phaul> &>> [{"id" => 1, "name": "giraffe" }, {"id" => 3, "name": "elephant"}, {"id" => 2, "name": "goose" }].to_h {|h| [h[:name], h['id']]}
<rubydoc> # => {"giraffe"=>1, "elephant"=>3, "goose"=>2} (https://carc.in/#/r/7k1r)
gnufied has joined #ruby
Huck777 has joined #ruby
Huck777 has quit [Remote host closed the connection]
Huck777 has joined #ruby
toomus_ has quit [Remote host closed the connection]
absolutejam1 has quit [Ping timeout: 246 seconds]
deathwishdave has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: WeeChat 2.5]
ElFerna has quit [Quit: ElFerna]
ElFerna has joined #ruby
ElFerna has quit [Quit: ElFerna]
queip has quit [Ping timeout: 240 seconds]
ElFerna has joined #ruby
DTZUZO has quit [Ping timeout: 246 seconds]
ElFerna has quit [Client Quit]
queip has joined #ruby
DTZUZO has joined #ruby
x86sk has quit [Quit: Connection closed for inactivity]
deathwishdave has joined #ruby
suukim has joined #ruby
absolutejam1 has joined #ruby
fphilipe has joined #ruby
absolutejam1 has quit [Ping timeout: 246 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
Fernando-Basso has quit [Remote host closed the connection]
gell5 has joined #ruby
absolutejam1 has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
snickers has quit [Read error: Connection reset by peer]
fphilipe has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
absolutejam1 has quit [Ping timeout: 265 seconds]
gell5 has quit [Ping timeout: 245 seconds]
Fernando-Basso has joined #ruby
wild_buffalo has joined #ruby
pradiprwt has quit [Remote host closed the connection]
donofrio has joined #ruby
chalkmonster has joined #ruby
lucasb has joined #ruby
loveablelobster has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
absolutejam1 has joined #ruby
ElFerna has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
dinfuehr has quit [Ping timeout: 245 seconds]
arahael2 has joined #ruby
arahael1 has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
loveablelobster has quit [Quit: Textual IRC Client: www.textualapp.com]
cow[moo] has joined #ruby
DTZUZO has joined #ruby
absolutejam1 has quit [Ping timeout: 246 seconds]
absolutejam1 has joined #ruby
stryek has joined #ruby
involans has quit [Quit: involans]
ElFerna has quit [Quit: ElFerna]
ElFerna has joined #ruby
ElFerna has quit [Client Quit]
<throstur> &>> arr = ['a', 'b', 'c'] ; arr.delete('a') ; puts(a)
<rubydoc> stderr: -e:2:in `<main>': undefined local variable or method `a' for main:Object (NameError) (https://carc.in/#/r/7k1y)
<throstur> &>> arr = ['a', 'b', 'c'] ; arr.delete('a') ; puts(arr)
<rubydoc> # => b (https://carc.in/#/r/7k1z)
<throstur> wat
DTZUZO has quit [Ping timeout: 240 seconds]
<throstur> nevermind, works in irb
jcalla has joined #ruby
MrCrackPot has quit [Read error: Connection reset by peer]
MrCrackPot has joined #ruby
tpanarch1st has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
roaet has joined #ruby
howdoi has joined #ruby
<phaul> multiline stdout only shows the first line of output. see the rest from the link
<phaul> &>> arr = ['a', 'b', 'c'] ; arr.delete('a') ; a
<rubydoc> stderr: -e:2:in `<main>': undefined local variable or method `a' for main:Object (NameError) (https://carc.in/#/r/7k21)
<phaul> &>> arr = ['a', 'b', 'c'] ; arr.delete('a') ; arr
<rubydoc> # => ["b", "c"] (https://carc.in/#/r/7k22)
arahael2 is now known as Arahael
codefriar has joined #ruby
<kapil_> i cont understand second and third line
<kapil_> how its using `,`?
FrankDW has joined #ruby
<ule> kapil_: the first variable is a method
<ule> kapil_: the last 2 variables are parameters of that method
<ule> something like: derive_estimated_hours(ancestor, leaves)
<kapil_> thanks a lot
<ule> np!
yann-kaelig has joined #ruby
DTZUZO has joined #ruby
tsr has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
jrafanie has joined #ruby
dbugger has quit [Quit: Leaving]
Azure has quit [Read error: Connection reset by peer]
hutch has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
SeepingN has joined #ruby
dasher00 has joined #ruby
involans has joined #ruby
involans has quit [Client Quit]
involans has joined #ruby
gell5 has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
drincruz has joined #ruby
gell5 has quit [Ping timeout: 265 seconds]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
codefriar has quit [Quit: Textual IRC Client: www.textualapp.com]
hutch has quit [Ping timeout: 246 seconds]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
<throstur> I have a bunch of places where I create a new jira api object and do stuff with it, all of it is inside begin rescue end blocks, is there some smart thing I can do so that errors from that object are ignored, i.e. if I just do something like my_magic_jira = magic_wrap(japi.new(...)); then everywhere where I use my_magic_jira it can fail without raising errors?
<throstur> my use case is basically, we want it to work, but if it fails, it's not the end of the world, and the code stops being readable with all these blocks everywhere
roaet has quit [Ping timeout: 240 seconds]
d^sh has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
jacksoow has quit [Read error: Connection reset by peer]
jacksoow has joined #ruby
hutch has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
dasher00 has quit [Ping timeout: 265 seconds]
jemish has quit [Remote host closed the connection]
yann-kaelig has quit [Quit: yann-kaelig]
ravenousmoose has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
involans_ has joined #ruby
involans has quit [Quit: involans]
involans_ is now known as involans
TomyWork has quit [Remote host closed the connection]
grilix has joined #ruby
<NL3limin4t0r> kapil_: Writing that line with parentheses would look like: `inherit_done_ratio(ancestor, leaves) if inherit?(attributes, :done_ratio)`
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
DaRock has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby
ua_ has quit [Ping timeout: 268 seconds]
<kapil_> oh thats a not
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
<kapil_> can i see `unless revisions.nil?` added to while block. what does it do?
Salve has joined #ruby
emptyflask has joined #ruby
<havenwood> throstur: def magic_wrap; yield rescue JiraError end; magic_wrap { raise JiraError }
<havenwood> throstur: (but the real errors you want to rescue)
<havenwood> throstur: There are many other ways to do it.
schaerli has quit [Ping timeout: 276 seconds]
emptyflask has quit [Ping timeout: 265 seconds]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
<ule> throstur: you could use: rescue_from and catch those exceptions globally or from a base controller
Esa_ has joined #ruby
<ule> so you just need to do that in one single method VS having to add one multple catch exceptions inside each controller
emptyflask has joined #ruby
hrhsh has joined #ruby
<havenwood> throstur: or even use DelegateClass
<throstur> thank you... food for thought :) I'll explore this further now that I have ammunition for my google fu
hrhsh has quit [Client Quit]
<kapil_> I am trying to change existing ruby program to c++
<kapil_> is it good?
<havenwood> kapil_: is it good that you're doing that?
<havenwood> kapil_: you're rewriting some Ruby code in C++?
<havenwood> kapil_: What's the purpose? Learning?
<kapil_> no, its a very big project
<kapil_> because i know c++ and not know ruby properly
<havenwood> kapil_: You're rewriting a "very big project" from Ruby to C++ and want to know if that's good?
Azure has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
<kapil_> I am trying, hoping i will be sussessfull
<havenwood> kapil_: This is for work, not for fun?
<kapil_> its for work
<havenwood> kapil_: I'm surprised they're okay with you rewriting a huge codebase. ¯\_(ツ)_/¯
<havenwood> kapil_: Good luck!
<throstur> hehe, I tend to agree, suprised they're okay with it
<kapil_> :)
<kapil_> why surprised?
<kapil_> c++ will give more performance.
<havenwood> kapil_: will it?
<havenwood> kapil_: Is it not performing?
Intelo has quit [Remote host closed the connection]
<havenwood> kapil_: Is it I/O or CPU bound?
<kapil_> its performing right, its a rails project.
<kapil_> but i am trying new morden c++
absolutejam1 has quit [Ping timeout: 265 seconds]
<kapil_> it is lots of work
<havenwood> kapil_: So you're going to do lots of work to end up with the same thing you already have, if you succeed.
<kapil_> yes
<havenwood> If you fail, you've done lots of work to end up with something worse.
<phaul> well as long as they pay yoou for it ... ;)
<havenwood> ^
<kapil_> i am failed so many times. so this is normal to me
<phaul> lol
<havenwood> hmm
<kapil_> they will not pay if i am failed
yann-kaelig has joined #ruby
<havenwood> kapil_: It sounds like you might just want to learn Rails or take another gig.
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
<havenwood> If you're dead set on C++, find a C++ project to work on!
<kapil_> I already know rails basics. i used rails before.
roaet has joined #ruby
<havenwood> kapil_: Then I don't understand what you're asking. If you know Rails, and have a huge Rails app, obviously don't port it to C++.
<kapil_> but i not need full rails. i will wright api on c++ backend
alfiemax has quit [Remote host closed the connection]
<kapil_> i have already done work for 2 days. so i will continue to do it.
<havenwood> spent costs.
yann-kaelig has quit [Client Quit]
xco has joined #ruby
<kapil_> yes
<kapil_> thanks
<xco> always on the lookout for a better way i may not know of. is there another way to write/refactorise this? https://gist.github.com/xcobar/2f3656cedbe5e3772d689b7693c972bc
<xco> :D
absolutejam1 has joined #ruby
<xco> basically i want to check if all three variables are equal
<phaul> [a,b,c].uniq.count == 1 ?
<phaul> not sure if it's any better.. just different
<xco> that looks sexy
<xco> i prefer yours
<xco> thanks
<phaul> yw
hutch has quit [Ping timeout: 246 seconds]
tsujp has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
tsujp has quit [Client Quit]
davor_ has joined #ruby
davor has quit [Ping timeout: 265 seconds]
davor_ is now known as davor
<NL3limin4t0r> throstur: If the initialization can't raise any exceptions you could do something like this.
<throstur> very cool
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua has joined #ruby
cyclonis has joined #ruby
catbusters has joined #ruby
absolutejam1 has quit [Ping timeout: 265 seconds]
banisterfiend has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has quit [Ping timeout: 276 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
involans has quit [Quit: involans]
gell5 has joined #ruby
hutch has joined #ruby
jordanm has quit [Remote host closed the connection]
gell5 has quit [Ping timeout: 276 seconds]
Guest51714 has joined #ruby
reyfi9e has quit [Ping timeout: 276 seconds]
spacesuitdiver has joined #ruby
<sapphyrus> does anyone know a gem/lib for splitting strings like `"foo \" bar" asd` into the parts ['foo " bar', 'asd']?
<phaul> &>> "foo \" bar\" asd".scan(/\w+/)
<rubydoc> # => ["foo", "bar", "asd"] (https://carc.in/#/r/7k3s)
<phaul> maybe not. if foo \" bar was spupposed to be kept together... nvm
jordanm has joined #ruby
reyfi9e has joined #ruby
<sapphyrus> yea, sry, could've made that more clear.
ellcs has quit [Ping timeout: 265 seconds]
<phaul> there must be a regex though that does what you want.
<sapphyrus> originally wanted to avoid that and rather use something battle-tested that covers all the edge cases I can't come up with myself, but I'll look into that direction
rippa has joined #ruby
involans has joined #ruby
spacesuitdiver has quit [Ping timeout: 240 seconds]
spacesui_ has joined #ruby
DTZUZO has joined #ruby
cthulchu has joined #ruby
queip has quit [Ping timeout: 240 seconds]
yokel has quit [Ping timeout: 244 seconds]
DTZUZO has quit [Ping timeout: 265 seconds]
<sapphyrus> Shellwords.split seems to do what I want, thanks
queip has joined #ruby
yokel has joined #ruby
DTZUZO has joined #ruby
schne1der has quit [Ping timeout: 265 seconds]
oetjenj has joined #ruby
<NL3limin4t0r> sapphyrus: If you're building a an command line tool. You can also give "thor" a look, which does command line argument parsing for you.
<NL3limin4t0r> http://whatisthor.com/
reyfi9e has quit [Read error: Connection reset by peer]
reyfi9e has joined #ruby
<sapphyrus> writing a telegram bot, but I'll check it out. might work too
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<NL3limin4t0r> I'm not sure if it fits your scenario, you'll have to figure that out for yourself.
banisterfiend has joined #ruby
roaet has quit [Ping timeout: 246 seconds]
emptyflask has quit [Ping timeout: 265 seconds]
emptyflask has joined #ruby
alfiemax has joined #ruby
emptyflask has quit [Ping timeout: 276 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: WeeChat 2.5]
emptyflask has joined #ruby
Intelo has joined #ruby
dinfuehr has joined #ruby
hutch has quit [Ping timeout: 245 seconds]
pen has joined #ruby
hutch has joined #ruby
alfiemax has quit [Remote host closed the connection]
dretnx has joined #ruby
tsujp has joined #ruby
alfiemax has joined #ruby
fphilipe has joined #ruby
dinfuehr has quit [Ping timeout: 245 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dinfuehr has joined #ruby
emptyflask has quit [Ping timeout: 240 seconds]
fphilipe has quit [Ping timeout: 276 seconds]
hutch has quit [Ping timeout: 245 seconds]
paraxial has quit [Quit: The Lounge - https://thelounge.chat]
paraxial has joined #ruby
roaet has joined #ruby
schne1der has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
paraxial has quit [Ping timeout: 246 seconds]
hutch has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
paraxial has joined #ruby
alfiemax has quit [Remote host closed the connection]
ellcs has quit [Ping timeout: 246 seconds]
nowhere_man has joined #ruby
paraxial9 has joined #ruby
paraxial has quit [Ping timeout: 265 seconds]
absolutejam1 has joined #ruby
paraxial93 has joined #ruby
paraxial9 has quit [Read error: Connection reset by peer]
SuperL4g has joined #ruby
SuperLag has quit [Ping timeout: 240 seconds]
roaet has quit [Ping timeout: 265 seconds]
hutch has quit [Ping timeout: 246 seconds]
chalkmonster has joined #ruby
dretnx has quit [Ping timeout: 265 seconds]
queip has quit [Ping timeout: 240 seconds]
absolutejam1 has quit [Ping timeout: 245 seconds]
alfiemax has joined #ruby
Intelo has quit [Ping timeout: 240 seconds]
reyfi9e has quit [Quit: Konversation term]
reyfi9e has joined #ruby
Intelo has joined #ruby
queip has joined #ruby
pen has quit []
gell5 has joined #ruby
SCHAPiE has quit [Quit: ZNC - https://znc.in]
involans has quit [Quit: involans]
gell5 has quit [Ping timeout: 245 seconds]
involans has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
SCHAPiE has joined #ruby
SuperLag has joined #ruby
Inline has joined #ruby
Intelo_ has joined #ruby
SuperL4g has quit [Ping timeout: 245 seconds]
Intelo has quit [Ping timeout: 265 seconds]
GodFather has joined #ruby
tfitts has quit [Quit: Connection closed for inactivity]
gix has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KeyJoo has joined #ruby
banister_ has joined #ruby
xco has quit [Quit: xco]
oetjenj has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.5]
banist___ has joined #ruby
banister_ has quit [Ping timeout: 246 seconds]
banisterfiend has quit [Ping timeout: 240 seconds]
poontangmessiah_ has quit [Remote host closed the connection]
banisterfiend has joined #ruby
dionysus70 has joined #ruby
ramfjord has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
dionysus70 is now known as dionysus69
banister_ has joined #ruby
banist___ has quit [Ping timeout: 240 seconds]
cthu| has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
cthulchu has quit [Ping timeout: 245 seconds]
sauvin has quit [Read error: Connection reset by peer]
johnny56_ has joined #ruby
robotcars has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
<robotcars> tried symbols and quotes, and get > rake aborted! NoMethodError: undefined method `[]=' for nil:NilClass
<robotcars> …rake:36:in `block (2 levels) in undefined_fields'
<leftylink> I never saw update[event_name] get defined, so it's nil. and `nil[field]` is undefined. does that sound like an accurage description of the problem
<kapil_> `self.class.aggregate_ancestors(id, user)[id]` what is `self.class`?
<robotcars> leftylink: makes sense, thought I could define within
<leftylink> &>> {}[:a][:b]
<rubydoc> stderr: -e:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError) (https://carc.in/#/r/7k5p)
<leftylink> it' pretty much doing that, i think
<leftylink> er, with the = of course
<leftylink> &>> {}[:a][:b] = :c
<rubydoc> stderr: -e:2:in `<main>': undefined method `[]=' for nil:NilClass (NoMethodError) (https://carc.in/#/r/7k5q)
<robotcars> updates[:event_name] = {}
<robotcars> updates[:event_name][field.to_sym] 
<robotcars> thanks leftylink, checking
<robotcars> better way to write that?
<robotcars> line 31
<robotcars> otherwise working now.
<robotcars> maybe, updates[event_name.to_sym] = updates[event_name.to_sym] || {}
jrafanie has joined #ruby
<robotcars> exit
robotcars has left #ruby [#ruby]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
suukim has quit [Quit: Konversation terminated!]
robotcars has joined #ruby
throsturt has joined #ruby
throstur has quit [Ping timeout: 245 seconds]
alfiemax has quit [Remote host closed the connection]
sameerynho has joined #ruby
alfiemax has joined #ruby
Intelo_ has quit [Quit: Leaving]
cd has joined #ruby
Intelo has joined #ruby
spacesui_ has quit [Quit: Textual IRC Client: www.textualapp.com]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
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]
oetjenj has joined #ruby
involans has quit [Quit: involans]
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
involans has joined #ruby
oetjenj has joined #ruby
NL3limin4t0r is now known as NL3limin4t0r_afk
oetjenj has quit [Client Quit]
jenrzzz has quit [Ping timeout: 265 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
<NL3limin4t0r_afk> robotcars: Ruby has a shortcut for that `||=`
oetjenj has quit [Client Quit]
<NL3limin4t0r_afk> `updates[event_name.to_sym] ||= {}`
jenrzzz has joined #ruby
oetjenj has joined #ruby
yoshie902a has joined #ruby
oetjenj has quit [Client Quit]
dr_mdma_md has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
<yoshie902a> When creating a method, def test(:name,:zip), is there a way to test if the name hash was passed?
oetjenj has joined #ruby
banisterfiend has joined #ruby
oetjenj has quit [Client Quit]
<robotcars> NL3limin4t0r_afk: thanks!!
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]
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]
banister_ has joined #ruby
roaet has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
banisterfiend has quit [Read error: Connection reset by peer]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
jenrzzz has quit [Ping timeout: 276 seconds]
oetjenj has joined #ruby
elphe has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
banisterfiend has joined #ruby
roaet has quit [Ping timeout: 246 seconds]
chalkmonster has joined #ruby
banister_ has quit [Ping timeout: 240 seconds]
banister_ has joined #ruby
<havenwood> yoshie902a: You can't create a method like that. That's not valid code. Are you trying to use regular args or keyword args?
<havenwood> yoshie902a: You can either `def test(name:, zip:)` or `def test(name, zip)` but not `def test(:name, :zip)`.
dionysus69 has quit [Remote host closed the connection]
<havenwood> yoshie902a: With either of the former, you know they were passed, since they're both mandatory arguments. You can't call the method without providing the positional or keyword arguments, since they're not optional.
dionysus69 has joined #ruby
<yoshie902a> havenwood: how do you make them optional?
<yoshie902a> with name:, zip:?
<havenwood> yoshie902a: By providing a default value.
<havenwood> yoshie902a: def test(name: nil, zip: nil)
banisterfiend has quit [Ping timeout: 240 seconds]
<yoshie902a> so based on stack overflow answer, they recommended a value, that would never use, to identify if the key was passed, def test(name: ‘undefined’)
<yoshie902a> which seems reasonable, I think
<yoshie902a> havenwood: thank you
<havenwood> yoshie902a: If you really need an undefined, and you don't know the input, you can do a pattern where you have a constant set to a rando object.
<havenwood> yoshie902a: UNDEFINED = Object.new
akem-hp has joined #ruby
<havenwood> yoshie902a: def test(name: UNDEFINED, zip: UNDEFINED)
akem-hp has quit [Remote host closed the connection]
<havenwood> yoshie902a: if name == UNDEFINED
<yoshie902a> I noticed that if I do test(name:[]), it still comes up undefined, when I want the [] passed in, is this possible? or am I doing something wrong?
<havenwood> yoshie902a: That doesn't sound right. Show your code?
<yoshie902a> Please disregard last comment, I was misunderstanding the results
alfiemax has joined #ruby
<yoshie902a> havenwood: I think it’s all working, thank you! I prefer your UNDEFINED object, over some random value. thank you again
gell5 has joined #ruby
absolutejam1 has joined #ruby
gell5 has quit [Ping timeout: 245 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
Swyper has joined #ruby
jenrzzz has joined #ruby
banister_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 240 seconds]
<sapphyrus> &>> Object.new == Object.new
<rubydoc> # => false (https://carc.in/#/r/7k7r)
grilix has quit [Ping timeout: 265 seconds]
<sapphyrus> cool
<Intelo> hi
Technodrome has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.5]
<kapil_> I have `include I18n` in a class. what it means?
<Intelo> Unable to understand how to send errors to webpage. render_errors(what to put here? , 404)? https://pastebin.ubuntu.com/p/PPwbWPcgJj/
<sapphyrus> kapil_: i18n stands for Internationalization, maybe that can help you? really not sure what environment ur dealing with here
dous has quit [Ping timeout: 240 seconds]
dous has joined #ruby
<kapil_> does it includes all functions of I18n?
hightower3 has joined #ruby
gell5 has joined #ruby
hightower2 has quit [Ping timeout: 245 seconds]
tpanarch1st_ has joined #ruby
tpanarch1st has quit [Ping timeout: 258 seconds]
gell5 has quit [Ping timeout: 246 seconds]
<kapil_> what above line does?
Technodrome has quit [Ping timeout: 240 seconds]
<phaul> sort of. You want to read up on ruby modules/mixins. wrt include, extend, prepend trio.
<phaul> in effect yes, you can use the methods like they were defined there - but this is only a short and sort of incorrect answer
queip has quit [Ping timeout: 246 seconds]
spacesuitdiver has joined #ruby
queip has joined #ruby
banisterfiend has joined #ruby
hutch has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
qbrd[m] has quit [Write error: Connection reset by peer]
aecepoglu[m] has quit [Read error: Connection reset by peer]
iotatron[m] has quit [Read error: Connection reset by peer]
Corey[m] has quit [Remote host closed the connection]
Hanma[m] has quit [Read error: Connection reset by peer]
danielk43[m] has quit [Read error: Connection reset by peer]
turt2live has quit [Read error: Connection reset by peer]
otaznik[m] has quit [Remote host closed the connection]
linuus[m] has quit [Read error: Connection reset by peer]
ffl^ has quit [Max SendQ exceeded]
kira_rose[m] has quit [Read error: Connection reset by peer]
Seance[m] has quit [Remote host closed the connection]
fig-le-deunch[m] has quit [Remote host closed the connection]
dionysus69 has quit [Quit: dionysus69]
yoshie902a has left #ruby [#ruby]
ffl^ has joined #ruby
Jonopoly has quit [Ping timeout: 240 seconds]
Huck777 has quit [Ping timeout: 240 seconds]
hutch has quit [Ping timeout: 245 seconds]
Huck777 has joined #ruby
aecepoglu[m] has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
DTZUZO has quit [Ping timeout: 246 seconds]
Nicmavr has joined #ruby
throsturt has quit [Ping timeout: 265 seconds]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Freshnuts has joined #ruby
Salve has quit []
Skarlso has quit [Quit: The Lounge - https://thelounge.chat]
DaRock has joined #ruby
Exuma has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
Fernando-Basso has quit [Remote host closed the connection]
throsturt has joined #ruby
spacesuitdiver has quit [Ping timeout: 265 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Skarlso has joined #ruby
jrafanie has joined #ruby
ffl^ has quit []
nuh^ has joined #ruby
jrafanie has quit [Client Quit]
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
GodFather has quit [Ping timeout: 245 seconds]
troulouliou_dev has joined #ruby
<robotcars> I'm tryin to compare if the current value.length is > stored value.length, I cannot seem to get passed, comparing > nil, when my first pass stored nil. https://gist.github.com/robert-carroll/535e2cbd9c903ffafdd5ba7d8a19e0e1#file-reduce_logs_test-rake-L40
<robotcars> i've also tried, fetch with a default, fetch with a block in the hash
<havenwood> robotcars What's the problem you're running into? Getting an error? What doesn't work?
drincruz has quit [Ping timeout: 245 seconds]
yoshie902a has joined #ruby
<robotcars> assuming the first pass stored a length of nil, I want to compare a new iteration value, and if its larger, store the larger value and size
r29v has joined #ruby
<havenwood> robotcars: So if left or right is `nil`, is that a bug or what should happen?
<robotcars> maybe I just need to conditions. if it's nil, and the new one is not use the new one, if it's not nil, compare
<robotcars> nil is allowed
<havenwood> robotcars: What *should* happen if one side is nil?
<robotcars> if one side is nil, I want to overwrite if new is larger
<robotcars> also, overwrite anytime larger
<havenwood> robotcars: Larger than nil?
<havenwood> robotcars: Are you considering `nil` to be zero?
<robotcars> i would have to leave nil to the user to determine size
turt2live has joined #ruby
Seance[m] has joined #ruby
sepp2k has joined #ruby
linuus[m] has joined #ruby
iotatron[m] has joined #ruby
qbrd[m] has joined #ruby
Corey[m] has joined #ruby
<havenwood> &>> nil.to_i
danielk43[m] has joined #ruby
Hanma[m] has joined #ruby
<rubydoc> # => 0 (https://carc.in/#/r/7k8z)
fig-le-deunch[m] has joined #ruby
otaznik[m] has joined #ruby
kira_rose[m] has joined #ruby
<robotcars> but cant 0 > nil.to_i
<havenwood> robotcars: zero isn't greater than zero. I don't really understand what you want to happen if left or right is nil.
<robotcars> NoMethodError: undefined method `>' for nil:NilClass
<havenwood> &>> 0.to_i > 0
<rubydoc> # => false (https://carc.in/#/r/7k90)
<havenwood> &>> value = nil; value&.size.to_i > 0
<rubydoc> # => false (https://carc.in/#/r/7k91)
<havenwood> robotcars: If you wanted `nil` to be zero, it's easy.
eam has joined #ruby
<robotcars> i got that… looking at the provided example in the comments… level: is first nil, but as I pass through I end up with 'submit' which is 6, and I want 'testing' which was 7… keeping the largest
<havenwood> robotcars: I'd suggest assigning updates, field, etc to symbols then: updates.dig(event_name, field, :value).to_s
<robotcars> curently only keeping the last pass… not the greatest length
<havenwood> robotcars: i'd suggest adding a few if statements until it works the way you want. Then we can help you refactor.
<robotcars> hehe.. i've been trying to get the if statements to work. will keep at it.
<yoshie902a> trying to debug a real corky behavior if anyone has any ideas.. https://stackoverflow.com/questions/57930539/keyerror-trait-not-registered
GodFather has joined #ruby
<yoshie902a> I can’t run a method twice in a row within a specific method, which seems buggy to me.
<yoshie902a> However, I can run it outside of the method.
tsr has quit [Quit: WeeChat 2.5]
<robotcars> havenwood: got it working… is there a more elegant way? https://gist.github.com/robert-carroll/535e2cbd9c903ffafdd5ba7d8a19e0e1
<havenwood> robotcars: Seems you've nested two methods? Something is wrong with your gist.
DTZUZO has joined #ruby
<robotcars> updated.
<yoshie902a> havenwood: you are always incredibly helpful. I would love your thoughts and ideas if you have any.
<havenwood> yoshie902a: Instead of: list = []; count.times do |_count|; ...; end; list
<havenwood> yoshie902a: Just: Array.new(count) { ... }
SuperL4g has joined #ruby
<yoshie902a> I tried the change, I like it from a refactoring stand point, but same error.
<havenwood> yoshie902a: Looks like a Factorybot state issue.
r29v has quit [Quit: r29v]
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> yoshie902a: I don't use Factorybot but it seems it's not meant to be used like this. Maybe someone familiar with the library will know why.
SuperLag has quit [Ping timeout: 245 seconds]
<yoshie902a> thanks, I had read that, but it’s a different issue, they had a typo
<yoshie902a> my code runs once, but not in the loop. :(
<havenwood> yoshie902a: Can you remove code and still reproduce the issue. Try to boil it down to a minimal repro case and ask the factorybot folk.
queip has quit [Ping timeout: 246 seconds]
<yoshie902a> will try that. thank you
dpl_ has joined #ruby
<havenwood> robotcars: yes, plenty of improvements to be made. i can suggest a few.
<robotcars> i'll gladdy take a few.
queip has joined #ruby
involans has quit [Quit: involans]
jenrzzz has quit [Ping timeout: 265 seconds]
dpl_ has quit [Client Quit]
dpl_ has joined #ruby
jenrzzz has joined #ruby
dpl_ has quit [Client Quit]
dpl_ has joined #ruby
dpl_ has quit [Client Quit]
<yoshie902a> havenwood: when I try this, it works.. https://gist.github.com/yoshie902a/67a91a784838096dc9b57b442a3f5046
<yoshie902a> so it makes me think it has something to do with my method
involans has joined #ruby
<robotcars> havenwood, if it's helpful, id cherry pick a more elegant way to handle updating and storing the hash, unless I'm god awful noobing something else. :D
<leftylink> well. see in https://stackoverflow.com/questions/32172334/factory-girl-rspec-trait-not-registered-error/46467790 how they were passing `1` and the error said `Trait not registered: 1`. In the case of https://stackoverflow.com/questions/57930539/keyerror-trait-not-registered it's also saying trait not found. and it's a hash. so consider whether it's OK to call `create` with a hash as its second argument.
<leftylink> if it is not, you would probably want to do something about that
<havenwood> robotcars: I commented on your gist.
<havenwood> robotcars: I didn't test this code, but it should give you ideas.
<havenwood> robotcars: keep refactoring!
<robotcars> thanks!
gell5 has joined #ruby
* havenwood robotcars: updated comment for a mistake: https://gist.github.com/robert-carroll/535e2cbd9c903ffafdd5ba7d8a19e0e1
dpl has joined #ruby
<yoshie902a> leftylink:yes, it’s ok I tested it
<havenwood> robotcars: you're welcome!
dpl has quit [Client Quit]
<yoshie902a> I think it maybe has something to do with the splat I am using in combination with the traits array, which contains the hash
<yoshie902a> leftylink: this works: created_listable = create(listable_factory, {user: created_user})
<yoshie902a> can a array splat, like *traits not handle a hash object in the array?
<yoshie902a> However, what I am confused about is that it fails in the loop, when I run it seperately, it fails. havenwood thinks it is a factorybot state issue, but then I would think my gist example would fail. So I am pretty confused
dpl has joined #ruby
gell5 has quit [Ping timeout: 276 seconds]
<yoshie902a> my updated gist shows the {} passed and working .. https://gist.github.com/yoshie902a/67a91a784838096dc9b57b442a3f5046
<yoshie902a> oops, mean to say, when I run it outside of the loop, and call create_list method multiple times outside the loop it works. and it’s being called the same way.
<yoshie902a> create_list was meant to be “full_create” sorry
<havenwood> yoshie902a: can you reproduce this with less code
<yoshie902a> yes, will post
<havenwood> yoshie902a: what's the smallest amount of code you can repro with?
<havenwood> betcha someone who knows factorybot can tell you from there
dpl has quit [Quit: leaving]
SuperL4g has quit [Ping timeout: 245 seconds]
<yoshie902a> I will post to factorybot too, but it usually take a few days to get an answer, I am trying to get this solved tonight, I am way behind. Will post the smallest amount of code now, may take a moment
cthu| has quit [Ping timeout: 240 seconds]
cthu| has joined #ruby
dpl has joined #ruby
reber has quit [Remote host closed the connection]
dpl has quit [Client Quit]
SuperLag has joined #ruby
<yoshie902a> updated the gist.
<yoshie902a> I think this line is the issue listable << { user: created_user } if valid_traits?(listable)
<yoshie902a> as if I hard code the result, it works
dpl has joined #ruby
absolutejam1 has quit [Ping timeout: 276 seconds]
Freshnuts has quit [Quit: Leaving]
zenspider has quit [Read error: No route to host]
zenspider has joined #ruby
<yoshie902a> Ok, this is what I found out, but not sure what’s causing it. when I run it multiple times within the loop, listable parameter, added a user to it before the listable << { user: created_user } if valid_traits?(listable), line gets run. so something is weird and not clearning listable
absolutejam1 has joined #ruby
<yoshie902a> I think it’s a namespace type issue
dasher00 has joined #ruby
schne1der has quit [Ping timeout: 246 seconds]
absolutejam1 has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
spacesuitdiver has joined #ruby
<leftylink> whoops. should have figured that out earlier
<leftylink> list mutation, duh
<leftylink> all the <<
<yoshie902a> leftylink: I think you pointed my issue out.
<yoshie902a> just not sure what is causing it
<yoshie902a> I would have thought listable would clear after every call, but it’s not
<leftylink> why would it?
<leftylink> you're giving it the same list (`listable`) every time.
Guest51714 has quit [Ping timeout: 245 seconds]
SuperLag has quit [Ping timeout: 276 seconds]
GodFather has quit [Ping timeout: 276 seconds]
<leftylink> on line 10
jenrzzz has joined #ruby
<yoshie902a> I don’t follow, I thought listable came from the method call
oetjenj has joined #ruby
<yoshie902a> so in my code, it’s modifying listable and holding that value even outside of the full_create method?
<yoshie902a> I thought variables are only contained within methods unless that are instance variables or class variables
SuperLag has joined #ruby
<yoshie902a> leftylink: I guess something like this could fix it, listable1 = listable +[ { user: created_user }] , but is there a better way?
sameerynho has quit [Ping timeout: 246 seconds]
xco has quit [Quit: xco]
alfiemax has joined #ruby
throsturt has quit [Ping timeout: 240 seconds]
djsdfjklsdfkjlsd has joined #ruby
throsturt has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
cnsvc has quit [Ping timeout: 260 seconds]
roaet has joined #ruby
<yoshie902a> if someone can explain why my mutation occured I would apprecaite the knowledge. thank you!
<yoshie902a> I understand, listable was being modified, but I don’t understand why
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
djsdfjklsdfkjlsd has quit [Remote host closed the connection]
<yoshie902a> it was passed into the method over and over again
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
cnsvc has joined #ruby
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]
roaet has quit [Ping timeout: 245 seconds]
stryek has quit [Quit: Connection closed for inactivity]
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]
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]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
Exuma has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
ramfjord has quit [Ping timeout: 276 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
Guest51714 has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
ramfjord has joined #ruby
dinfuehr has quit [Ping timeout: 276 seconds]
dinfuehr has joined #ruby
<yoshie902a> leftylink: thank you for all your help
<yoshie902a> havenwood: thank you for all your help!
yoshie902a has left #ruby [#ruby]
emptyflask has joined #ruby
bambanx has joined #ruby
roaet has joined #ruby