Sha256: 7c14bf1ec8cb90feaafd5738e7054db2536318ca37af0d8c10466f86fd01a06d
Contents?: true
Size: 745 Bytes
Versions: 5
Compression:
Stored size: 745 Bytes
Contents
module Slayer module Generators class ScaffoldGenerator < NamedBase desc "This generator creates a new Slayer::Commands and a corresponding Slayer::Form" source_root File.expand_path("../templates", __FILE__) check_class_collision suffix: "Command" argument :name, type: :string argument :fields, :type => :array, :required => false, :desc => "The attributes of the generated form. name:String completed:Boolean" def initialize(args, *options) #:nodoc: super @args = args end def create_command_files generate "slayer:command", "#{file_name}" end def create_form_files generate "slayer:form", "#{@args.join(" ")}" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems