Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Bump version and update docs for v0.3.2 gem release #16

Merged
merged 2 commits into from May 10, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG
@@ -1,3 +1,12 @@
0.3.2 (April 27, 2013)

- Backbone support now includes a vendored version of Backbone and Underscore
for use with the asset pipeline.
- SwappingRouter now calls 'swapped' method on new view as it is added to the
DOM. CompositeView emits an associated 'swapped' event.
- CompositeView#prependChildTo is now properly scoped to the view thanks to nhocki
- Backbone Support is now on Travis for continuous integration

0.3.1 (March 05, 2013)

Views fire 'leave' event when calling leave()
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
backbone-support (0.3.1)
backbone-support (0.3.2)

GEM
remote: https://rubygems.org/
Expand Down
83 changes: 51 additions & 32 deletions README.md
Expand Up @@ -2,15 +2,17 @@

[![Build Status](https://travis-ci.org/thoughtbot/backbone-support.png?branch=master)](https://travis-ci.org/thoughtbot/backbone-support)

There's no built-in garbage collection for Backbone’s event bindings, and
forgetting to unbind can cause bugs and memory leaks.
Backbone Support provides a collection of utility classes for use with
[Backbone.js][]. There's no built-in garbage collection for Backbone’s event
bindings, and forgetting to unbind can cause bugs and memory leaks. Backbone
Support has your covered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[typo] your


Backbone Support currently provides two utility classes, SwappingRouter and CompositeView,
that introduce a `leave()` function, which unbinds and cleans up the view.
They should be used where views are instantiated (in Router instances and in composite views).
Backbone Support currently provides two utility classes, SwappingRouter and
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove "currently" - unless you are The Doctor, or have access to time crystals, everything is "currently".

CompositeView, that introduce a `leave()` function, which unbinds and cleans up
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like two ideas - what about something like "...provides two utility classes, SwappingRouter and CompositeView, which should be used where views are instantiated (in Router instances and in composite views), and introduce the leave() function. leave() unbinds and cleans up the view."

the view. They should be used where views are instantiated (in Router
instances and in composite views).

Inspired by our projects and the Backbone.js on Rails book:
http://workshops.thoughtbot.com/backbone-js-on-rails
Inspired by our projects and the [Backbone.js on Rails book][].

The book contains complete instructions and in-depth coverage of the internals
of CompositeView and SwappingRouter, and an example application that shows
Expand Down Expand Up @@ -81,7 +83,7 @@ maintain a back-reference at `this.parent`. This is used to reach up and call

## Dependencies

Backbone Support requires the following dependencies:
Backbone Support has the following dependencies:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of "Backbone Support requires the following libraries"?


* jQuery or Zepto
* Underscore
Expand All @@ -96,47 +98,47 @@ use these included files, simply follow the instructions below in the

### Alternate Versions

If you require a different version of Backbone or Underscore than those provided
by this gem, simply put them in `vendor/assets/javascripts` and they will
take higher precedence than the versions provided by the gem thanks to the
ordering of the [search paths in the asset pipeline][].

## Development

First:

bundle

While TDD'ing:

bundle exec rake jasmine

To not open tests in a browser window:

bundle exec rake jasmine:ci
If you require a different version of Backbone or Underscore than those
provided by this gem, simply put the script files in
`vendor/assets/javascripts` and they will take higher precedence than the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"vendor/assets/javascripts, which has higher precedence than"

versions provided by the gem thanks to the ordering of the [search paths in the
asset pipeline][].

## Installation

The recommended usage is with Rails 3.1.
The recommended usage is with Rails 3.1 or higher to take advantage of the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about "We recommend you use Backbone-Support with Rails 3.1 or higher in order to take advantage of the asset pipeline"?

asset pipeline.

### With Rails 3.1
### With Rails 3.1 or higher

Add the gem to your Gemfile
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a colon at the end of this line?


gem "backbone-support"

And then `bundle install`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a period to the end of this line.


In your application.js, or in whatever file your backbone.js assets are
required in, add the following:
Before including any part of Backbone Support, you must include its
dependencies. In your application.js or any other manifest file, add the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe wrap "or any other manifest file" in a parenthetical?

following to load in the needed dependencies:

// jQuery is provided by the 'jquery-rails' gem, included with Rails
//= require jquery
//
// Backbone Support includes Backbone and Underscore, or you can provides
// alternate versions by placing them in vendor/assets/javascripts/
//= require backbone
//= require underscore

To require all of Backbone Support, add the following:

//= require backbone-support

This should be _above_ any usage of SwappingController or SwappingRouter, but
below the inclusion of Backbone.js, Underscore, and jQuery.

If you do not wish to include all of backbone-support, you can include
individual pieces. Require the support file(s) and the individual assets you wish to use:
individual pieces. Require the support file and the individual assets you
wish to use:

//= require backbone-support/support
//= require backbone-support/swapping_router
Expand Down Expand Up @@ -195,9 +197,26 @@ require("/vendor/plugins/backbone-support/lib/assets/javascripts/backbone-suppor
require("/vendor/plugins/backbone-support/lib/assets/javascripts/backbone-support/swapping_router.js");
```

## Development

First:

bundle

While TDD'ing:

bundle exec rake jasmine

To not open tests in a browser window:

bundle exec rake jasmine:ci

## License

Copyright 2012 thoughtbot. Please check LICENSE for more details.
Copyright 2012 thoughtbot. Please check [LICENSE][] for more details.

[Installation]: https://github.com/thoughtbot/backbone-support#installation
[search paths in the asset pipeline]: http://edgeguides.rubyonrails.org/asset_pipeline.html#search-paths
[Backbone.js on Rails book]: https://learn.thoughtbot.com/products/1-backbone-js-on-rails
[Backbone.js]: http://backbonejs.org/
[LICENSE]: https://github.com/thoughtbot/backbone-support/blob/master/LICENSE
2 changes: 1 addition & 1 deletion lib/assets/javascripts/backbone-support/support.js
@@ -1,2 +1,2 @@
window.Support = {};
Support.VERSION = "0.0.1";
Support.VERSION = "0.3.2";
2 changes: 1 addition & 1 deletion lib/backbone-support/version.rb
@@ -1,3 +1,3 @@
module BackboneSupport
VERSION = '0.3.1'.freeze
VERSION = '0.3.2'.freeze
end