/extgen

This software is simple Sencha Ext JS component generator. It Follows Sencha Ext JS MVC pattern. It was built for my own purposes.

Primary LanguageRubyBSD 2-Clause "Simplified" LicenseBSD-2-Clause

What is it?

This software is simple Sencha Ext JS component generator. It Follows Sencha Ext JS MVC pattern. It was built for my own purposes.

Documentation

CLI

SYNOPSIS

extgen <Command> <Template> <Definition> <Options>

Templates and options

Command

  • generate or gen to generate file
  • remove or rm to remove file

General Options

  • -o output generated code

Grid

  • -fn=<Number> number of fields generated for grid (coming soon)
  • -s create and bind Store to grid
  • -m create and bind Model to store
  • -c generate constrcutor code

Example

Create grid with store, model and 3 fields

extgen grid Grid.definition.GoesHere -s -m -fn-3

Combo

  • -s create and bind Store to grid
  • -m create and bind Model to store
  • -c generate constrcutor code

Example

Create Combobox with store and model

extgen generate combo Combo.definiton.GoesHere -s -m

Store

  • -m create and bind Model to store
  • -paj add paramsAsJson to store.proxy
  • -url=<String> sets proxy.url

Example

Create Store with model

extgen generate store Store.definition.GoesHere -m

Model

Currently has no options

Example

Create Model

extgen generate model Model.definition.GoesHere

Panel | Form

  • -layout=<String> set layout type
  • -c generate constrcutor code

Example

Create Panel

extgen generate panel Panel.definition.GoesHere -layout=hbox

Controller

Currently has no options

Example

Create Controller

extgen generate controller Controller.definition.GoesHere

Installation

Move to extgen directory and type

echo alias extgen=\"ruby $(pwd)/main.rb\" >> ~/.bashrc

Configuration

  1. Put config (extgen_config.yml) file to your project root.
  2. Set project_name in config file your project name.
  3. Set path_to_ext_app in config to your Ext JS app directory.

Templates

This software uses ERB Templates.

Create New Template

  • <Template> - capitalized template path without .erb
  • <Type> - model, view, controller or something else
  1. Add template ERB file to templates directory
  2. Add <Template>: <Type> to templates/tpl_types.yml

Using Options In Template

In template option? <String> checks if <String> is present. @eq_options[:option] returns value from command line argument -option=<Value>.

Scripts

Script class contains methods that should be called from template. Call Script class with Generator instance. Example:

Script.new(self).some_method()

License

Please see the file called LICENSE.

Reporting Bugs

Report Bugs to repository Issues