<leftylink>
I see. you'll have to do a flat_map followed by a to_h on the result of the flat_map, then.
desnudopenguino has joined #ruby
<rob>
Ah ha, I just came up with another solution which seems a bit kludgey: Array.new.tap {|a| hash.invert.each_pair {|k, v| k.each {|w| a << {w => v}}} }.reduce({}, :merge)
<rob>
Let's have a look at flat_map...
<rob>
Thanks!
ur5us has quit [Ping timeout: 250 seconds]
goldfish has quit [Quit: Leaving]
ur5us has joined #ruby
desnudopenguino has quit [Remote host closed the connection]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
<thad_the_man>
Is there a reverse String.scan? meaning find the last match firsty then the second to last match etc.
venue has joined #ruby
roadie has joined #ruby
Skyfire has quit [Ping timeout: 250 seconds]
michigan has quit [Quit: Connection closed for inactivity]
neshpion has quit [Quit: neshpion]
thad_the_man has quit [Ping timeout: 240 seconds]
ur5us has quit [Quit: Leaving]
ur5us has joined #ruby
thad_the_man has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
thad_the_man has quit [Ping timeout: 250 seconds]
jpw has joined #ruby
jpw has quit [Ping timeout: 250 seconds]
jpw has joined #ruby
mjh has joined #ruby
hololeap has quit [Remote host closed the connection]
hololeap has joined #ruby
venue has quit [Quit: adios]
ur5us has quit [Ping timeout: 250 seconds]
roadie has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
jpw has quit [Remote host closed the connection]
<nakilon>
newton oh, vcr, I now reread your question for more understanding what you meant
<nakilon>
first of all you did a decision of where you mock
<nakilon>
when I was making high level tests over my external API library I didn't use VCR, I did my own 15 lines long replacement that was mocking the library, not the API
<nakilon>
you could pass any module to my mocker -- it was recording the ruby calls
<nakilon>
oh, and probably those were rather tests of something that uses my library, not the tests of the library
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
pwnd_sfw has quit [Ping timeout: 252 seconds]
TomyWork has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
jdcain has joined #ruby
noa has joined #ruby
kinduff4 has joined #ruby
kiki_lamb has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
kinduff has quit [Ping timeout: 248 seconds]
kinduff4 is now known as kinduff
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
kiki_lamb has joined #ruby
elf_fortres has joined #ruby
kiki_lamb has quit [Ping timeout: 250 seconds]
Oxfuxxx has quit [Quit: leaving]
elf_fortres has quit [Ping timeout: 246 seconds]
Oxfuxxx has joined #ruby
roadie has joined #ruby
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 248 seconds]
rubion has joined #ruby
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 240 seconds]
rubion has quit [Ping timeout: 250 seconds]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
kiki_lamb has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
nik has joined #ruby
mrkz_c has quit [Quit: Connection closed for inactivity]
Oxfuxxx has quit [Ping timeout: 240 seconds]
Oxfuxxx has joined #ruby
kiki_lamb has joined #ruby
VoidNoir0 has joined #ruby
kiki_lamb has quit [Ping timeout: 252 seconds]
Oxfuxxx has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
noa has quit [Quit: Leaving]
roadie has joined #ruby
joenoon has quit []
joenoon has joined #ruby
kiki_lamb has joined #ruby
Oxfuxxx has joined #ruby
kiki_lamb has quit [Ping timeout: 240 seconds]
Guest48 has joined #ruby
<Guest48>
Hello, I have an existing table `orders` and a corresponding `Order`. The table has a column `status` which is an enum consisting of the values (pending, unprocessed, processed). The model has the enum as `enum status: { pending: "pending", unprocessed: "unprocessed", processed: "processed" }`
<Guest48>
I want to add a value called `delivered` after `pending` in the enum. So my migration looks like `ALTER TYPE status ADD VALUE delivered AFTER pending`. I added the same in the model - `{ pending: "pending", delivered: "delivered", ...}`
<Guest48>
I want to know if this will cause any problems as enum values are stored as integers AFAIK
kiki_lamb has joined #ruby
<Guest48>
Just want to make sure any existing data does not get affected by this!
kiki_lamb has quit [Ping timeout: 240 seconds]
Oxfuxxx has quit [Ping timeout: 248 seconds]
ur5us has quit [Ping timeout: 250 seconds]
Oxfuxxx has joined #ruby
Guest48 has quit [Quit: Client closed]
kiki_lamb has joined #ruby
<nakilon>
just wanted to ask #yard guys about why are so many gem docs down on their ruby-doc website for a while now, but looks like the channel didn't migrate from freenode or wasn't alive there in the first place
<adam12>
EdwardIII: If you are dependency adverse, I think you can overwrite the `run` method to call `VCR.use_cassete do super end`
<adam12>
Since I have a love/hate relationship with VCR, my only suggestion is ensure that you can easily record a test or all tests. Because what happens on projects is the VCR cassette is recorded and nobody in the future can re-record it, because it relies on a bunch of implied state or specific test order.
<EdwardIII>
yeah i've used VCR-similar things in the past and you can absolutely shoot yourself in the foot
<EdwardIII>
sometimes it's kind of impossible to get around taht though. for example, if i have some code that hits a third party endpoint with some dates in the request, eventually that's always going to stop working. so once that date passes, someone will definitely not be able to blow those VCR files away
<EdwardIII>
the only other choice is to i guess pull those ones out of VCR and put 'em in as proper fixtures instead or something, to at least have that line in the sand
<EdwardIII>
heh magic, starts off working pretty nicely, then about 100 test cases in something is throwing an exception as it's not getting something it expects
<EdwardIII>
it was almost *too* easy
kiki_lamb has quit [Ping timeout: 248 seconds]
Oxfuxxx_ has joined #ruby
Oxfuxxx has quit [Ping timeout: 250 seconds]
kiki_lamb has joined #ruby
rob has joined #ruby
kiki_lamb has quit [Ping timeout: 240 seconds]
<adam12>
O_O
Oxfuxxx_ has quit [Read error: Connection reset by peer]
<EdwardIII>
ah, changed where i'm calling 'super' in the hooks and now everything seems to be passing, nice nice nice!
Oxfuxxx has joined #ruby
<EdwardIII>
yep, disconnected from wifi and all tests still pass, beautiful. thanks adam12
kiki_lamb has joined #ruby
bit4bit has joined #ruby
<EdwardIII>
sorry just a bit of a noob question, if i put something in the test deps (like VCR), do `RAILS_ENV=test bundle install`, then `RAILS_ENV=test bundle exec bin/rake test`, it still says 'LoadError: cannot load such file -- vcr'. what's the right approach here?
nik has quit [Quit: Leaving]
kiki_lamb has quit [Ping timeout: 248 seconds]
olspookishmagus has joined #ruby
kiki_lamb has joined #ruby
menace has joined #ruby
menace has joined #ruby
menace has quit [Changing host]
roadie has quit [Ping timeout: 250 seconds]
menace is now known as Deknos
kiki_lamb has quit [Ping timeout: 250 seconds]
elf_fortrez has joined #ruby
kiki_lamb has joined #ruby
MalkbabY has quit [Remote host closed the connection]
rubion has joined #ruby
MalkbabY has joined #ruby
kiki_lamb has quit [Ping timeout: 250 seconds]
<nakilon>
heh, I'm stopped by two bugs at once; https://bugs.ruby-lang.org/issues/13540 -- this thing started happening only after I installed the gem, so the shim requires the ./bin executable with "Kernel#load" and it fails
<nakilon>
and another one I haven't yet investigated looks like if your gem binary is a Sinatra app it just does not start
_ht has joined #ruby
roadie has joined #ruby
Guest87 has joined #ruby
Guest87 has left #ruby [#ruby]
<nakilon>
(randomly copypasted "enable :run" resolved the second one)
kenliten has joined #ruby
kenliten has left #ruby [#ruby]
rubion has quit [Ping timeout: 252 seconds]
mrkz_c has joined #ruby
jdcain has quit [Quit: WeeChat 3.2]
rubion has joined #ruby
kiki_lamb has joined #ruby
rob has quit [Ping timeout: 252 seconds]
jpw has joined #ruby
elf_fortrez has quit [Quit: Client closed]
bit4bit has quit [Ping timeout: 240 seconds]
TomyWork has quit [Quit: Leaving]
Guest63 has joined #ruby
Guest63 has quit [Client Quit]
Guest45 has joined #ruby
Guest45 has quit [Quit: Client closed]
jpw_ has joined #ruby
Guest45 has joined #ruby
jpw has quit [Ping timeout: 240 seconds]
Guest45 has quit [Client Quit]
work has joined #ruby
<work>
Hello, In `ApplicationMailer`, the default hash (`default from: 'from@example.com'`) , is default a method that take a hash as parametre or?
jpw_ is now known as jpw
neshpion has joined #ruby
neshpion is now known as sir_neshpion
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Remote host closed the connection]
rubion has quit [Ping timeout: 240 seconds]
sir_neshpion is now known as neshpion
<adam12>
EdwardIII: That should work fine. Did you get it solved?