Permalink
Browse files

comitting files before some automated conversions

  • Loading branch information...
1 parent 69ecaa8 commit 84073e73b79499c2315a0e1c0ad0d4d8735731cd @collin committed Apr 29, 2012
View
@@ -15,5 +15,5 @@ input "lib" do
concat "AlphaSimprini-spade.js"
end
-
end
+
View
@@ -1,4 +1,4 @@
-abort "Use Ruby 1.9 to build AlphaSimprini" unless RUBY_VERSION["1.9"]
+abort "Use Ruby 1.9 to build Pathology" unless RUBY_VERSION["1.9"]
require 'rake-pipeline'
@@ -27,18 +27,9 @@ task :coffeescript => :clean do
puts "Done"
end
-desc "Build AlphaSimprini with documentation"
-task :doc_build => [:strip_whitespace] do
- puts "Building AlphaSimprini Docs..."
- doc_build.clean
- doc_build.invoke
- puts "Done"
-end
-
-
-desc "Build AlphaSimprini"
+desc "Build Pathology"
task :dist => [:coffeescript, :strip_whitespace] do
- puts "Building AlphaSimprini..."
+ puts "Building Pathology..."
build.invoke
puts "Done"
end
@@ -1,96 +0,0 @@
-AS = require("alpha_simprini")
-_ = require("underscore")
-
-AS.Model.HasOne = AS.Model.Field.extend ({delegate, include, def, defs}) ->
- def couldBe: (test) ->
- return true if test in @options.model?().ancestors
- @_super.apply(this, arguments)
- # @::couldBe.doc =
- # params: [
- # ["test", undefined, true]
- # ]
- # desc: """
- #
- # """
-
-AS.Model.HasOne.Instance = AS.Model.Field.Instance.extend ({def}) ->
- def initialize: (@object, @options) ->
- @options.model ?= -> AS.Model
- @model = @options.model
- @namespace = ".#{_.uniqueId()}"
- @_super.apply(this, arguments)
- @bind "destroy", => @set(null)
- # @::initialize.doc =
- # params: [
- # ["@object", AS.Model, true]
- # ["@options", Object, true]
- # ]
- # desc: """
- #
- # """
-
- def get: ->
- @value
- # @::get.doc =
- # return: [AS.Model, null]
- # desc: """
- #
- # """
-
- def set: (value) ->
- value = value.model if value?.model
- return @value if value is @value
-
- if _.isString(value) and (konstructor = @model()) isnt AS.Model
- value = konstructor.find(value)
- else if _.isString(value)
- value = AS.All.byId[value]
- else if value instanceof AS.Model
- value = value
- else if _.isObject(value)
- value = @options.model().new(value)
-
- @value?.unbind(@namespace)
-
- # TODO: test inverse
-
- if @value and @options.inverse and @value[@options.inverse]
- @value[@options.inverse].remove(@object) if @value[@options.inverse].include(@object).value()
-
- @value = value
-
- if @value and @options.inverse and @value[@options.inverse]
- @value[@options.inverse].add(@object) unless @value[@options.inverse].include(@object).value()
-
- # this looks neccessory for path bindings, but not so good for view bindings yeesh
- # @value?.bind "all#{@namespace}", _.bind(@trigger, this)
-
- @object.trigger("change")
- @object.trigger("change:#{@options.name}")
- @trigger("change")
- @triggerDependants()
- @value
- # @::set.doc =
- # params: [
- # ["value", AS.Model]
- # ]
- # desc: """
- #
- # """
-
- @Synapse = AS.Model.Field.Instance.Synapse.extend ({delegate, include, def, defs}) ->
- def get: ->
- @raw.get()
-
- def set: (value) ->
- @raw.set(value)
-
- @ShareSynapse = AS.Model.Field.Instance.ShareSynapse.extend ({delegate, include, def, defs}) ->
- def get: ->
- @raw.at(@path).get()
-
- def set: (value) ->
- @_super(value?.id) if value?.id
-
-AS.Model.defs hasOne: (name, options) ->
- AS.Model.HasOne.new(name, this, options)
View
@@ -1,45 +1,38 @@
-{AS, _, sinon, coreSetUp} = require require("path").resolve("./test/helper")
-exports.setUp = coreSetUp
-
-exports.utilities =
- testIdentity: (test) ->
- test.ok AS.Identity(10)(10)
- test.done()
-
- constructorIdentity: (test) ->
- class Fake
- test.ok AS.ConstructorIdentity(Fake)(new Fake)
- test.done()
-
- deepClone: (test) ->
- test.notEqual AS.deepClone(it = []), it
- test.notEqual AS.deepClone(it = {}), it
-
- test.deepEqual AS.deepClone(it = []), it
- test.deepEqual AS.deepClone(it = {}), it
-
- it = [
- {a: 134, 3: [2, {}, [], [], "FOO"]},
- 23
- "BAR"
- ]
- test.deepEqual AS.deepClone(it), it
- not_it = AS.deepClone(it)
- not_it.push "BAZ"
- test.notDeepEqual it, not_it
-
- test.done()
-
- uniq: (test) ->
- test.ok AS.uniq().match /^.*-.*-.*$/
- test.notEqual AS.uniq(), AS.uniq()
- test.done()
-
- humanSize: (test) ->
- sz = AS.humanSize
-
- test.equal sz(100), "100.0 B"
-
- for prefix, index in ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
- test.equal sz(Math.pow(1024, index + 1)), "1.0 #{prefix}"
- test.done()
+# {AS, _, sinon, coreSetUp} = require require("path").resolve("./test/helper")
+# exports.setUp = coreSetUp
+
+module "utilities"
+test "testIdentity", ->
+ ok AS.Identity(10)(10)
+
+test "constructorIdentity", ->
+ class Fake
+ ok AS.ConstructorIdentity(Fake)(new Fake)
+
+test "deepClone", ->
+ notEqual AS.deepClone(it = []), it
+ notEqual AS.deepClone(it = {}), it
+
+ deepEqual AS.deepClone(it = []), it
+ deepEqual AS.deepClone(it = {}), it
+
+ it = [
+ {a: 134, 3: [2, {}, [], [], "FOO"]},
+ 23, "BAR"
+ ]
+ deepEqual AS.deepClone(it), it
+ not_it = AS.deepClone(it)
+ not_it.push "BAZ"
+ notDeepEqual it, not_it
+
+test "uniq", ->
+ ok AS.uniq().match /^.*-.*-.*$/
+ notEqual AS.uniq(), AS.uniq()
+
+test "humanSize", ->
+ sz = AS.humanSize
+
+ equal sz(100), "100.0 B"
+
+ for prefix, index in ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
+ equal sz(Math.pow(1024, index + 1)), "1.0 #{prefix}"
View
@@ -1,28 +1,25 @@
-{AS, _, sinon, coreSetUp} = require require("path").resolve("./test/helper")
+{AS, _, sinon, coreSetUp} = require require("path").resolve("./helper")
exports.setUp = coreSetUp
WithCallbacks = AS.Object.extend ({include}) ->
include AS.Callbacks
@defineCallbacks
before: "this that".split(" ")
-exports.Callbacks =
- definition: (test) ->
- it = WithCallbacks
- test.ok WithCallbacks.beforeThis
- test.ok WithCallbacks.beforeThat
- test.done()
+module "Callbacks"
+test "definition", ->
+ it = WithCallbacks
+ ok WithCallbacks.beforeThis
+ ok WithCallbacks.beforeThat
- running: (test) ->
- test.expect(2)
+test "running", ->
+ expect(2)
- it = WithCallbacks
- cb = -> test.ok(true)
- it.beforeThis cb
- it.beforeThat cb
+ it = WithCallbacks
+ cb = -> ok(true)
+ it.beforeThis cb
+ it.beforeThat cb
- one = WithCallbacks.new()
- one.runCallbacks "beforeThis"
- one.runCallbacks "beforeThat"
-
- test.done()
+ one = WithCallbacks.new()
+ one.runCallbacks "beforeThis"
+ one.runCallbacks "beforeThat"
Oops, something went wrong.

0 comments on commit 84073e7

Please sign in to comment.