Sha256: 1310810c1caa1020328b636de8591b4746673b128812f4e84d874c85bba3590d

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 Bytes

Contents

class DevSystem::GenerateCommand < DevSystem::Command

  def self.call args
    # 1. LOG

    log :higher, "args: #{args}"
    puts

    # 2. FIND generator

    return call_not_found args if args.none?

    generator = args[0]

    log({generator:})

    #

    begin
      generator_class = Liza.const "#{generator}_generator"
    rescue Liza::ConstNotFound
      generator_class = NotFoundGenerator
    end

    # 3. CALL

    generator_class.call args[1..-1]
  end

  def self.call_not_found args
    Liza::NotFoundGenerator.call args
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lizarb-1.0.3 lib/dev_system/dev/controllers/command/generate_command.rb