Sha256: 306e585551a7995014ddc1e6ea75cdf112e7e4032fd14dc3b196248d908dd1f2

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

@Base = require './base' if module?

class Widget extends @Base
  constructor: (@name, destination, templates) ->
    super(destination, templates)
    @destination = @join @destination, 'source'

  generate: ->
    namespace = @getNamespace @name
    basename  = @getBasename @name
    template  = if namespace.length > 0 then 'namespaced' else 'basic'

    @template ['widget', "#{template}.coffee"], ['widgets', @join(namespace...), "#{basename}.coffee"],
      namespace_name: (@camelize(x) for x in namespace).join('.')
      class_name: @camelize(basename)
      view_name: basename

    @file ['templates', 'widgets', @join(namespace...), "#{basename}.jst.hamlc"]

    @actions

if module?
  module.exports = Widget
else
  @Generator = Widget

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
joosy-1.2.0.alpha.5 src/joosy/generators/widget.coffee