Skip to content

Commit

Permalink
Converted to defineProperty for properties and relationships.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther committed Aug 19, 2013
1 parent dc1003f commit b61ce45
Show file tree
Hide file tree
Showing 13 changed files with 288 additions and 457 deletions.
25 changes: 17 additions & 8 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,23 @@ module.exports = (grunt) ->
options:
urls: ["http://localhost:8000/test/qunit/min/qunit.html"]

# watch:
# lib:
# files: "<%= jshint.lib.src %>"
# tasks: ["jshint:lib", "nodeunit"]

# test:
# files: "<%= jshint.test.src %>"
# tasks: ["jshint:test", "nodeunit"]
watch:
app:
files: [
"src/EventDispatcher.coffee"
"src/Runtime.coffee"
"src/Transaction.coffee"
"src/min/request.coffee"
]
tasks: ["default"]

tests:
files: [
"test/nunit/*coffee"
"test/spec/node/coffee/*coffee"
"test/qunit/min/coffee/*coffee"
]
tasks: ["test"]


# These plugins provide necessary tasks.
Expand Down
10 changes: 5 additions & 5 deletions context.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"methods": {
"export": {
"definitions": {
"javascript": "var context = {attributes: {}, entities: {}};\nthis.entities().forEach(function(entity){\n\tcontext.entities[entity.name()] = entity.export();\n});\nreturn JSON.stringify(context);"
"javascript": "var context = {attributes: {}, entities: {}};\nthis.entities().forEach(function(entity){\n\tcontext.entities[entity.name] = entity.export();\n});\nreturn JSON.stringify(context);"
}
}
}
Expand Down Expand Up @@ -77,7 +77,7 @@
"methods": {
"export": {
"definitions": {
"javascript": "var entity = {key: this.key(), properties: {}, relationships: {}};\nthis.properties().forEach(function(property){\n\tentity.properties[property.name()] = property.export();\n});\nthis.relationships().forEach(function(relationship){\n\tentity.relationships[relationship.name()] = relationship.export();\n});\nreturn entity;"
"javascript": "var entity = {key: this.key, properties: {}, relationships: {}};\nthis.properties().forEach(function(property){\n\tentity.properties[property.name] = property.export();\n});\nthis.relationships().forEach(function(relationship){\n\tentity.relationships[relationship.name] = relationship.export();\n});\nreturn entity;"
}
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@
"methods": {
"export": {
"definitions": {
"javascript": "var property = {type: this.type()};\nreturn property;"
"javascript": "var property = {type: this.type};\nreturn property;"
}
}
}
Expand Down Expand Up @@ -167,12 +167,12 @@
"methods": {
"normalize": {
"definitions": {
"javascript": "var this$=this;\nthis._runtime.get_first({'_type': 'Entity', 'entity_id': this.to_id()}).then(\n\tfunction(found){\n\t\tthis$.to(found);\n\t}\n);"
"javascript": "var this$=this;\nthis._runtime.get_first({'_type': 'Entity', 'entity_id': this.to_id}).then(\n\tfunction(found){\n\t\tthis$.to(found);\n\t}\n);"
}
},
"export": {
"definitions": {
"javascript": "var relationship = {type: this.type(), property: this.from_property(), to: {type: this.to().name(), property: this.to_property()}, back: this.back()};\nreturn relationship;"
"javascript": "var relationship = {type: this.type, property: this.from_property, to: {type: this.to().name, property: this.to_property}, back: this.back};\nreturn relationship;"
}
}
}
Expand Down
Loading

0 comments on commit b61ce45

Please sign in to comment.