
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
In your Gemfile
gem 'notification_center'
To enable cache, in your:
config/initializers/notification_center.rb
NotificationCenter.enable_cache = true # only one event fired in one request scope, default is false
Dont forget to flush cache wach request, for this in your config/application.rb in config section:
config.middleware.use NotificationCenter::Cache
In any class or multiple classes:
class SomeClass
observe :some_event
def some_event_handler # any number of args are possible
end
end
Anywhere in code:
NotificationCenter.post_notification :some_event
Create directory app/listeners and put listeners there, like user_listener.rb
class UserListener
observe :user_did_some_action
def user_did_some_action_handler
# some complex logic
end
end
Make sure, that your classes are preloaded! So for app/listeners, put this code to your application.rb
Dir[Rails.root.join + 'app/listeners/*.rb'].map{|f| require f}
In your spec_helper.rb
require 'notification_center/rspec_helpers'
Then you can use notifications: false in describe, context, it. Like:
describe User, notifications: false do
it "should do smth", notifications: false do
FAQs
Unknown package
We found that notification_center demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.