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 ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.9.2@backbonejs-rails --create
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in backbonejs-rails.gemspec
4
+ gemspec
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,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -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
@@ -0,0 +1,5 @@
1
+ module Backbonejs
2
+ module Rails
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'rails/generators/base'
2
+
3
+ module Backbonejs
4
+ module Rails #Generators
5
+ if ::Rails.version < "3.1"
6
+ require 'backbonejs-rails/railtie'
7
+ end
8
+ end
9
+ end
data/vendor/.DS_Store ADDED
Binary file
Binary file