Socket
Book a DemoInstallSign in
Socket

close_encounters

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

close_encounters

0.2.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

CloseEncounters

… of the Third Party.

Add serices and events that can track responses from third-party services.

Usage

Install it like any other rails engine.

rails close_encounters:install:migrations

Then when you have it installed and migrated you can start tracking events.

response = SomeThirdPartyService.call
CloseEncounters.contact("SomeThirdPartyService", status: response.status.to_i, response.body)

If the services regularly returns 200 responses, no new events will be recorded. When it switches to a different status, a new event will be recorded.

CloseEncounters.status("SomeThirdPartyService") # => 200
# evuntually you use `contact` and it records a 500 and you'll be able to get
CloseEncounters.status("SomeThirdPartyService") # => 500

Rack Middleware

Setup your middleware in your config/application.rb or config/environments/production.rb.

config.middleware.use CloseEncounters::Middleware

This will automatically track responses from third-party services when you store a "domain" key in the connection_info in the ParticipantService records.

Alternatively, you can use the auto_contact! method to automatically turn on the rack middleware:

CloseEncounters.auto_contact!

TODO

  • Add JS to the gem to track events on the front-end.
  • Add a UI to create and manage services.
  • Add a UI to view events.

Installation

Add this line to your application's Gemfile:

gem "close_encounters"

And then execute:

$ bundle

Or install it yourself as:

$ gem install close_encounters

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 05 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.