Sha256: f5f677c6cd5836863361a5b296b51555d9e60bdb602454b619359ed4552e8e89

Contents?: true

Size: 1.83 KB

Versions: 1

Compression:

Stored size: 1.83 KB

Contents

# frozen_string_literal: true

# Examples
# bundle gem --coc --ci=github --exe --linter=rubocop --test=rspec --mit k_genesis
# bundle gem --coc --test=rspec --mit k_genesis
# bundle gem --coc --test=rspec --mit conventional_gitflow
# bundle gem --coc --test=rspec --mit k_director
# bundle gem --coc --test=rspec --mit k_config
# bundle gem --coc --test=rspec --mit funky
# bundle gem --coc --test=rspec --mit --linter=rubocop --ci-github cmdlet
# bundle gem --coc --test=rspec --mit cmdlet
# bundle gem --coc --test=rspec --mit drawio_dsl
# bundle gem --coc --test=rspec --mit tailwind_dsl
# bundle gem --coc --test=rspec --mit test-google-cloud-functions
# bundle gem --coc --test=rspec --mit test_google_cloud_functions
# bundle gem --coc --test=rspec --mit handlebarsjs
# bundle gem --coc --test=rspec --mit k_starter

module KStarter
  module Starters
    # Generate command line for a new ruby gem project.
    class Svelte < KStarter::Starters::Base
      def execute
        create_app
        create_kbuilder

        project_open_in_vscode
      end

      private

      def create_app
        if project_path_exist?
          return exiting            if ask_exit_if_project_exists

          project_path_delete       if ask_destroy_existing_project
        end

        system_in_root(script)
      end

      def script
        <<-BASH

        echo "Generating gem project #{project.name}..."
        echo "Current folder: "
        pwd

        #{genesis_vite}

        BASH
      end

      # Alternate technique
      def genesis_sveltekit
        "npm create svelte #{project.name}"
      end

      # This is the current technique
      def genesis_vite
        "npm init vite #{project.name}"
      end

      # deprecated (use vite or sveltekit)
      def genesis_degit
        "npx degit sveltejs/template #{project.name}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
k_starter-0.1.3 lib/k_starter/starters/svelte.rb