<[0x1eef]>
milouse: Why are you posting these URLs?
<milouse>
woops… very sorry. Wrong window 🤦
<milouse>
hopefully nothing sensitive…
graywolf has joined #ruby
Linux_Kerio has joined #ruby
infinityfye has joined #ruby
tromp has quit [Read error: Connection reset by peer]
<[0x1eef]>
That's why clients of various forms auto-fetching URLs to draw a preview is still and always will be a terrible idea.
osc4rpt has quit [Ping timeout: 256 seconds]
milouse has left #ruby [#ruby]
osc4rpt has joined #ruby
infinityfye has quit [Read error: Connection reset by peer]
infinityfye has joined #ruby
infinity_fye has joined #ruby
infinityfye has quit [Killed (NickServ (GHOST command used by infinity_fye))]
infinity_fye is now known as infinityfye
ht_ has joined #ruby
_ht has quit [Ping timeout: 256 seconds]
ht_ is now known as _ht
nickjj has joined #ruby
<nickjj>
does anyone know of a built-in way to flip the key / value result of running `{red: "Red", green: "Green", blue: "Blue"}.to_a` so that instead of getting back `[[:red, "Red"], ...]` you get `[["Red", :red]]`?
<nickjj>
it would be easy to do manually by looping over the hash, but was wondering if i missed something in the docs or the language that makes this type of thing as simple as a method call
monr0e has joined #ruby
graywolf has quit [Quit: WeeChat 4.0.4]
monr0e has quit [Remote host closed the connection]
<[0x1eef]>
nickjj: h.map { [_2, _1] }.to_h
monr0e has joined #ruby
<havenwood>
nickjj: {}.invert
<havenwood>
[0x1eef]: I like that now you can: {}.to_h { [_2, _1]
<havenwood>
}
SunClonus has joined #ruby
<nickjj>
thanks, both options work but it looks like `.invert` is perfect here as a drop in method
SunClonus has quit [Quit: Leaving.]
<[0x1eef]>
havenwood: Ah right! I saw that the other day in a PR :) It's nice indeed.
<[0x1eef]>
nickjj: Yeah, that's likely the best optimized version.
<nickjj>
i got hung up on looking at .to_a when i should have spent more time looking at all methods available on hash, invert is sitting there in the docs
SunClonus has joined #ruby
dviola has joined #ruby
dviola has quit [Changing host]
dviola has joined #ruby
dviola has left #ruby [#ruby]
graywolf has joined #ruby
ht_ has joined #ruby
_ht has quit [Ping timeout: 255 seconds]
ht_ is now known as _ht
tromp has joined #ruby
<havenwood>
nickjj: An `h.to_a.map(&:reverse)` is also fast but `h.invert.to_a` is a little less noise.
<havenwood>
I meant `h.map(&:reverse)` **
<havenwood>
`h.map(&:reverse)` versus `h.invert.to_a`
CrazyEddy has quit [Remote host closed the connection]
CrazyEddy has joined #ruby
<nickjj>
thanks, yep i think it's less noisy too, maybe a tiny bit clearer because reverse could be thought of revering the key order
graywolf has quit [Quit: WeeChat 4.0.4]
tromp has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tromp has joined #ruby
rvalue has quit [Ping timeout: 272 seconds]
rvalue has joined #ruby
gr33n7007h has quit [Quit: WeeChat 4.2.1]
gr33n7007h has joined #ruby
tromp has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
sphex has joined #ruby
neshpion has joined #ruby
tromp has joined #ruby
dviola has joined #ruby
tromp has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tromp has joined #ruby
smp has quit [Ping timeout: 256 seconds]
smp has joined #ruby
pgib has joined #ruby
smp- has joined #ruby
smp has quit [Ping timeout: 264 seconds]
smp- is now known as smp
kaivai has quit [Remote host closed the connection]
kaivai has joined #ruby
ultralan has joined #ruby
tromp has quit [Read error: Connection reset by peer]
ultralan has quit [Remote host closed the connection]
kaivai has quit [Remote host closed the connection]
_ht has quit [Remote host closed the connection]
monr0e has quit [Read error: Connection reset by peer]
monr0e has joined #ruby
kaivai has joined #ruby
Guest1235 has joined #ruby
<Guest1235>
trying to use serverspec to test a docker container. tests failing, but need to preserve the container for inspection in order to debug the tests. any thoughts on how to do that would be appreciated.
<adam12>
Guest1235: Rescue failing test, add very long sleep? I dunno.
<Guest1235>
adam12: what do you mean by rescue? is that part of rspec testing API?
kaivai has quit [Remote host closed the connection]
kaivai has joined #ruby
reset has joined #ruby
<adam12>
Guest1235: I am not sure how you are running this, but I would make a shell script that wraps the call to `rake spec` and then sleeps if the exit of rake spec is non-zero. Presumably that would work.
<Guest1235>
ah, that seems a reasonable wayto proceed. Thank you, adam12++ !!
<adam12>
Guest1235: Good luck!
<Guest1235>
adam12: would not harvesting that `rake spec` exit code follow whatever clean up rspec is doing which is shutting down the container?
kaivai has quit [Remote host closed the connection]
<adam12>
Guest1235: I am not sure. I've never used serverspec and I rarely use rspec.
<Guest1235>
I am in doubt that the container has even been run, and am not sure how to confirm or not that fact.
<adam12>
Are you doing `rake spec`?
<Guest1235>
yes
<adam12>
From the host I presume? Then in theory, serverspec sets up the container?
kaivai has joined #ruby
<Guest1235>
this is the script being invoked with `rake spec`:
<adam12>
Guest1235: Where do you think it's failing? Is that the spec you're using?
<Guest1235>
been years since I used serverspec, but in the past I would use vagrant to run a vm, then invoke the serverspec test. but this seems to want to build an image from a Dockerfile inside the script.
<Guest1235>
reviewing this, I am running this test against an existing container, which remains up. My cargo-culted test file seems to confuse me about what is happening here.
<Guest1235>
commenting out that fixture setup code results in my user being prompted for an ssh password. trying next to edit ~/.ssh/config to see if I can use a public key to get past this.
<Guest1235>
have updated the gist to reflect those changes.
<weaksauce>
Guest1235 how's it connecting to the image?
monr0e has quit [Read error: Connection reset by peer]
monr0e has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
graywolf has quit [Quit: WeeChat 4.0.4]
SunClonus has quit [Read error: Connection reset by peer]
SunClonus has joined #ruby
<Guest1235>
weeksauce: my docker containers are built on phusion's base image, which includes an sshd service. I configured the ~/.ssh/config and had to add ed25519 bcrypt_pbkdf to my Gemfile. Its not connecting and passing my hello world test. I think I can now build out something useful.
<Guest1235>
s,not,now,
<Guest1235>
1 example, 0 failures
<weaksauce>
ah solid
dalan038228335 has quit [Ping timeout: 246 seconds]
<Guest1235>
off to the races: 17 examples, 0 failures; that only begins to touch on 288 lines of puppet code, supported by 181 lines of erb templates. should keep me busy this evening.