module Svelte class InstallGenerator < Rails::Generators::Base desc "This generator installs actionview-svelte-handler" source_root File.expand_path("templates/install", __dir__) def install copy_file "initializer.rb", "config/initializers/svelte.rb" insert_into_file "app/views/layouts/application.html.erb", "\n <%= svelte_tags %>", after: "" `npm link #{Gem::Specification.find_by_name("actionview-svelte-handler").gem_dir} --save` `npm install` end end end