Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
AjGenesisNode Sinatra tasks and templates, to generate web sites based on Sinatra. WIP.
JavaScript CSS
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
source
templates
test
.gitignore
.npmignore
LICENSE
README.md
create.js
package.json

README.md

AjGenesisNode Sinatra

AjGenesisNode Sinatra tasks and templates, to generate web sites based on Sinatra. WIP.

Setup

Install Node.js.

Install globally latests version of AjGenesis for Node, and Sinatra modules:

npm install ajgenesis -g
npm install ajgenesisnode-sinatra -g

Quick start

In any directory, create an application

ajgenesis sinatra:create demo
cd demo

The created directory contains the seed of a Sinatra application.

There is a subdirectory ajgenesis containing:

  • ajgenesis/models: where the free model files reside
  • ajgenesis/tasks: tasks to run
  • ajgenesis/templates: templates to be used
  • ajgenesis/libs: additional modules used by tasks

Install additional ajgenesis modules:

ajgenesis install entity
ajgenesis install model

The modules code and templates are installed under ajgenesis/modules folder.

Let add some entities and propeties:

ajgenesis entity:add customer
ajgenesis entity:addproperty customer name
ajgenesis entity:addproperty customer address
ajgenesis entity:add supplier
ajgenesis entity:addproperty supplier name
ajgenesis entity:addproperty supplier address

The new .json files will be added to models director.

Generate the site:

ajgenesis generate

The site uses sqlite3 and data-mapper:

gem install sqlite3
gem install dm-sqlite-adapter
gem install data_mapper

Check DataMapper Getting Starterd for more information. For Windows, check How do I install sqlite3 for Ruby on Windows?.

Run the site

ruby app.rb

TBD: explain dependencies, add gemfile

The site is available in your browser using http://localhost:4567.

Development

npm install -g ajgenesis
git clone git://github.com/ajlopez/AjGenesisNode-Sinatra.git
cd AjGenesisNode-Sinatra
npm link ajgenesis
npm install
npm test

Versions

  • 0.0.1 Published
  • 0.0.2 Published

References

Contribution

Feel free to file issues and submit pull requests — contributions are welcome.

If you submit a pull request, please be sure to add or update corresponding test cases, and ensure that npm test continues to pass.

Something went wrong with that request. Please try again.