Permalink
Browse files

Update ember-data to most recent test harness

  • Loading branch information...
1 parent 2b6666e commit a73b3cf3b235f7e5f6aed12ebec9e88b4eeaf6e3 tomhuda committed Feb 15, 2012
Showing with 57 additions and 33 deletions.
  1. +25 −23 Assetfile
  2. +6 −6 Gemfile.lock
  3. +26 −4 tests/minispade.js
View
@@ -1,34 +1,36 @@
require "rake-pipeline-web-filters"
+require "json"
-input "packages"
output "tests/source"
-match "*/{lib,tests}/**/*.js" do
- minispade :rewrite_requires => true, :module_id_generator => proc { |input|
- id = input.path.dup
- id.sub!('/lib/', '/')
- id.sub!(/\.js$/, '')
- id.sub!(/\/main$/, '')
- id.sub!('/tests', '/~tests')
- id
- }
-
- concat do |filename|
- filename =~ %r{/tests/} ? "ember-tests.js" : "ember.js"
+input "packages" do
+ match "*/{lib,tests}/**/*.js" do
+ minispade :rewrite_requires => true, :string => true, :module_id_generator => proc { |input|
+ id = input.path.dup
+ id.sub!('/lib/', '/')
+ id.sub!(/\.js$/, '')
+ id.sub!(/\/main$/, '')
+ id.sub!('/tests', '/~tests')
+ id
+ }
+
+ concat do |filename|
+ filename =~ %r{/tests/} ? "ember-tests.js" : "ember.js"
+ end
end
-end
-# Hack to ignore certain files
-match "**/*.{json,md}" do
- concat "trash"
-end
+ # Hack to ignore certain files
+ match "**/*.{json,md}" do
+ concat "trash"
+ end
-match "**/README" do
- concat "trash"
-end
+ match "**/README" do
+ concat "trash"
+ end
-match "*/*.js" do
- concat "trash"
+ match "*/*.js" do
+ concat "trash"
+ end
end
View
@@ -1,8 +1,8 @@
GIT
remote: https://github.com/livingsocial/rake-pipeline.git
- revision: 56bbc5d9cf7ce1b69d29d3d6af7282603dcdebba
+ revision: f71caeb1406dafd6af5ab8453db8c5ac53947c92
specs:
- rake-pipeline (0.5.0)
+ rake-pipeline (0.6.0)
rake (~> 0.9.0)
thor
@@ -14,11 +14,11 @@ GIT
GIT
remote: https://github.com/wycats/rake-pipeline-web-filters.git
- revision: e7273a0c5df7181c9cc0bca31cb3dec7fa39fcc8
+ revision: fe752a8cfdbb318b746fd76fd3c10dd8b8f29891
specs:
- rake-pipeline-web-filters (0.5.0)
+ rake-pipeline-web-filters (0.6.0)
rack
- rake-pipeline
+ rake-pipeline (~> 0.6)
GEM
remote: http://rubygems.org/
@@ -41,7 +41,7 @@ GEM
json
nokogiri (>= 1.4.0)
nokogiri (1.5.0)
- rack (1.4.0)
+ rack (1.4.1)
rake (0.9.2.2)
thor (0.14.6)
uglifier (1.0.4)
View
@@ -1,21 +1,43 @@
-// This is based on minispade but is modified
-
if (typeof document !== "undefined") {
(function() {
minispade = {
+ root: null,
modules: {},
loaded: {},
+ globalEval: function(data) {
+ if ( data ) {
+ var ev = "ev";
+ var execScript = "execScript";
+
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window[execScript] || function( data ) {
+ window[ ev+"al" ].call( window, data );
+ } )( data );
+ }
+ },
+
require: function(name) {
var loaded = minispade.loaded[name];
var mod = minispade.modules[name];
if (!loaded) {
if (mod) {
minispade.loaded[name] = true;
- mod();
+
+ if (typeof mod === "string") {
+ this.globalEval(mod);
+ } else {
+ mod();
+ }
} else {
- throw "The module '" + name + "' could not be found";
+ if (minispade.root && name.substr(0,minispade.root.length) !== minispade.root) {
+ return minispade.require(minispade.root+name);
+ } else {
+ throw "The module '" + name + "' could not be found";
+ }
}
}

0 comments on commit a73b3cf

Please sign in to comment.