Module: VitePadrino::Installation
- Defined in:
- lib/vite_padrino/installation.rb
Overview
Internal: Extends the base installation script from Vite Ruby to work for a typical Padrino app.
Constant Summary collapse
- PADRINO_TEMPLATES =
Pathname.new(File.('../../templates', __dir__))
Instance Method Summary collapse
-
#install_sample_files ⇒ Object
Override: Inject the vite client and sample script to the default HTML template.
-
#setup_app_files ⇒ Object
Override: Setup a typical apps/web Padrino app to use Vite.
Instance Method Details
#install_sample_files ⇒ Object
Override: Inject the vite client and sample script to the default HTML template.
21 22 23 24 25 26 27 |
# File 'lib/vite_padrino/installation.rb', line 21 def install_sample_files super inject_line_after root.join('app/views/layouts/application.haml'), '%title', " = vite_client_tag\n = vite_javascript_tag 'application'\n HTML\nend\n" |
#setup_app_files ⇒ Object
Override: Setup a typical apps/web Padrino app to use Vite.
11 12 13 14 15 16 17 18 |
# File 'lib/vite_padrino/installation.rb', line 11 def setup_app_files cp PADRINO_TEMPLATES.join('config/padrino-vite.json'), config.config_path inject_line_after root.join('app/app.rb'), 'register', ' register VitePadrino' append root.join('Rakefile'), " require 'vite_padrino'\n ViteRuby.install_tasks\n RAKE\nend\n" |