Skip to content

Commit

Permalink
Update ember-data to most recent test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhuda committed Feb 16, 2012
1 parent 2b6666e commit a73b3cf
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 33 deletions.
48 changes: 25 additions & 23 deletions Assetfile
@@ -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


Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
@@ -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

Expand All @@ -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/
Expand All @@ -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)
Expand Down
30 changes: 26 additions & 4 deletions tests/minispade.js
@@ -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";
}
}
}

Expand Down

0 comments on commit a73b3cf

Please sign in to comment.