<commit_before># RailsBackboneGenerator [![Gem Version](https://badge.fury.io/rb/rails-backbone-generator.png)](http://badge.fury.io/rb/rails-backbone-generator)  
Inspired by ``rails generate`` - Generates [Backbone.js](/documentcloud/backbone) models and collections with [BackboneFactory](/SupportBee/Backbone-Factory) and [Jasmine](/pivotal/jasmine) tests.  
The gem adds Backbone: [Setup](#backbonesetup) | [Namespace](#backbonenamespace) | [Model](#backbonemodel) | [Collection](#backbonecollection)


```  
    $ rails generate backbone:collection Dashboard::Widget 
    
    app/assets/javascripts/dashboard
    ├── collections
    │   └── widgets.coffee
    └── models
        └── widget.coffee
    
    spec/javascripts/dashboard
    ├── collections
    │   └── widgets_spec.coffee
    ├── factories
    │   └── widget_factory.coffee
    └── models
        └── widget_spec.coffee
```
## Installation
Add this line to your application's Gemfile:

    gem 'rails_backbone_generator'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rails_backbone_generator




## Usage
The gem has three main generators (and one for setup):  
[backbone:setup](#backbonesetup) | [backbone:namespace](#backbonenamespace) | [backbone:model](#backbonemodel) | [backbone:collection](#backbonecollection)
```
$ rails g # for generate

  Backbone:
    backbone:collection
    backbone:model
    backbone:namespace
    backbone:setup
```


##  backbone:namespace
Creates a namespaced directory structure
```
$ rails g backbone:namespace dashboard
  
  app/assets/javascripts/dashboard<commit_msg>README typo<commit_after># RailsBackboneGenerator [![Gem Version](https://badge.fury.io/rb/rails-backbone-generator.png)](http://badge.fury.io/rb/rails-backbone-generator)  
Inspired by ``rails generate`` - Generates [Backbone.js](/documentcloud/backbone) models and collections with [BackboneFactory](/SupportBee/Backbone-Factory) and [Jasmine](/pivotal/jasmine) tests.  
The gem adds Backbone: [Setup](#backbonesetup) | [Namespace](#backbonenamespace) | [Model](#backbonemodel) | [Collection](#backbonecollection)


```  
    $ rails generate backbone:collection Dashboard::Widget 
    
    app/assets/javascripts/dashboard
    ├── collections
    │   └── widgets.coffee
    └── models
        └── widget.coffee
    
    spec/javascripts/dashboard
    ├── collections
    │   └── widgets_spec.coffee
    ├── factories
    │   └── widget_factory.coffee
    └── models
        └── widget_spec.coffee
```
## Installation
Add this line to your application's Gemfile:

    gem 'rails-backbone-generator'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rails-backbone-generator




## Usage
The gem has three main generators (and one for setup):  
[backbone:setup](#backbonesetup) | [backbone:namespace](#backbonenamespace) | [backbone:model](#backbonemodel) | [backbone:collection](#backbonecollection)
```
$ rails g # for generate

  Backbone:
    backbone:collection
    backbone:model
    backbone:namespace
    backbone:setup
```


##  backbone:namespace
Creates a namespaced directory structure
```
$ rails g backbone:namespace dashboard
  
  app/assets/javascripts/dashboard
{'fraction_non_alphanumeric': 0.12608695652173912, 'fraction_numerical': 0.0, 'mean_word_length': 4.195161290322581, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '36987', 'n_tokens_mistral': 1068, 'n_tokens_neox': 995, 'n_words': 224}