Sha256: 106728a0ebc9ebae89ed88c05338589c2b67ddaaca8dfd8611603d42c1fcee73

Contents?: true

Size: 510 Bytes

Versions: 4

Compression:

Stored size: 510 Bytes

Contents

require 'rails'
require 'rails/generators'

# Generates runner class and systemd unit file
class RunnerHelperGenerator < Rails::Generators::NamedBase
  desc 'Create runner class with systemd unit file.'

  source_root File.expand_path('../templates', __FILE__)
  argument 'username', default: 'deploy'

  def gen_runner_class
    template('runner_helper.rb.erb', "app/runners/#{file_name}_runner.rb")
  end

  def gen_unit_file
    template('unit.service.erb', "vendor/systemd/#{file_name}.service")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
runner_helper-0.1.0 lib/generators/runner_helper/runner_helper_generator.rb
runner_helper-0.0.6 lib/generators/runner_helper/runner_helper_generator.rb
runner_helper-0.0.5 lib/generators/runner_helper/runner_helper_generator.rb
runner_helper-0.0.4 lib/generators/runner_helper/runner_helper_generator.rb