File: install_generator.rb

package info (click to toggle)
ruby-client-side-validations 23.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 272 kB
  • sloc: ruby: 788; javascript: 671; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 557 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

require_relative 'copy_assets_generator'

module ClientSideValidations
  module Generators
    class InstallGenerator < CopyAssetsGenerator
      def copy_initializer
        source_paths << File.expand_path('../templates/client_side_validations', __dir__)
        copy_file 'initializer.rb', 'config/initializers/client_side_validations.rb'
      end

      def self.installation_message
        "Copies initializer into config/initializers and #{super.downcase}"
      end

      desc installation_message
    end
  end
end