backbonejs-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.gitignore +4 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/README.md +42 -0
- data/Rakefile +2 -0
- data/backbonejs-rails.gemspec +29 -0
- data/lib/backbonejs-rails/railtie.rb +16 -0
- data/lib/backbonejs-rails/version.rb +5 -0
- data/lib/backbonejs-rails.rb +9 -0
- data/vendor/.DS_Store +0 -0
- data/vendor/assets/.DS_Store +0 -0
- data/vendor/assets/javascripts/backbone.js +1011 -0
- data/vendor/assets/javascripts/backbone.min.js +27 -0
- data/vendor/assets/javascripts/icanhaz.js +401 -0
- data/vendor/assets/javascripts/icanhaz.min.js +9 -0
- data/vendor/assets/javascripts/json2.js +480 -0
- data/vendor/assets/javascripts/underscore.js +807 -0
- data/vendor/assets/javascripts/underscore.min.js +26 -0
- metadata +140 -0
data/.DS_Store
ADDED
Binary file
|
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.2@backbonejs-rails --create
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
What Does it do?
|
2
|
+
----------------
|
3
|
+
|
4
|
+
Compatible with Rails 3.0.x (Rails 3.1.x support is coming)
|
5
|
+
|
6
|
+
backbonejs-rails is similar to jquery-rails. It adds the Javascript files that you need to create an application that uses backbone.js as a JavaScript MVC. This gem will get the most recent version of these files from their master branches on github.
|
7
|
+
|
8
|
+
These are:
|
9
|
+
|
10
|
+
* backbone.js
|
11
|
+
* backbone.min.js
|
12
|
+
* underscore.js
|
13
|
+
* underscore.min.js
|
14
|
+
* json2.js
|
15
|
+
|
16
|
+
For templates I have included ICanHaz.js
|
17
|
+
|
18
|
+
* icanhaz.js
|
19
|
+
* icanhaz.min.js
|
20
|
+
|
21
|
+
Upon installation the files are added to your javascript defaults so that you can still use the following in your views/layouts/application.html.erb file:
|
22
|
+
|
23
|
+
<%= javascript_include_tag :defaults %>
|
24
|
+
|
25
|
+
Installation
|
26
|
+
------------
|
27
|
+
|
28
|
+
The best way to install backbone-rails is by adding the following to your Gemfile:
|
29
|
+
gem "jquery-rails"
|
30
|
+
gem "backbonejs-rails"
|
31
|
+
|
32
|
+
Then use Bundler to install:
|
33
|
+
|
34
|
+
$ bundle install
|
35
|
+
|
36
|
+
Usage
|
37
|
+
-------
|
38
|
+
|
39
|
+
$ rails g jquery:install
|
40
|
+
$ rails g backbonejs:install
|
41
|
+
|
42
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "backbonejs-rails/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "backbonejs-rails"
|
7
|
+
s.version = Backbonejs::Rails::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Andrew Gertig"]
|
10
|
+
s.email = ["andrew.gertig@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Provide files needed for using Backbone.js}
|
13
|
+
s.description = %q{This gem works with Rails 3.0.x. It creates the following files in public/javasripts: backbone.js, underscore.js, json2.js, and optionally icanhaz.js for templates. It also creates an initializer that fixes the way Rails returns JSON to Backbone.js}
|
14
|
+
|
15
|
+
s.rubyforge_project = "backbonejs-rails"
|
16
|
+
|
17
|
+
s.add_dependency "railties", "~> 3.0"
|
18
|
+
s.add_dependency "thor", "~> 0.14"
|
19
|
+
s.add_dependency "curb", "~> 0.7.15"
|
20
|
+
s.add_development_dependency "bundler", "~> 1.0.0"
|
21
|
+
s.add_development_dependency "rails", "~> 3.0"
|
22
|
+
s.add_development_dependency "rake", "~> 0.8.7"
|
23
|
+
|
24
|
+
|
25
|
+
s.files = `git ls-files`.split("\n")
|
26
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
28
|
+
s.require_paths = ["lib"]
|
29
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Backbonejs
|
2
|
+
module Rails
|
3
|
+
|
4
|
+
class Railtie < ::Rails::Railtie
|
5
|
+
config.before_configuration do
|
6
|
+
|
7
|
+
js_defaults = ::Rails.env.production? ? %w(json2 underscore.min backbone.min icanhaz.min) : %w(json2 underscore backbone icanhaz)
|
8
|
+
|
9
|
+
# Merge the jQuery scripts, remove the Prototype defaults and finally add 'rails'
|
10
|
+
# at the end, because load order is important
|
11
|
+
config.action_view.javascript_expansions[:defaults] |= js_defaults
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
data/vendor/.DS_Store
ADDED
Binary file
|
Binary file
|