###
  generator-joomla-spc

  index.coffee

  @author Sean Goresht

  @note uses Codoc
  @see https://github.com/mklabs/yeoman/wiki/generators coffeescript with yeoman
  @see https://github.com/coffeedoc/codo
###

(->
  (->
    (->
      'use strict'
      # coffeelint: disable=max_line_length
      ViewGenerator = undefined
      extend = undefined
      hasProp = undefined
      path = undefined
      yeoman = undefined
      ViewGenerator = undefined
      extend = undefined
      hasProp = undefined
      path = undefined
      yeoman = undefined
      ViewGenerator = undefined
      path = undefined
      yeoman = undefined

      extend = (child, parent) ->
        Ctor = undefined
        key = undefined
        Ctor = undefined
        key = undefined

        Ctor = ->
          @constructor = child
          return

        for key of parent
          key = key
          key = key
          if hasProp.call(parent, key)
            child[key] = parent[key]
        Ctor.prototype = parent.prototype
        child.prototype = new Ctor()
        child.__super__ = parent.prototype
        child

      hasProp = {}.hasOwnProperty
      yeoman = require('yeoman-generator')
      yosay = require('yosay')
      chalk = require('chalk')
      path = require('path')

      ###
        @class ViewGenerator sub-generator for joomla component controllers
      ###

      module.exports = ViewGenerator = ((superClass) ->
        'var ViewGenerator'

        ViewGenerator = (args, options, config) ->
          pkg = undefined
          ref = undefined
          ref1 = undefined
          ref2 = undefined
          ref3 = undefined
          pkg = undefined
          ref = undefined
          ref1 = undefined
          ref2 = undefined
          ref3 = undefined
          pkg = undefined
          ref = undefined
          ref1 = undefined
          ref2 = undefined
          ref3 = undefined
          ViewGenerator.__super__.constructor.call this, args, options, config
          pkg = JSON.parse(@readFileAsString(path.join(process.cwd(), './package.json')))
          @componentName = pkg.componentName
          @description = pkg.description
          @requireManageRights = pkg.requireManageRights
          @authorName = if (ref = pkg.author) != null then ref.name else undefined
          @authorEmail = if (ref1 = pkg.author) != null then ref1.email else undefined
          @authorURL = if (ref2 = pkg.author) != null then ref2.url else undefined
          @license = if (ref3 = pkg.licenses[0]) != null then ref3.type else undefined
          @currentYear = (new Date()).getFullYear()
          @viewFolderName = @_.slugify(@name)
          @viewClassName = @_.classify(@name)
          # @log(yosay(chalk.white('You called the view subgenerator with the argument ' + @name + '.\nNow let\'s create that view under the subdirectory views/' + @viewFolderName + ' for you...')))

          @log 'You called the view subgenerator with the argument ' + @name + '.\nNow let\'s create that view under the subdirectory views/' + @viewFolderName + ' for you...'
          return

        extend ViewGenerator, superClass
        # need to change views line to "views/#{@viewFolderName}/view.html.php"
        # @template "_view.html.php", "views/#{@viewFolderName}/view.html.php"
        # @template "_default.php", "views/#{@viewFolderName}/default.php"
        ViewGenerator::generateView = ->
          @template '_view.html.php', 'app/admin/' + "views/#{@viewFolderName}/view.html.php"
          @template '_default.php', 'app/admin/' + "views/#{@viewFolderName}/default.php"
          @template '_view.html.php', 'app/site/' + 'views/' + @viewFolderName + '/view.html.php'
          @template '_default.php', 'app/site/' + "views/#{@viewFolderName}/view.html.php"
          return

        ViewGenerator
      )(yeoman.generators.NamedBase)
      return
    ).call this
    return
  ).call this
  return
).call this
## sourceMappingURL=index.js.map

# ---
# generated by js2coffee 2.1.0