Sha256: 9a547e1ba0e7fdf9ee891f46e5783f527fd52ba7af163089ac4213af5a2bebb2

Contents?: true

Size: 928 Bytes

Versions: 12

Compression:

Stored size: 928 Bytes

Contents

# frozen_string_literal: true

desc "Create a new project"
argument :path, "Where to create the project", required: true
global_task :create, [:path] do |_, args|
  require "pakyow/support/inflector"

  project_name = Pakyow::Support.inflector.underscore(
    File.basename(args[:path]).downcase
  )

  project_name.gsub!("  ", " ")
  project_name.gsub!(" ", "_")

  human_project_name = Pakyow::Support.inflector.humanize(project_name)

  require "pakyow/generators/project"
  Pakyow::Generators::Project.new(
    File.expand_path("../../generators/project/default", __FILE__)
  ).generate(args[:path], project_name: project_name, human_project_name: human_project_name)

  require "pakyow/support/cli/style"
  puts <<~OUTPUT

    #{Pakyow::Support::CLI.style.bold "You're all set! Go to your new project:"}
      $ cd #{args[:path]}

    #{Pakyow::Support::CLI.style.bold "Then boot it up:"}
      $ pakyow boot

  OUTPUT
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pakyow-core-1.0.6 lib/pakyow/tasks/create.rake
pakyow-core-1.0.5 lib/pakyow/tasks/create.rake
pakyow-core-1.0.4 lib/pakyow/tasks/create.rake
pakyow-core-1.0.3 lib/pakyow/tasks/create.rake
pakyow-core-1.0.2 lib/pakyow/tasks/create.rake
pakyow-core-1.0.1 lib/pakyow/tasks/create.rake
pakyow-core-1.0.0 lib/pakyow/tasks/create.rake
pakyow-core-1.0.0.rc5 lib/pakyow/tasks/create.rake
pakyow-core-1.0.0.rc4 lib/pakyow/tasks/create.rake
pakyow-core-1.0.0.rc3 lib/pakyow/tasks/create.rake
pakyow-core-1.0.0.rc2 lib/pakyow/tasks/create.rake
pakyow-core-1.0.0.rc1 lib/pakyow/tasks/create.rake