Permalink
Browse files

initial commit / structure

  • Loading branch information...
0 parents commit 376574a180e91832e989ee24014120a696bb647c @derickbailey committed Jul 24, 2011
5 .rvmrc
@@ -0,0 +1,5 @@
+if [[ -n "$rvm_path/environments" && -s "$rvm_path/environments/ruby-1.9.2-p180@bb.mb" ]] ; then
+ \. "$rvm_path/environments/ruby-1.9.2-p180@bb.mb"
+else
+ rvm --create "ruby-1.9.2-p180@bb.mb"
+fi
7 Gemfile
@@ -0,0 +1,7 @@
+source :rubygems
+
+group :development do
+ gem 'jasmine', '~>1.0'
+ gem 'jeweler', '~>1.6'
+end
+
41 Gemfile.lock
@@ -0,0 +1,41 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ childprocess (0.2.0)
+ ffi (~> 1.0.6)
+ diff-lcs (1.1.2)
+ ffi (1.0.9)
+ git (1.2.5)
+ jasmine (1.0.2.1)
+ json_pure (>= 1.4.3)
+ rack (>= 1.1)
+ rspec (>= 1.3.1)
+ selenium-webdriver (>= 0.1.3)
+ jeweler (1.6.4)
+ bundler (~> 1.0)
+ git (>= 1.2.5)
+ rake
+ json_pure (1.5.3)
+ rack (1.3.1)
+ rake (0.9.2)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+ rubyzip (0.9.4)
+ selenium-webdriver (2.1.0)
+ childprocess (>= 0.1.9)
+ ffi (>= 1.0.7)
+ json_pure
+ rubyzip
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jasmine (~> 1.0)
+ jeweler
9 Rakefile
@@ -0,0 +1,9 @@
+
+begin
+ require 'jasmine'
+ load 'jasmine/tasks/jasmine.rake'
+rescue LoadError
+ task :jasmine do
+ abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
+ end
+end
0 lib/backbone.modelbinding.js
No changes.
25 readme.md
@@ -0,0 +1,25 @@
+# Backbone.ModelBinding
+
+Awesome model binding for Backbone.js
+
+## Legal Mumbo Jumbo (MIT License)
+
+Copyright (c) 2011 Derick Bailey
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
0 spec/javascripts/Backbone.ModelBinding.Spec.js
No changes.
9 spec/javascripts/helpers/SpecHelper.js
@@ -0,0 +1,9 @@
+beforeEach(function() {
+ this.addMatchers({
+ toBePlaying: function(expectedSong) {
+ var player = this.actual;
+ return player.currentlyPlayingSong === expectedSong
+ && player.isPlaying;
+ }
+ })
+});
73 spec/javascripts/support/jasmine.yml
@@ -0,0 +1,73 @@
+# src_files
+#
+# Return an array of filepaths relative to src_dir to include before jasmine specs.
+# Default: []
+#
+# EXAMPLE:
+#
+# src_files:
+# - lib/source1.js
+# - lib/source2.js
+# - dist/**/*.js
+#
+src_files:
+ - public/javascripts/**/*.js
+
+# stylesheets
+#
+# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
+# Default: []
+#
+# EXAMPLE:
+#
+# stylesheets:
+# - css/style.css
+# - stylesheets/*.css
+#
+stylesheets:
+
+# helpers
+#
+# Return an array of filepaths relative to spec_dir to include before jasmine specs.
+# Default: ["helpers/**/*.js"]
+#
+# EXAMPLE:
+#
+# helpers:
+# - helpers/**/*.js
+#
+helpers:
+
+# spec_files
+#
+# Return an array of filepaths relative to spec_dir to include.
+# Default: ["**/*[sS]pec.js"]
+#
+# EXAMPLE:
+#
+# spec_files:
+# - **/*[sS]pec.js
+#
+spec_files:
+
+# src_dir
+#
+# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
+# Default: project root
+#
+# EXAMPLE:
+#
+# src_dir: public
+#
+src_dir:
+
+# spec_dir
+#
+# Spec directory path. Your spec_files must be returned relative to this path.
+# Default: spec/javascripts
+#
+# EXAMPLE:
+#
+# spec_dir: spec/javascripts
+#
+spec_dir:
23 spec/javascripts/support/jasmine_config.rb
@@ -0,0 +1,23 @@
+module Jasmine
+ class Config
+
+ # Add your overrides or custom config code here
+
+ end
+end
+
+
+# Note - this is necessary for rspec2, which has removed the backtrace
+module Jasmine
+ class SpecBuilder
+ def declare_spec(parent, spec)
+ me = self
+ example_name = spec["name"]
+ @spec_ids << spec["id"]
+ backtrace = @example_locations[parent.description + " " + example_name]
+ parent.it example_name, {} do
+ me.report_spec(spec["id"])
+ end
+ end
+ end
+end
32 spec/javascripts/support/jasmine_runner.rb
@@ -0,0 +1,32 @@
+$:.unshift(ENV['JASMINE_GEM_PATH']) if ENV['JASMINE_GEM_PATH'] # for gem testing purposes
+
+require 'rubygems'
+require 'jasmine'
+jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config.rb'))
+require jasmine_config_overrides if File.exist?(jasmine_config_overrides)
+if Jasmine::rspec2?
+ require 'rspec'
+else
+ require 'spec'
+end
+
+jasmine_config = Jasmine::Config.new
+spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
+
+should_stop = false
+
+if Jasmine::rspec2?
+ RSpec.configuration.after(:suite) do
+ spec_builder.stop if should_stop
+ end
+else
+ Spec::Runner.configure do |config|
+ config.after(:suite) do
+ spec_builder.stop if should_stop
+ end
+ end
+end
+
+spec_builder.start
+should_stop = true
+spec_builder.declare_suites

0 comments on commit 376574a

Please sign in to comment.