Sha256: 06c719d8e7962ef2b12c4a2c22625d653c548d7f1223da3b0043b29b6b11f06a
Contents?: true
Size: 926 Bytes
Versions: 1
Compression:
Stored size: 926 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] ) else Eucalypt::Error.wrong_directory end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
eucalypt-0.9.0 | lib/eucalypt/generate/namespaces/generate-controller/cli/generate-controller.rb |