tsmsogn / to_quickform

ToQuickform creates some QuickForm codes from given data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ToQuickform

Build Status Maintainability

ToQuickform creates some QuickForm codes from given data.

Installation

Add this line to your application's Gemfile:

gem 'to_quickform'

And then execute:

$ bundle

Or install it yourself as:

$ gem install to_quickform

Usage

Parsing an YAML/JSON

generator = ToQuickform.YAML(yaml)
generator = ToQuickform.JSON(json)

YAML format:

See https://github.com/tsmsogn/to_quickform/blob/master/spec/fixtures/sample.yaml

JSON format:

See https://github.com/tsmsogn/to_quickform/blob/master/spec/fixtures/sample.json

Creating setDefaults() codes

generator.to_set_defaults

Output https://github.com/tsmsogn/to_quickform/blob/master/spec/fixtures/set_defaults.txt

Creating addElement()/createElement() codes

generator.to_create_element

Output https://github.com/tsmsogn/to_quickform/blob/master/spec/fixtures/create_element.txt

Creating addRule()/addGrouoRule() codes

generator.to_add_rule

Output https://github.com/tsmsogn/to_quickform/blob/master/spec/fixtures/add_rule.txt

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tsmsogn/to_quickform.

About

ToQuickform creates some QuickForm codes from given data.

License:MIT License


Languages

Language:Ruby 99.4%Language:Shell 0.6%