diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..eca07e4 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.1.2 diff --git a/Gemfile b/Gemfile index 2bd2ffc..0747ac9 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ gem 'handlebars_assets', '~> 0.18' group :development, :test do # Call 'debugger' anywhere in the code to stop execution and get a debugger console - gem 'debugger' + #gem 'debugger' # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' @@ -33,4 +33,3 @@ group :development, :test do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end - diff --git a/Gemfile.lock b/Gemfile.lock index f6f45de..ebec908 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,14 +47,7 @@ GEM coffee-script-source execjs coffee-script-source (1.9.0) - columnize (0.9.0) debug_inspector (0.0.2) - debugger (1.6.8) - columnize (>= 0.3.1) - debugger-linecache (~> 1.2.0) - debugger-ruby_core_source (~> 1.3.5) - debugger-linecache (1.2.0) - debugger-ruby_core_source (1.3.8) erubis (2.7.0) execjs (2.3.0) globalid (0.3.2) @@ -154,7 +147,6 @@ PLATFORMS DEPENDENCIES coffee-rails (~> 4.1.0) - debugger handlebars_assets (~> 0.18) jbuilder (~> 2.0) jquery-rails diff --git a/app/assets/javascripts/commonjs/app.js b/app/assets/javascripts/commonjs/app.js index 7a11ab9..fa78d27 100644 --- a/app/assets/javascripts/commonjs/app.js +++ b/app/assets/javascripts/commonjs/app.js @@ -1,14 +1,12 @@ 'use strict'; var Backbone = require('backbone'); +var $ = require('jquery'); var Todos = require('./collections/todos'); var AppView = require('./views/app-view'); +Backbone.$ = $; function init() { - // Have to manually set jQuery on Backbone, because we're in a CommonJS - // environment. - Backbone.$ = window.jQuery; - // Create our collection of **Todos**. var todos = new Todos(); diff --git a/app/assets/javascripts/commonjs/manifest.bundle.js b/app/assets/javascripts/commonjs/manifest.bundle.js index 3e3ccb4..a72d5ef 100644 --- a/app/assets/javascripts/commonjs/manifest.bundle.js +++ b/app/assets/javascripts/commonjs/manifest.bundle.js @@ -1,4 +1,5 @@ -var app = require('./app'); +var $ = require('jquery'), + app = require('./app'); // Go! $(function() { diff --git a/app/assets/javascripts/commonjs/views/app-view.js b/app/assets/javascripts/commonjs/views/app-view.js index 81e994a..7406cd2 100644 --- a/app/assets/javascripts/commonjs/views/app-view.js +++ b/app/assets/javascripts/commonjs/views/app-view.js @@ -39,7 +39,7 @@ module.exports = Backbone.View.extend({ this.$input = this.$('#new-todo'); this.$footer = this.$('#footer'); this.$main = this.$('#main'); - this.$list = $('#todo-list'); + this.$list = this.$('#todo-list'); this.listenTo(this.todos, 'add', this.addOne); this.listenTo(this.todos, 'reset', this.addAll); diff --git a/app/assets/javascripts/globals/views/app-view.js b/app/assets/javascripts/globals/views/app-view.js index 3dafc09..71c632b 100644 --- a/app/assets/javascripts/globals/views/app-view.js +++ b/app/assets/javascripts/globals/views/app-view.js @@ -32,7 +32,7 @@ var app = app || {}; this.$input = this.$('#new-todo'); this.$footer = this.$('#footer'); this.$main = this.$('#main'); - this.$list = $('#todo-list'); + this.$list = this.$('#todo-list'); this.listenTo(app.todos, 'add', this.addOne); this.listenTo(app.todos, 'reset', this.addAll); diff --git a/bin/erubis b/bin/erubis new file mode 100755 index 0000000..2c7348b --- /dev/null +++ b/bin/erubis @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'erubis' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('erubis', 'erubis') diff --git a/bin/nokogiri b/bin/nokogiri new file mode 100755 index 0000000..d55f84b --- /dev/null +++ b/bin/nokogiri @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'nokogiri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('nokogiri', 'nokogiri') diff --git a/bin/rackup b/bin/rackup new file mode 100755 index 0000000..8cc9953 --- /dev/null +++ b/bin/rackup @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rackup' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rack', 'rackup') diff --git a/bin/rails b/bin/rails index 5191e69..657440d 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,16 @@ #!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' +# +# This file was generated by Bundler. +# +# The application 'rails' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('railties', 'rails') diff --git a/bin/rake b/bin/rake index 1724048..26c7a2d 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,16 @@ #!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rake', 'rake') diff --git a/bin/rdoc b/bin/rdoc new file mode 100755 index 0000000..f57260f --- /dev/null +++ b/bin/rdoc @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rdoc', 'rdoc') diff --git a/bin/ri b/bin/ri new file mode 100755 index 0000000..90f2517 --- /dev/null +++ b/bin/ri @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'ri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rdoc', 'ri') diff --git a/bin/sass b/bin/sass new file mode 100755 index 0000000..d65bb10 --- /dev/null +++ b/bin/sass @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'sass') diff --git a/bin/sass-convert b/bin/sass-convert new file mode 100755 index 0000000..ddde743 --- /dev/null +++ b/bin/sass-convert @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sass-convert' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'sass-convert') diff --git a/bin/scss b/bin/scss new file mode 100755 index 0000000..9f5e435 --- /dev/null +++ b/bin/scss @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'scss' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'scss') diff --git a/bin/sdoc b/bin/sdoc new file mode 100755 index 0000000..9da297e --- /dev/null +++ b/bin/sdoc @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sdoc', 'sdoc') diff --git a/bin/sdoc-merge b/bin/sdoc-merge new file mode 100755 index 0000000..e29a7d9 --- /dev/null +++ b/bin/sdoc-merge @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sdoc-merge' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sdoc', 'sdoc-merge') diff --git a/bin/spring b/bin/spring index 7f24d96..38fee6f 100755 --- a/bin/spring +++ b/bin/spring @@ -1,18 +1,16 @@ #!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'spring' is installed as part of a gem, and +# this file is here to facilitate running it. +# -# This file loads spring without using Bundler, in order to be fast -# It gets overwritten when you run the `spring binstub` command +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) -unless defined?(Spring) - require "rubygems" - require "bundler" +require 'rubygems' +require 'bundler/setup' - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) - ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) - ENV["GEM_HOME"] = "" - Gem.paths = ENV - - gem "spring", match[1] - require "spring/binstub" - end -end +load Gem.bin_path('spring', 'spring') diff --git a/bin/sprockets b/bin/sprockets new file mode 100755 index 0000000..09a1ad1 --- /dev/null +++ b/bin/sprockets @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sprockets' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sprockets', 'sprockets') diff --git a/bin/thor b/bin/thor new file mode 100755 index 0000000..8421e00 --- /dev/null +++ b/bin/thor @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'thor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('thor', 'thor') diff --git a/bin/tilt b/bin/tilt new file mode 100755 index 0000000..09fe73e --- /dev/null +++ b/bin/tilt @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'tilt' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('tilt', 'tilt') diff --git a/lib/browserify_template.rb b/lib/browserify_template.rb index 816ed55..8c8ab3f 100644 --- a/lib/browserify_template.rb +++ b/lib/browserify_template.rb @@ -20,10 +20,10 @@ def evaluate(scope, locals, &block) end # Transform the file with Browserify. - @output ||= bundler('bundle', scope.pathname) + @output = bundler('bundle', scope.pathname) end - @output + @output || '' end protected diff --git a/package.json b/package.json index de441b3..75cc5e2 100644 --- a/package.json +++ b/package.json @@ -20,15 +20,16 @@ }, "homepage": "https://github.com/spikebrehm/sprockets-node-example", "dependencies": { - "backbone": "^1.1.2", + "backbone": "^1.2.1", "backbone.localstorage": "^1.1.16", - "handlebars": "^2.0.0", - "underscore": "^1.7.0" + "handlebars": "^3.0.3", + "jquery": "^2.1.4", + "underscore": "^1.8.3" }, "devDependencies": { - "browserify": "^8.1.3", - "concat-stream": "^1.4.7", + "browserify": "^10.2.4", + "concat-stream": "^1.5.0", "hbsfy": "^2.2.1", - "yargs": "^2.1.1" + "yargs": "^3.11.0" } }