Class: ViteRuby::CLI

Inherits:
Object
  • Object
show all
Extended by:
Dry::CLI::Registry
Defined in:
lib/vite_ruby/cli.rb

Overview

Public: Command line interface that allows to install the library, and run simple commands.

Defined Under Namespace

Modules: FileUtils Classes: Build, Clobber, Dev, Install, SSR, Upgrade, UpgradePackages, Version, Vite

Class Method Summary collapse

Class Method Details

.require_framework_libraries(path = "cli") ⇒ Object

Internal: Allows framework-specific variants to extend the CLI.



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/vite_ruby/cli.rb', line 20

def self.require_framework_libraries(path = "cli")
  ViteRuby.framework_libraries.each do |_framework, library|
    # If library has typical structure and is just called vite_roda, this isn't required
    if library.name == 'roda-vite'
      require 'roda-vite'
      require ['vite_roda', path].compact.join('/')
    else
      require [library.name.tr("-", "/").to_s, path].compact.join("/")
    end
  end
rescue LoadError => e
  require_framework_libraries "installation" unless path == "installation"
end