Skip to content

Instantly share code, notes, and snippets.

@jareiko
jareiko / codeship-meteor-script.md
Last active March 6, 2016 00:03
Deploying to Meteor with Codeship.io

Deploying to Meteor with Codeship.io

Project structure

You'll need to use a subdirectory within your git repo for the Meteor project. This allows you to clone Meteor into your repo without it trying to deploy itself. If you find a better way, please let me know.

Provide the name of the subdirectory to the deploy script with the SUBDIRECTORY environment variable.

var ReactiveValue = function(value) {
var dep = new Deps.Dependency();
this.get = function() {
dep.depend();
return value;
}
this.set = function(newValue) {
if (value === newValue) return;
value = newValue;
dep.changed();
var ReactiveValue = function(value) {
var dep = new Deps.Dependency();
var state = value;
this.get = function() {
dep.depend();
return state;
}
this.set = function(newValue) {
if (state === newValue) return;
state = newValue;
Process: Grandroids [11089]
Path: /Users/USER/Downloads/*/GrandroidsMac.app/Contents/MacOS/Grandroids
Identifier: unity.Steve Grand.Grandroids
Version: Unity Player version 4.3.4f1 (4.3.4f1)
Code Type: X86-64 (Native)
Parent Process: launchd [253]
Responsible: Grandroids [11089]
User ID: 501
Date/Time: 2014-04-25 14:17:17.574 +0200
# This code...
app.track.config.on 'change', -> updateView()
# ...becomes this:
app.on 'change:track.config', -> updateView()
app.track.on 'change:config', ->
app.track.config.on 'change', -> updateView()
app.track.on 'change:config', ->
app.track.config.on 'change', -> updateView()
app.track.config.on 'change', -> updateView()
class Model extends Backbone.Model
initialize: ->
super
monitor = createAttributeMonitor()
# Bind to initial attributes.
monitor @, name for name of @attributes
# Watch for changes to attributes and rebind as necessary.
@on 'change', =>
createAttributeMonitor = ->
monitored = Object.create null
(parentModel, name) ->
bubbleEvent = (event, args...) ->
return unless event.startsWith 'change:'
parentModel.trigger "change:#{name}.#{event[7..]}", args...
value = parentModel.get name
oldValue = monitored[name]