Sha256: c04c05a4b163115f7d7cbe8676dc83bf922aa4192102d86506fc01f865ae4df2

Contents?: true

Size: 858 Bytes

Versions: 6

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

require "snowpack/cli/application/command"
require "snowpack/generators/slice/generator"

module Snowpack
  module CLI
    module Application
      module Commands
        module Generate
          class Slice < Command
            desc "Generate slice"

            argument :name, desc: "Name for the slice"
            option :web, type: :boolean, default: true, desc: "Include web routing and views support in generated slice"

            def call(name:, web:, **)
              name ||= path

              # TODO raise ArgumentError, "invalid name blah blah"

              generator = Generators::Slice::Generator.new
              generator.(application: application, slice_name: name, web: web)
            end
          end
        end

        register "generate slice", Generate::Slice
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snowpack-1.0.0.alpha7 lib/snowpack/cli/application/commands/generate/slice.rb
snowpack-1.0.0.alpha6 lib/snowpack/cli/application/commands/generate/slice.rb
snowpack-1.0.0.alpha5 lib/snowpack/cli/application/commands/generate/slice.rb
snowpack-1.0.0.alpha4 lib/snowpack/cli/application/commands/generate/slice.rb
snowpack-1.0.0.alpha3 lib/snowpack/cli/application/commands/generate/slice.rb
snowpack-1.0.0.alpha2 lib/snowpack/cli/application/commands/generate/slice.rb