Add install generator

This commit is contained in:
Dzmitry Plashchynski
2015-03-02 21:43:47 +02:00
parent 5e3ca985e3
commit 20217b0c8a
2 changed files with 21 additions and 0 deletions

View 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

View File

@@ -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"
#