Sha256: 446f135def7495366222aa06f8250169e1a223e2d81ff773067a25b6fdd00ea3

Contents?: true

Size: 778 Bytes

Versions: 3

Compression:

Stored size: 778 Bytes

Contents

class DijitGenerator < Rails::Generator::Base
  attr :dijit

  def extract_opts!(args)
    @dijit_full_name = args.shift
    @dijit=Depo::DijitConventions.new(@dijit_full_name)
  end

  def assigns
   @assigns ||= {:assigns=>dijit.to_hash.merge(:config=>Depo.config)}
  end

  def test?
    true
  end

  def style?
    true
  end

  def manifest
    record do |m|
      extract_opts!(args)
      m.directory dijit.package_path
      m.directory dijit.style_dir_path
      m.directory dijit.test_dir_path

      m.template "class.js", dijit.class_path, assigns
      m.template "test.js", dijit.test_code_path,assigns if test?
      m.template "test.html", dijit.test_page_path,assigns if test?
      m.template "style.css", dijit.style_path,assigns if style?
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
depo-0.0.3 generators/dijit/dijit_generator.rb
depo-0.0.2 generators/dijit/dijit_generator.rb
depo-0.0.1 generators/dijit/dijit_generator.rb