<commit_before># Pbw

Play By Web Engine for Rails.

## Rails setup

This engine requires the use of Rails 3.2 or greater, coffeescript, devise and mongoid.

ActiveRecord is not used.

## Installation

In your Gemfile, add this line:

    gem 'pbw'

Then run the following commands:

    bundle install
    rails g pbw:install

The install generator will create:

* Backbone assets and directory layout in your app/assets/javascript directory
* Configuration file for mongoid in config directory
* Mount route for the pbw engine at "/pbw"
* Devise view templates in app/views/devise
* Application layout for the Pbw engine in app/views/pbw/layouts

## Generators

### Areas

Areas are locales within your game such as Rooms, Worlds or Regions. 

They may contain Tokens and Items. They may also have Contraints and Triggers.

The base Pbw::Area model contains the attribute "name" by default. Additional attributes can be defined for your specific models.

    rails g pbw:areas [Class] [additional attributes]

Example:

    rails g pbw:area Room description:string

The areas generator will create:

* A model inheriting from Pbw::Area 
* A controller with an index method for your area plus index.html.erb template calling Backbone
* Backbone scaffold for your area class

### Items

### Tokens

### Commands

### Rules

#### Capability

#### Constraint

#### Process

#### Trigger
<commit_msg>A wee bit more documentation<commit_after># Pbw

Play By Web Engine for Rails.

## Rails setup

This engine requires the use of Rails 3.2 or greater, coffeescript, devise and mongoid.

ActiveRecord is not used.

It creates apps that use Backbone for the front-end.

## Installation

In your Gemfile, add this line:

    gem 'pbw'

Then run the following commands:

    bundle install
    rails g pbw:install

The install generator will create:

* Backbone assets and directory layout in your app/assets/javascript directory
* Configuration file for mongoid in config directory
* Mount route for the pbw engine at "/pbw"
* Devise view templates in app/views/devise
* Application layout for the Pbw engine in app/views/pbw/layouts

## Generators

### Areas

Areas are locales within your game such as Rooms, Worlds or Regions. 

They may contain Tokens and Items. They may also have Contraints and Triggers.

The base Pbw::Area model contains the attribute "name" by default. Additional attributes can be defined for your specific models.

    rails g pbw:areas [Class] [additional attributes]

Example:

    rails g pbw:area Room description:string

The areas generator will create:

* A model inheriting from Pbw::Area 
* A controller with an index method for your area plus index.html.erb template calling Backbone
* Backbone scaffold for your area class

### Items

### Tokens

### Commands

### Rules

#### Capability

#### Constraint

#### Process

#### Trigger

## Authentication and Authorisation

Pbw uses Devise for authentication mounted within the Pbw engine itself.

It uses CanCan for authorisation with dynamic roles and permissions associated with models.

{'fraction_non_alphanumeric': 0.06390609716335181, 'fraction_numerical': 0.0013042060645582002, 'mean_word_length': 4.113333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1934217', 'n_tokens_mistral': 866, 'n_tokens_neox': 829, 'n_words': 410}