Permalink
Browse files

Initial import of data store library

  • Loading branch information...
0 parents commit 82d7467489e0bb6ad588a3ae4491e67bc7da127f Tom Dale committed Dec 17, 2011
@@ -0,0 +1,3 @@
+bin/
+.bundle
+tmp/
@@ -0,0 +1,54 @@
+LICENSE = File.read("generators/license.js")
+
+class RegisterWrapper < Filter
+ def generate_output(inputs, output)
+ inputs.each do |input|
+ id = input.path.sub('/lib/','/').sub(/\.js$/, '')
+ code = "\nminispade.register('#{id}', function(exports) {\n#{input.read}\n});\n"
+ output.write code
+ end
+ end
+end
+
+class RequireRewrite < Filter
+ def generate_output(inputs, output)
+ inputs.each do |input|
+ result = input.read
+ result.gsub!(%r{^\s*require\(['"]([^'"]*)['"]\);?\s*}) do |s|
+ module_id = $1
+ module_id.sub!(/^\./, File.dirname(input.path))
+ module_id << '/main' if module_id !~ /\//
+ module_id.sub!('~tests','tests')
+ "minispade.require('#{module_id}');"
+ end
+ output.write result
+ end
+ end
+end
+
+input "packages"
+output "tests/source"
+
+match "*/{lib,tests}/**/*.js" do
+ filter RegisterWrapper
+ filter RequireRewrite
+ filter ConcatFilter do |filename|
+ filename =~ %r{/tests/} ? "ember-tests.js" : "ember.js"
+ end
+end
+
+# Hack to ignore certain files
+
+match "**/*.{json,md}" do
+ filter ConcatFilter, "trash"
+end
+
+match "**/README" do
+ filter ConcatFilter, "trash"
+end
+
+match "*/*.js" do
+ filter ConcatFilter, "trash"
+end
+
+# vim: filetype=ruby
@@ -0,0 +1,7 @@
+source "http://rubygems.org"
+
+gem "sproutcore", :git => "https://github.com/wycats/abbot-from-scratch.git"
+gem "uglifier", "~> 1.0.3"
+gem "execjs", "~> 1.2.6"
+gem "rack"
+gem "rake-pipeline", :git => "https://github.com/livingsocial/rake-pipeline.git"
@@ -0,0 +1,34 @@
+GIT
+ remote: https://github.com/livingsocial/rake-pipeline.git
+ revision: 7f0b86214c97efec64907f8d83933b3d82667d5b
+ specs:
+ rake-pipeline (0.5.0)
+ rake (~> 0.9.0)
+
+GIT
+ remote: https://github.com/wycats/abbot-from-scratch.git
+ revision: 29dfaa6c3c120847e61f742f74c414e4872cc142
+ specs:
+ sproutcore (0.0.1)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ execjs (1.2.12)
+ multi_json (~> 1.0)
+ multi_json (1.0.4)
+ rack (1.3.5)
+ rake (0.9.2.2)
+ uglifier (1.0.4)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ execjs (~> 1.2.6)
+ rack
+ rake-pipeline!
+ sproutcore!
+ uglifier (~> 1.0.3)
@@ -0,0 +1,12 @@
+# Data Store
+
+A library for loading and managing records from a persistence layer into
+the browser.
+
+## Unit Tests
+
+To run unit tests, run `rackup` from the root directory and visit
+`http://localhost:9292/tests/index.html?package=ember-data`.
+
+(Note that you will need to enable extendprototype by checking the
+checkbox for the time being.)
Oops, something went wrong. Retry.

0 comments on commit 82d7467

Please sign in to comment.