Class: Svelte::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/svelte/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#installObject



7
8
9
10
11
12
13
14
# File 'lib/generators/svelte/install_generator.rb', line 7

def install
  copy_file "initializer.rb", "config/initializers/svelte.rb"
  insert_into_file "app/views/layouts/application.html.erb",
    "\n    <%= svelte_tags %>",
    after: "<head>"
  `npm link #{Gem::Specification.find_by_name("actionview-svelte-handler").gem_dir} --save`
  `npm install`
end