mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-24 09:48:39 +02:00
Add install generator
This commit is contained in:
12
lib/generators/periodicity/install/install_generator.rb
Normal file
12
lib/generators/periodicity/install/install_generator.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
module Periodicity
|
||||||
|
module Generators
|
||||||
|
class InstallGenerator < ::Rails::Generators::Base
|
||||||
|
desc "Installs periodicity and generates the necessary configuration files"
|
||||||
|
source_root File.expand_path("../templates", __FILE__)
|
||||||
|
|
||||||
|
def copy_config
|
||||||
|
template 'periodicity.rb.erb', 'config/initializers/periodicity.rb'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Periodicity configuration file
|
||||||
|
#
|
||||||
|
# Here you can specify periodic jobs and their schedule.
|
||||||
|
# You can specify a periodic job as a ActiveJob class in `app/jobs/`
|
||||||
|
# Actually you can use any class. The only requirement is that
|
||||||
|
# the class should implement a method `perform` without arguments.
|
||||||
|
#
|
||||||
|
# TestJob.perform_every 2.days, at: "15:30"
|
||||||
|
#
|
||||||
Reference in New Issue
Block a user