Sha256: 438a42d154b24c66220b197c93e8eb2e991b1362906f4f64e904dcbd31442940

Contents?: true

Size: 826 Bytes

Versions: 2

Compression:

Stored size: 826 Bytes

Contents

#!/usr/bin/env ruby

require 'ratchets/scaffold/controller'

module ProUtils

  class ScaffoldCommand #< Console::Command

    def self.start
      new.start
    end

    def initialize
      args, opts = Console::Arguments.new.parse

      help if opts['help']

      @type = args[0].to_s.downcase

      exit -1 if @type == ''

      @dryrun = opts['dryrun'] || opts['noharm'] || opts['n']
    end

    def __help
      $stdout << File.read(File.join(File.dirname(__FILE__), 'help.txt'))
      exit 0
    end

    def __dryrun
      @dryrun = true
    end
    alias :__noharm, :__dryrun
    alias :_n, :__dryrun

    def start
      Architect.scaffold(@type, :dryrun => @dryrun)
    end

    def help
      $stdout << File.read(File.join(File.dirname(__FILE__), 'help.txt'))
      exit 0
    end

  end #class Command

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
proutils-0.3.1 work/mint/command-old.rb
proutils-0.3.0 work/mint/command-old.rb