🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

puma-rufus-scheduler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puma-rufus-scheduler

bundlerRubygems
Version
0.1.0
Version published
Maintainers
1
Created
Source

puma-rufus-scheduler

Testing

Puma plugin to run Rufus Scheduler.

Installation

  • Add this line to your application's Gemfile:
gem "puma-rufus-scheduler"
  • Install dependencies with bundler:
bundle install
  • Add the following line to your config/puma.rb:
plugin "rufus-scheduler"
  • Create your scheduler file in config/scheduler.rb:
scheduler = Rufus::Scheduler.new

scheduler.every "5s" do
  puts "Every 5 seconds #{Time.current}"
end

# This will attach scheduler thread to Puma's background thread.
# Dont forget to add this line!
scheduler.join
  • Start your Puma server and you should see the scheduler running:
$ bin/rails server

=> Booting Puma
=> Rails 7.1.3.2 application starting in development
...

Every 5 seconds 2024-04-17 14:13:11 UTC
Every 5 seconds 2024-04-17 14:13:16 UTC
Every 5 seconds 2024-04-17 14:13:21 UTC

Configuration

You can change the scheduler file path by setting the RUFUS_SCHEDULER_FILE environment variable:

RUFUS_SCHEDULER_FILE=config/my_scheduler.rb bin/rails server

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/rake test to run the tests.

To install this gem onto your local machine, run bin/rake install.

To release a new version, update the version number in version.rb, and then run bin/rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

License

Copyright © 2024 Javier Aranda. Released under the terms of the MIT license.

FAQs

Package last updated on 18 Apr 2024

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