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]
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
<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
<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?
<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.
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
<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.
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.
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…]
<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
<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>
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.
<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
<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
<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