Sha256: b71818cc4819901e8e3cb80ad5a0d4c21f575b3f37eee4e138cc40b9438c10a9

Contents?: true

Size: 479 Bytes

Versions: 4

Compression:

Stored size: 479 Bytes

Contents

class Kaze::Commands::App::StackFactory
  def self.make(stack)
    available_stacks = {
      hotwire: 'hotwire',
      react: 'inertia_react',
      vue: 'inertia_vue'
    }

    raise Kaze::Commands::InvalidStackError, "Invalid stack. Supported stacks are #{available_stacks.keys.map { |k| "[#{k}]" }.join(', ')}." unless available_stacks.key?(stack)

    Object.const_get("Kaze::Commands::App::#{available_stacks[stack].split(/_/).map(&:capitalize).join}Stack").new
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kaze-0.17.0 lib/kaze/commands/app/stack_factory.rb
kaze-0.16.0 lib/kaze/commands/app/stack_factory.rb
kaze-0.15.0 lib/kaze/commands/app/stack_factory.rb
kaze-0.14.0 lib/kaze/commands/app/stack_factory.rb