Skip to content
Browse files

Move backbone and underscore for asset pipeline

- Move jQuery into the spec/ folder as we want to use the version
  bundled with Rails
- Provide Backbone at Underscore via asset pipeline
- Update README to reference included versions as well as how to override
  • Loading branch information...
1 parent 5a1debe commit 43fae9526e845944a5a8bd832550160bcb54a7e6 @christoomey christoomey committed
View
23 README.md
@@ -2,7 +2,7 @@
[![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
+There's no built-in garbage collection for Backbone’s event bindings, and
forgetting to unbind can cause bugs and memory leaks.
Backbone Support currently provides two utility classes, SwappingRouter and CompositeView,
@@ -72,7 +72,7 @@ parent view.
`CompositeView` maintains an array of its immediate children as
`this.children`. Using this reference, a parent view's `leave()`
-method will invoke `leave()` on all its children, ensuring that an entire
+method will invoke `leave()` on all its children, ensuring that an entire
tree of composed views is cleaned up properly.
For child views that can dismiss themselves, such as dialog boxes, children
@@ -81,12 +81,26 @@ maintain a back-reference at `this.parent`. This is used to reach up and call
## Dependencies
-You'll need these, but chances are you already have them in your app:
+Backbone Support requires the following dependencies:
* jQuery or Zepto
* Underscore
* Backbone
+### Included Versions
+
+For convenience, Backbone Support comes with a vendored copy of Backbone and
+Underscore to get you up and running as quickly as possible. If you want to
+use these included files, simply follow the instructions below in the
+[Installation][] section.
+
+### 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:
@@ -184,3 +198,6 @@ require("/vendor/plugins/backbone-support/lib/assets/javascripts/backbone-suppor
## License
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
View
6 spec/javascripts/support/jasmine.yml
@@ -11,9 +11,9 @@
# - dist/**/*.js
#
src_files:
- - vendor/jquery.js
- - vendor/underscore.js
- - vendor/backbone.js
+ - spec/javascripts/support/jquery.js
+ - vendor/assets/javascripts/underscore.js
+ - vendor/assets/javascripts/backbone.js
- lib/assets/javascripts/backbone-support.js
- lib/assets/javascripts/backbone-support/support.js
- lib/assets/javascripts/backbone-support/observer.js
View
0 vendor/jquery.js → spec/javascripts/support/jquery.js
File renamed without changes.
View
0 vendor/backbone.js → vendor/assets/javascripts/backbone.js
File renamed without changes.
View
0 vendor/underscore.js → vendor/assets/javascripts/underscore.js
File renamed without changes.

0 comments on commit 43fae95

Please sign in to comment.
Something went wrong with that request. Please try again.