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.
Rack middleware to handle events on file modifications.
If you are using an application server of prefork type(unicorn, passenger), it is useful if you want to do a simple processing in the child process. (For example, clear the Rails.cache)
Add this line to your application's Gemfile:
gem 'rack-file-watcher'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack-file-watcher
Basic configuring the middleware:
require 'rack/file_watcher'
use Rack::FileWatcher, 'tmp/watch.txt' do
puts 'updated.'
end
app = proc do |env|
[ 200, {'Content-Type' => 'text/plain'}, 'Hello World' ]
end
run app
Example in Rails:
# config/application.rb
module YourApp
class Application < Rails::Application
# ...
config.middleware.use Rack::FileWatcher, config.root.join('tmp/clear_cache.txt') do
Rails.cache.clear
end
end
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Copyright (c) Daichi HIRATA, released under the MIT license.
FAQs
Unknown package
We found that rack-file-watcher 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.