Sha256: 95e1e2d1b45f6a9ff1d666e8b2835e5b2d6f3ee5f64a540f24552638f7b16afb

Contents?: true

Size: 697 Bytes

Versions: 4

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

module KStarter
  module Commands
    # Command Name goes here
    class NewProject < KStarter::Commands::Command
      attr_reader :form_type
      attr_reader :form_variant

      def initialize(form_type:, form_variant:)
        @form_type = form_type
        @form_variant = form_variant

        super()
      end

      def execute(input: $stdin, output: $stdout)
        questions = ask_questions(form_type, form_variant)
        questions.ask_questions

        puts JSON.pretty_generate(questions.to_h)
        App.project.save_project(questions)
      rescue KStarter::EscapePressed
        prompt.warn 'Exiting without saving'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
k_starter-0.1.4 lib/k_starter/commands/project/new_project.rb
k_starter-0.1.3 lib/k_starter/commands/project/new_project.rb
k_starter-0.1.2 lib/k_starter/commands/project/new_project.rb
k_starter-0.1.1 lib/k_starter/commands/project/new_project.rb