Sha256: 12e9cb396bc127ee22fafe8c75a848ec217274a4ed5c9ab16f58d90b768f18bc

Contents?: true

Size: 609 Bytes

Versions: 3

Compression:

Stored size: 609 Bytes

Contents

# frozen_string_literal: true

require_relative '../../command'

module Vtk
  module Commands
    class Module
      # Adds a new module controller to vets-api
      class Controller < Vtk::Command
        attr_accessor :name, :options

        def initialize(name, options)
          @name = name
          @options = options

          super()
        end

        def execute(_input: $stdin, _output: $stdout)
          create_controller(name)
        end

        private

        def create_controller(name)
          `rails g module_component #{name} controller`
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vtk-0.2.2 lib/vtk/commands/module/controller.rb
vtk-0.2.1 lib/vtk/commands/module/controller.rb
vtk-0.2.0 lib/vtk/commands/module/controller.rb