Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
The Async Messaging gem (Ruby on Rails) aims to simplify User notifications when handling asynchronous calls within your application, via messaging.
For example: you're using Delayed::Job (https://github.com/collectiveidea/delayed_job) and have completed a 'delayed' action, but want to notify the user about the status after it's completed. A simple flash[:notice] isn't going to work because you're outside User context.
NOTE: Currently this gem is under heavy development, function calls will change in the future
The capabilities of async-messaging are required for a private project, which is MongoDB/ Mongoid backed. Alternate messaging systems are not capable of handing these requirements (https://www.ruby-toolbox.com/categories/User_Messaging_Systems).
Version (0.0.1)
Future features (subject to change)
Add this line to your application's Gemfile:
gem 'async-messaging', github: "dblommesteijn/async-messaging"
And then execute:
$ bundle
Generate initialize script for async-messaging
$ rails g asyncmessaging:install
Configure initializer script with your Models config/initializer/async-messaging.rb
# Async::Messaging initializer
# Use this hook to define your messaging setup
Async::Messaging.setup do |config|
# mongoid configuration
require 'devise/orm/mongoid'
# provide the root user instance (system messaging source)
# NOTE: this can/ should be a dummy account!
config.model_root = User.find("5333f81244656eccdc020000")
end
Add flash handler to your Controller app/controllers/application_controller.rb
# handle flash messaging from Async::Messaging helper
include Async::Messaging::Controller
NOTE: Async::Messaging::Controller adds before_filter :help_async_messaging
that collects all user flash messages from the database and creates flashes.
Cancel flash message behaviour (skip before_filter)
skip_before_filter :help_async_messaging
Prepare your flash notification view
Below is an example of flash view (in slimlang) and Bootstrap. The example will not show any values other than Strings, now we need to expand on this by switching if key == :async_messaging
div.row
div.col-xs-12
- flash.each do |key, value|
- if key == :async_messaging
/ async_messaging flash
- value.each do |notification|
- next if notification.empty?
div{class="alert alert-info fade in"}
a.href{data-dismiss="alert" class="close"}
li.fa.fa-times
/ prettify the message
p
strong
= notification[:subject]
= " ".html_safe
= notification[:content]
- else
/ default flash
div{class="alert alert-info fade in"}
a.href{data-dismiss="alert" class="close"}
li.fa.fa-times
= value if value.is_a? String
Notify a user, send a system message. NOTE: These messages are consumed upon retreival.
# sends a system message to a user as flash message
Async::Messaging::Notify.notify_user(User.first, subject: "System Notice", content: "How are you?", category: :flash, flags: [:notice])
NOTE: on page reload the flash message is collected in the ApplicationController
via the before_filter
in Async::Messaging::Controller
.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that async-messaging 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.