Sha256: 1baa9c77d4cc1e8954feb65e3dff978f4c02aef1b310a87fc590fd6c196dd917
Contents?: true
Size: 989 Bytes
Versions: 57
Compression:
Stored size: 989 Bytes
Contents
module Cmor module Tags module Generators class InstallGenerator < Rails::Generators::Base desc 'Generates the initializer' source_root File.expand_path('../templates', __FILE__) attr_reader :base_controller_class_name def initialize(*args) super @base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::ApplicationController' } end def generate_initializer template 'initializer.rb', 'config/initializers/cmor_tags.rb' end def generate_routes route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source')) end def add_helpers_to_application_controller inject_into_file 'app/controllers/application_controller.rb', before: "\nend" do File.read(File.join(File.expand_path('../templates', __FILE__), 'application_controller.source')) end end end end end end
Version data entries
57 entries across 57 versions & 1 rubygems