Sha256: 4bcdd33011afdc2978478eae43473fba4e550c189f0084114ffabd53aecf8358
Contents?: true
Size: 978 Bytes
Versions: 21
Compression:
Stored size: 978 Bytes
Contents
require 'eucalypt/generate/namespaces/generate-controller/generators/controller' require 'eucalypt/app' require 'eucalypt/errors' require 'eucalypt/helpers' module Eucalypt class Generate < Thor include Eucalypt::Helpers using Colorize option :spec, type: :boolean, default: true, desc: "Include a controller spec file" option :rest, aliases: '-r', type: :boolean, default: false, desc: "Generate REST routes for the controller" desc "controller [NAME]", "Generates a controller".colorize(:grey) def controller(name) directory = File.expand_path('.') if Eucalypt.app? directory controller = Eucalypt::Generators::Controller.new controller.destination_root = directory controller.generate( name: name, spec: options[:spec], rest: options[:rest], policy: false, headless: false ) else Eucalypt::Error.wrong_directory end end end end
Version data entries
21 entries across 21 versions & 1 rubygems
Version | Path |
---|---|
eucalypt-0.3.0 | lib/eucalypt/generate/namespaces/generate-controller/cli/generate-controller.rb |