Learnsets: Simplify a test.

Learnsets: Simplify a test.

--- shared/learnsets.coffee
+++ shared/learnsets.coffee
@@ -71,6 +71,8 @@
       theFormes.push((forme  for forme of FormeData[name])...)
     name = SpeciesData[name].evolvedFrom

+  # The Pokemon may not have a default ability (due to tests, etc)
+  ability ?= finalForme.abilities[0]
   hasHiddenAbility = (ability == finalForme.hiddenAbility &&
                       ability not in finalForme.abilities)

@@ -93,11 +95,9 @@
         # Skip if this Pokemon has no learnset for this generation.
         continue  if !learnset

-        # Skip if this Pokemon's ability is hidden and the forme in this
-        # generation does not support that ability. Hidden abilities are only
-        # obtainable within one generation.
-        if hasHiddenAbility && finalForme.hiddenAbility != forme.hiddenAbility
-          continue
+        # Skip if this Pokemon's ability is hidden and this generation has no
+        # hidden abilities for this forme.
+        continue  if hasHiddenAbility && !forme.hiddenAbility?
         return true  if iterator(learnset, name, formeName, generation) == true
   return false


More concise coffee.

More concise coffee.

--- js/binding/src/binding.coffee
+++ js/binding/src/binding.coffee
@@ -4,40 +4,35 @@
 # For all details and documentation:
 # http://jefri.org

-((($) ->
+do ($ = jQuery) ->
 	$.fn.merge = (doms) ->
 		doms.filter("[id]").each (i, dom) =>
 			dom = $(dom)
 			id = dom.attr("id")
 			child = this.children("#" + id)
 			if child.length is 0
-				this.append(dom)
+				@append(dom)
 			else
 				child.merge(dom.children())
-			null
 		rest = doms.filter(":not([id])")
 		#[id]s handled, replace kids
 		if rest.length
-			this.children(":not([id])").remove()
-			this.append(rest)
-		this
-).call(this, jQuery))
+			@children(":not([id])").remove()
+			@append(rest)
+		@

-(((_, $, JEFRi)->
+do (_=_, $ = jQuery || null, JEFRi = JEFRi) ->
 	# Need to make some different assumptions about Templating
-	_.templateSettings = {
+	_.templateSettings =
 		escape: /{{-([\s\S]+?)}}/g,
 		evaluate: /{{([\s\S]+?)}}/g,
 		interpolate: /{{=([\s\S]+?)}}/g
-	}

 	# Global Binding settings.
-	settings = {
-		paths : {
+	settings =
+		paths:
 			root: "JEFRi"
 			theme: '_default_theme'
-		}
-	}

 	# Detached DOM node to hold templates.
 	template = $()
@@ -56,13 +51,12 @@
 		templates = if _.isArray(templates) then templates else Array.prototype.slice.call(arguments)
 		# Load each template
 		templates[i] = _.get(T) for T, i in templates
-		_.when.apply(null, templates).done(() ->
+		_.when.apply(null, templates).done () ->
 			# When behaves differently if there are 1 or 2+ args.
 			args = if templates.length is 1 then [arguments] else arguments
 			mergeTemplate(if _.isArray(tmpl) then tmpl[0] else tmpl) for tmpl in args
 			d.resolve()
-			null
-		)
+
 		d.promise()

 	# Finders to coalesce different templates into a single hierarchical system
@@ -77,7 +71,7 @@
 			when 4 then find.property(root, theme, entity, property)
 			when 5 then find.view(root, theme, entity, property, view)

-	_.extend(find, {
+	_.extend find,
 		root: (root = settings.paths.root) ->
 			_root = template.children("#" + root)
 			if _root.length isnt 1
@@ -115,7 +109,6 @@
 			if _view.length isnt 1
 				_view = _property.find("#view");
 			_view.clone()
-	})

 	# The renderer returns the built and bound DOM for a JEFRi renderable thing.
 	render = (thing) ->
@@ -124,7 +117,7 @@
 		else
 			render.page(thing)

-	_.extend(render, {
+	_.extend render,
 		page: (page) ->
 			find(".._page")

@@ -154,9 +147,8 @@
 				return rel
 			else
 				return render.entity(entity[rel_name]())
-	})

-	(()->
+	do () ->
 		key = {}

 		lock = (entity) ->
@@ -166,6 +158,7 @@

 		unlock = (entity) ->
 			delete key[entity.id(true)]
+			return

 		r_e = render.entity
 		render.entity = (entity, view = "view") ->
@@ -174,22 +167,16 @@
 				e = r_e(entity, view)
 				unlock(entity)
 			return e
-	)()

 	init = (options) ->
 		_clear()
 		_.extend(true, settings, options)
 		loadTemplates(settings.templates).promise()

-	JEFRi.Binding = {
+	JEFRi.Binding =
 		init: init
 		templates: () -> template
 		loadTemplates: loadTemplates
 		settings: settings
 		find: find
-		render: render
-	}
-
-	return
-
-).call(this, _, jQuery || null, JEFRi))
+		render: render


Test various error states when data isn't found

--- test/components/buttons/browse-the-book.spec.coffee
+++ test/components/buttons/browse-the-book.spec.coffee
@@ -40,3 +40,18 @@
       expect(Testing.router.makeHref).to.have.been.calledWith(
         'viewReferenceBookPage', { bookId: COURSE.book_id, cnxId: @props.page, section: [1.2] }
       )
+
+  it 'reads the courseId from router', ->
+    @props.courseId = null
+    Testing.renderComponent( BTB, props: @props, routerParams: {courseId: COURSE_ID}).then ({dom}) ->
+      expect(dom).not.to.be.null
+
+  it 'does not render when the course is not found in the store', ->
+    CourseActions.reset()
+    Testing.renderComponent( BTB, props: @props ).then ({dom}) ->
+      expect(dom).to.be.null
+
+  it 'does not render when the courseid is completly missing', ->
+    @props.courseId = null
+    Testing.renderComponent( BTB, props: @props, routerParams: {courseId: undefined}).then ({dom}) ->
+      expect(dom).to.be.null


Tests: add require statement for underscore

--- test/components/list/listviewcontroller.test.coffee
+++ test/components/list/listviewcontroller.test.coffee
@@ -4,6 +4,7 @@
 KDListView           = require '../../../src/components/list/listview.coffee'
 KDListItemView       = require '../../../src/components/list/listitemview.coffee'
 KDView               = require '../../../src/core/view.coffee'
+_                    = require '../../../libs/underscore-min.1.3.js'

 describe 'KDListViewController', ->


Fix typo

Fix typo

--- src/widgets/queryinput.coffee
+++ src/widgets/queryinput.coffee
@@ -193,7 +193,7 @@
       @previousValue = @value.toUpperCase()
       @controller.forEach (controller) => controller.search @value
     else if not valueOk
-      # Because the value is not ok, the search is not performed, but the previus
+      # Because the value is not ok, the search is not performed, but the previous
       # value must be changed.
       @previousValue = @value.toUpperCase()
     else if @previousValue.length > 0 and @value.length is 0


StacksCustomViews: Convert json to yaml on load and opposite on save

--- client/admin/lib/views/stacks/stackscustomviews.coffee
+++ client/admin/lib/views/stacks/stackscustomviews.coffee
@@ -412,14 +412,21 @@

       kd.singletons.appManager.require 'IDE'

-      {content} = options
-
-      content   = Encoder.htmlDecode content
-      file      = FSHelper.createFileInstance path: 'localfile:/stack.json'
+      {
+        content
+        contentType
+        err
+      } = jsonToYaml Encoder.htmlDecode options.content
+
+      new kd.NotificationView "Parse error on template"  if err
+
+      file = FSHelper.createFileInstance
+        path: "localfile:/stack.#{contentType}"

       editorView = new IDEEditorPane {
         cssClass: 'editor-view'
         file, content, delegate: this
+        contentType
       }

       editorView.setCss background: 'black'
@@ -911,6 +918,9 @@
             {title} = views.input_title.getData()
             templateContent = views.editorView.getValue()

+            if 'yaml' is views.editorView.getOption 'contentType'
+              templateContent = (yamlToJson templateContent).content
+
             updateStackTemplate {
               template: templateContent, templateDetails
               credential, stackTemplate, title


StacksCustomViews: setStack helper for setting stack of group

--- client/admin/lib/views/stacks/stackscustomviews.coffee
+++ client/admin/lib/views/stacks/stackscustomviews.coffee
@@ -11,6 +11,33 @@

 module.exports = class StacksCustomViews extends CustomViews
+
+  setStack = (options, callback) ->
+
+    { stackTemplate } = options
+    { computeController } = kd.singletons
+
+    computeController.getKloud()
+
+      .checkTemplate { stackTemplateId: stackTemplate._id }
+
+      .then (response) ->
+
+        console.log '>>', response
+        # machines = @parseTerraformOutput response
+        # @outputView.updatePartial applyMarkdown "
+        #   ```json\n#{JSON.stringify machines, null, 2}\n```
+        # "
+
+        # @updateStackTemplate {
+        #   template: terraformContext
+        #   stackTemplate, publicKeys, machines
+        # }
+        #
+        callback null, response
+
+      .catch   (err) ->
+        console.log 'Failed >>', err

   fetchAndShowCredentialData = (credential, outputView) ->


pubsub_server: browse /top-followed-nodes & /top-published-nodes does not request a particular node

--- src/xmpp/pubsub_server.coffee
+++ src/xmpp/pubsub_server.coffee
@@ -165,8 +165,12 @@
             @operation = 'browse-nodes'
         else if @node is "/top-followed-nodes"
             @operation = 'browse-top-followed-nodes'
+            # not requesting a particular node:
+            delete @node
         else if @node is "/top-published-nodes"
             @operation = 'browse-top-published-nodes'
+            # not requesting a particular node:
+            delete @node
         else
             @operation = 'browse-node-items'
         @setRSM @discoItemsEl


(PLATFORM-74) Add createdAfter field to loadTree

--- js/src/tree/TreeLoader.coffee
+++ js/src/tree/TreeLoader.coffee
@@ -20,13 +20,14 @@
     constructor: ->
       @objectApi = new ObjectApi()

-    loadTree: (objectIds, typeLoadLevels, loadDepth) ->
+    loadTree: (objectIds, typeLoadLevels, loadDepth, createdAfter) ->
       Promise.resolve()
       .then =>
         @objectApi.getObjectsByTypeAndLoadLevel(
           objectIds,
           typeLoadLevels,
-          loadDepth
+          loadDepth,
+          createdAfter
         )
       .then (objectMetadataTrees) ->
         # objectMetadataTrees == Map<java.util.UUID, com.kryptnostic.v2.storage.models.ObjectMetadataEncryptedNode>


Give the tests more time.

Give the tests more time.

--- test/integration/events.spec.coffee
+++ test/integration/events.spec.coffee
@@ -233,7 +233,7 @@
       # Without this delay the watcher doesn't pick up the deletion sometimes
       _.delay ->
         fs.deleteFileSync './test/fixtures/new.txt'
-      , 1
+      , 10

   describe 'move_self', ->
     beforeEach -> fs.ensureDirSync './test/fixtures'
@@ -367,15 +367,16 @@
         expect(stats).to.have.property 'isDir', yes
         expect(stats).to.have.property 'mtime'

-      watcher.once 'create', (filename, stats) ->
-        expect(filename).to.be.eql path.resolve 'test/fixtures/new2/test.txt'
-        expect(stats).to.have.property 'isDir', no
-        expect(stats).to.have.property 'mtime'
-        watcher.close()
-        done()
-
-      fs.moveDirSync './test/fixtures/new', './test/fixtures/new2'
-      fs.createFileSync './test/fixtures/new2/test.txt', 'hello'
+      files = []
+      watcher.on 'create', (filename, stats) -> files.push filename
+
+      fs.moveDir './test/fixtures/new', './test/fixtures/new2', (err) ->
+        fs.createFile './test/fixtures/new2/test.txt', 'hello', (err) ->
+          _.delay ->
+            expect(files).to.contain path.resolve 'test/fixtures/new2/test.txt'
+            watcher.close()
+            done()
+          , 10

   describe 'close', ->


models module tests

models module tests

--- test/server/models/indexSpec.coffee
+++ test/server/models/indexSpec.coffee
@@ -1,13 +1,95 @@
-should = require 'should'
+assert = require('chai').assert
 expect = require('chai').expect
-mongoose = require 'mongoose'
+sinon = require 'sinon'
+proxyquire = require 'proxyquire'
+path = require 'path'

-models = require './models'
+describe 'Models', ->
+  stubs = null
+  models = null
+  mongooseMock = null
+  crudModelFactoryMock = null
+  filesStub = null
+  environmentsStub = null
+
+  beforeEach (done) ->
+    dir =  path.normalize __dirname + '../../../../server'

-describe 'Models Index', ->
+    filesStub =
+      name: 'File'
+
+    environmentsStub =
+      name: 'Environment'
+
+    stubs =
+      './environments': sinon.stub().returns environmentsStub
+      './files': sinon.stub().returns filesStub
+      './systems': sinon.stub().returns {name: 'System'}
+      './users': sinon.stub().returns {name: 'User'}
+      './roles': sinon.stub().returns {name: 'Role'}
+      './settings': sinon.stub().returns {name: 'Setting'}
+      './categories': sinon.stub().returns {name: 'Category'}
+      './activities': sinon.stub().returns {name: 'Activity'}
+
+    mongooseMock = sinon.spy()
+    crudModelFactoryMock = sinon.spy()
+
+    models = proxyquire(dir + '/models', stubs)(mongooseMock, crudModelFactoryMock)
+
+    done()

   it 'exports activities model', (done) ->
-    should.exist models.activities
-    should.exist models.activities.name
-    models.activities.name.should.equal 'Activity'
+    assert.ok stubs['./activities'].calledOnce
+    assert stubs['./activities'].calledWithExactly(mongooseMock, crudModelFactoryMock), 'activities not initalized'
+    assert.property models, 'activities', 'models does not export activities'
+    expect(models.activities.name).to.equal 'Activity'
+    done()
+
+  it 'exports categories model', (done) ->
+    assert.ok stubs['./categories'].calledOnce
+    assert stubs['./categories'].calledWithExactly(mongooseMock, crudModelFactoryMock, filesStub), 'categories not initalized'
+    assert.property models, 'categories', 'models does not export categories'
+    expect(models.categories.name).to.equal 'Category'
+    done()
+
+  it 'exports systems model', (done) ->
+    assert.ok stubs['./systems'].calledOnce
+    assert stubs['./systems'].calledWithExactly(mongooseMock, crudModelFactoryMock), 'systems not initalized'
+    assert.property models, 'systems', 'models does not export systems'
+    expect(models.systems.name).to.equal 'System'
+    done()
+
+  it 'exports environments model', (done) ->
+    assert.ok stubs['./environments'].calledOnce
+    assert stubs['./environments'].calledWithExactly(mongooseMock, crudModelFactoryMock), 'environments not initalized'
+    assert.property models, 'environments', 'models does not export environments'
+    expect(models.environments.name).to.equal 'Environment'
+    done()
+
+  it 'exports files model', (done) ->
+    assert.ok stubs['./files'].calledOnce
+    assert stubs['./files'].calledWithExactly(mongooseMock, crudModelFactoryMock), 'files not initalized'
+    assert.property models, 'files', 'models does not export files'
+    expect(models.files.name).to.equal 'File'
+    done()
+
+  it 'exports users model', (done) ->
+    assert.ok stubs['./users'].calledOnce
+    assert stubs['./users'].calledWithExactly(mongooseMock, crudModelFactoryMock), 'users not initalized'
+    assert.property models, 'users', 'models does not export users'
+    expect(models.users.name).to.equal 'User'
+    done()
+
+  it 'exports roles model', (done) ->
+    assert.ok stubs['./roles'].calledOnce
+    assert stubs['./roles'].calledWithExactly(mongooseMock, crudModelFactoryMock), 'roles not initalized'
+    assert.property models, 'roles', 'models does not export roles'
+    expect(models.roles.name).to.equal 'Role'
+    done()
+
+  it 'exports settings model', (done) ->
+    assert.ok stubs['./settings'].calledOnce
+    assert stubs['./settings'].calledWithExactly(mongooseMock, crudModelFactoryMock, environmentsStub), 'settings not initalized'
+    assert.property models, 'roles', 'models does not export settings'
+    expect(models.settings.name).to.equal 'Setting'
     done()


Bump the Users test timeout

Bump the Users test timeout

Slow...

--- test/server/routes/api/users.coffee
+++ test/server/routes/api/users.coffee
@@ -10,6 +10,7 @@
 {expect} = require 'chai'

 describe 'REST#Users', ->
+  @timeout 3000

   apiSegment = config.get('apiSegment')
   before reset.db
@@ -292,7 +293,7 @@
         .send 'Invalid JSON payload'
         .expect 404
         .end done
-
+
     it 'returns a 403 if body contains Mongo injection-style $ object key', (done) ->
       badObject = {'$gt': ''}
       r = request app


add 36-5 SP maproute, wow

add 36-5 SP maproute, wow


This one should definitely be series not parallel o_0

--- client/landing/app/MainApp/kodingappscontroller.coffee
+++ client/landing/app/MainApp/kodingappscontroller.coffee
@@ -458,7 +458,7 @@
     stack.push (cb)=> manifestFile.save  manifestStr,  cb
     stack.push (cb)=> changeLogFile.save changeLogStr, cb

-    async.parallel stack, (err, result) =>
+    async.series stack, (err, result) =>
       warn err  if err
       @emit "aNewAppCreated"  unless err
       callback? err, result


apps-controller: Fixed fetching update required apps.

--- client/landing/app/MainApp/kodingappscontroller.coffee
+++ client/landing/app/MainApp/kodingappscontroller.coffee
@@ -185,18 +185,16 @@
   getPublishedApps: (callback) ->
     return unless KD.isLoggedIn()
     @fetchApps (err, apps) =>
-      query = []
-      for appName, manifest of apps
-        query.push { name: "JApp", identifier: manifest.identifier }
-
-      KD.remote.cacheable query, (err, apps) =>
+      appNames = []
+      appNames.push appName for appName, manifest of apps
+
+      query = "manifest.name": "$in": appNames
+      KD.remote.api.JApp.someWithRelationship query, {}, (err, apps) =>
         @publishedApps = map = {}
         apps.forEach (app) =>
-          log app, apps, app.manifest.name
           map[app.manifest.name] = app
         @emit "UserAppModelsFetched", map
         callback? map
-        log map

   isAppUpdateAvailable: (appName, appVersion) ->
     if @publishedApps[appName]


Check if related function is there

Check if related function is there

--- client/landing/app/MainApp/maintabs/maintabview.coffee
+++ client/landing/app/MainApp/maintabs/maintabview.coffee
@@ -80,7 +80,7 @@
     # kodingrouter

     index        = @getPaneIndex pane
-    visibles     = @getVisibleTabs()
+    visibles     = @getVisibleTabs?()
     visibleIndex = visibles.indexOf pane
     leftPane     = visibles[visibleIndex - 1]
     rightPane    = visibles[visibleIndex + 1]


Shows and hides overlay for queued

Shows and hides overlay for queued

--- app/assets/javascripts/backbone/apps/queued/list/queued_view.js.coffee
+++ app/assets/javascripts/backbone/apps/queued/list/queued_view.js.coffee
@@ -2,6 +2,20 @@
   class List.QueuedMovieView extends Marionette.ItemView
     template: 'queued/list/templates/queuedmovie'
     tagName: 'tr'
+    events:
+      'click .remove-btn'  : 'unqueue'
+      'mouseenter'         : 'showOverlay'
+      'mouseleave'         : 'hideOverlay'
+
+    unqueue: ->
+      this.model.set(queued: false).save()
+
+    showOverlay: ->
+      this.$el.find('.overlay').fadeIn(500)
+
+    hideOverlay: ->
+      this.$el.find('.overlay').fadeOut(500)
+

   class List.QueuedListView extends Marionette.CompositeView
     template: 'queued/list/templates/queuedmovies'


No longer using helpers

No longer using helpers

--- src/trix/models/text.coffee
+++ src/trix/models/text.coffee
@@ -1,8 +1,5 @@
 #= require trix/models/piece
 #= require trix/models/piece_list
-#= require trix/lib/helpers
-
-{defer} = Trix.Helpers

 class Trix.Text
   @textForAttachmentWithAttributes: (attachment, attributes) ->


Use _.extend for extending process options

--- lib/ghc-mod/ghc-modi-process.coffee
+++ lib/ghc-mod/ghc-modi-process.coffee
@@ -5,6 +5,7 @@
 {unlitSync} = require 'atom-haskell-utils'

 GhcModiProcessReal = require './ghc-modi-process-real.coffee'
+_ = require 'underscore-plus'

 module.exports =
 class GhcModiProcess
@@ -67,11 +68,9 @@
       @commandQueues.browse = new Queue(value)

   getVersion: (opts) ->
-    opts1 = {}
-    for k, v of opts
-      opts1[k] = v
-    opts1.timeout = atom.config.get('haskell-ghc-mod.syncTimeout')
-    Util.execPromise atom.config.get('haskell-ghc-mod.ghcModPath'), ['version'], opts1
+    timeout = atom.config.get('haskell-ghc-mod.syncTimeout')
+    cmd = atom.config.get('haskell-ghc-mod.ghcModPath')
+    Util.execPromise cmd, ['version'], _.extend({timeout}, opts)
     .then (stdout) ->
       vers = /^ghc-mod version (\d+)\.(\d+)\.(\d+)(?:\.(\d+))?/.exec(stdout).slice(1, 5).map (i) -> parseInt i
       comp = /GHC (.+)$/.exec(stdout.trim())[1]
@@ -79,19 +78,16 @@
       return {vers, comp}

   checkComp: (opts, {comp}) ->
-    opts1 = {}
-    for k, v of opts
-      opts1[k] = v
-    opts1.timeout = atom.config.get('haskell-ghc-mod.syncTimeout')
+    timeout = atom.config.get('haskell-ghc-mod.syncTimeout')
     stackghc =
-      Util.execPromise 'stack', ['ghc', '--', '--version'], opts1
+      Util.execPromise 'stack', ['ghc', '--', '--version'], _.extend({timeout}, opts)
       .then (stdout) ->
         /version (.+)$/.exec(stdout.trim())[1]
       .catch (error) ->
         Util.warn error
         return null
     pathghc =
-      Util.execPromise 'ghc', ['--version'], opts1
+      Util.execPromise 'ghc', ['--version'], _.extend({timeout}, opts)
       .then (stdout) ->
         /version (.+)$/.exec(stdout.trim())[1]
       .catch (error) ->


Modification de la position de départ du joueur

--- js/game/entities/HeroPlane.coffee
+++ js/game/entities/HeroPlane.coffee
@@ -9,9 +9,9 @@
             super(@scene)

             @image = @scene.game.assets.plane
-            @x = 10
-            @y = 10
-
+            @x = 100
+            @y = 100
+
         # Mise à jour
         # @param Number dt
         handleUpdate: (dt) ->


Remove TODO that has been TODONE

Remove TODO that has been TODONE

--- lib/installed-packages-panel.coffee
+++ lib/installed-packages-panel.coffee
@@ -146,8 +146,6 @@
       core = @corePackages.find('.available-package-view:not(.hidden)').length
       @coreCount.text " (#{core}/#{@packages.core.length})"

-
-  # TODO rename this and the below
   matchPackages: ->
     filterText = @filterEditor.getEditor().getText()
     @filterPackageListByText(filterText)


Make history file optional and configurable via the opts passed to repl.start

--- repl.coffee
+++ repl.coffee
@@ -7,6 +7,7 @@

 replDefaults =
   prompt: 'coffee> ',
+  historyFile: path.join(process.env.HOME, '.coffee_history')
   eval: (input, context, filename, cb) ->
     # XXX: multiline hack.
     input = input.replace /\uFF00/g, '\n'
@@ -79,7 +80,7 @@
     return

 # Store and load command history from a file
-addHistory = (repl, filename = path.join(process.env.HOME, '.coffee_history')) ->
+addHistory = (repl, filename) ->
   try
     # Get file info and at most 10KB of command history
     stat = fs.statSync filename
@@ -123,5 +124,5 @@
     repl = nodeREPL.start opts
     repl.on 'exit', -> repl.outputStream.write '\n'
     addMultilineHandler repl
-    addHistory repl
+    addHistory repl, opts.historyFile if opts.historyFile
     repl


Deprecate requiring EditorView

Deprecate requiring EditorView

--- exports/atom.coffee
+++ exports/atom.coffee
@@ -8,10 +8,6 @@
   Point: Point
   Range: Range

-Object.defineProperty module.exports, 'Git', get: ->
-  deprecate "Please require `GitRepository` instead of `Git`: `{GitRepository} = require 'atom'`"
-  module.exports.GitRepository
-
 # The following classes can't be used from a Task handler and should therefore
 # only be exported when not running as a child node process
 unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
@@ -20,7 +16,7 @@
   module.exports.$ = $
   module.exports.$$ = $$
   module.exports.$$$ = $$$
-  module.exports.EditorView = require '../src/text-editor-view'
+  module.exports.TextEditorView = require '../src/text-editor-view'
   module.exports.ScrollView = require '../src/scroll-view'
   module.exports.SelectListView = require '../src/select-list-view'
   module.exports.Task = require '../src/task'
@@ -29,3 +25,11 @@
   module.exports.Workspace = require '../src/workspace'
   module.exports.React = require 'react-atom-fork'
   module.exports.Reactionary = require 'reactionary-atom-fork'
+
+Object.defineProperty module.exports, 'Git', get: ->
+  deprecate "Please require `GitRepository` instead of `Git`: `{Git} = require 'atom'`"
+  module.exports.GitRepository
+
+Object.defineProperty module.exports, 'EditorView', get: ->
+  deprecate "Please require `TextEditorView` instead of `EditorView`: `{TextEditorView} = require 'atom'`"
+  module.exports.TextEditorView


:bug: Fix typo in decorations scopes

:bug: Fix typo in decorations scopes

--- lib/minimap-git-diff-binding.coffee
+++ lib/minimap-git-diff-binding.coffee
@@ -45,11 +45,11 @@
       startRow = newStart - 1
       endRow = newStart + newLines - 2
       if oldLines is 0 and newLines > 0
-        @markRange(startRow, endRow, '.minimap git-line-added')
+        @markRange(startRow, endRow, '.minimap .git-line-added')
       else if newLines is 0 and oldLines > 0
-        @markRange(startRow, startRow, '.minimap git-line-removed')
+        @markRange(startRow, startRow, '.minimap .git-line-removed')
       else
-        @markRange(startRow, endRow, '.minimap git-line-modified')
+        @markRange(startRow, endRow, '.minimap .git-line-modified')
     return

   removeDecorations: ->


Update remaining selected class names to fold-selected

--- spec/editor-spec.coffee
+++ spec/editor-spec.coffee
@@ -2110,23 +2110,23 @@
         expect(editor.getCursorBufferPosition()).toEqual [3, 0]

     describe "when a selection starts/stops intersecting a fold", ->
-      it "adds/removes the 'selected' class to the fold's line element and hides the cursor if it is on the fold line", ->
+      it "adds/removes the 'fold-selected' class to the fold's line element and hides the cursor if it is on the fold line", ->
         editor.createFold(2, 4)

         editor.setSelectedBufferRange([[1, 0], [2, 0]], preserveFolds: true, isReversed: true)
-        expect(editor.lineElementForScreenRow(2)).toMatchSelector('.fold.selected')
+        expect(editor.lineElementForScreenRow(2)).toMatchSelector('.fold.fold-selected')

         editor.setSelectedBufferRange([[1, 0], [1, 1]], preserveFolds: true)
-        expect(editor.lineElementForScreenRow(2)).not.toMatchSelector('.fold.selected')
+        expect(editor.lineElementForScreenRow(2)).not.toMatchSelector('.fold.fold-selected')

         editor.setSelectedBufferRange([[1, 0], [5, 0]], preserveFolds: true)
-        expect(editor.lineElementForScreenRow(2)).toMatchSelector('.fold.selected')
+        expect(editor.lineElementForScreenRow(2)).toMatchSelector('.fold.fold-selected')

         editor.setCursorScreenPosition([3,0])
-        expect(editor.lineElementForScreenRow(2)).not.toMatchSelector('.fold.selected')
+        expect(editor.lineElementForScreenRow(2)).not.toMatchSelector('.fold.fold-selected')

         editor.setCursorScreenPosition([2,0])
-        expect(editor.lineElementForScreenRow(2)).toMatchSelector('.fold.selected')
+        expect(editor.lineElementForScreenRow(2)).toMatchSelector('.fold.fold-selected')
         expect(editor.find('.cursor')).toBeHidden()

         editor.setCursorScreenPosition([3,0])


Save in editor.onDidStopChanging

Save in editor.onDidStopChanging

Temporarily disables whitespace package so that you can create
newlines without getting them removed on autosave.

--- lib/notational-velocity-view.coffee
+++ lib/notational-velocity-view.coffee
@@ -87,16 +87,24 @@

   confirmSelection: ->
     item = @getSelectedItem()
+    filePath = null
     if item?
-      atom.workspace.open(item.getFilePath())
-      @cancel()
+      filePath = item.getFilePath()
     else
       sanitizedQuery = @getFilterQuery().replace(/\s+$/, '')
       if sanitizedQuery.length > 0
         filePath = path.join(@rootDirectory, sanitizedQuery + '.md')
         fs.writeFileSync(filePath, '')
-        atom.workspace.open(filePath)
-      @cancel()
+
+    if filePath
+      atom.workspace.open(filePath).then (editor) ->
+        editor.onDidStopChanging () ->
+          if editor.isModified()
+            atom.packages.deactivatePackage("whitespace");
+            editor.save()
+            atom.packages.activatePackage("whitespace");
+
+    @cancel()

   destroy: ->
     @cancel()


Refactor parser specs to gain one expectation per spec

--- spec/parser_spec.coffee
+++ spec/parser_spec.coffee
@@ -8,27 +8,28 @@

     it 'should be defined', -> expect( Walrus.Parser.parse ).toBeDefined( )

-    it 'should parse all examples correctly', ->
+    fs    = require 'fs'
+    path  = require 'path'
+    specs = './spec/examples'

-      fs   = require 'fs'
-      path = require 'path'
+    Walrus.Parser.parser.yy = Walrus.AST

-      test = ( basename ) ->
+    for file in fs.readdirSync specs when path.extname( file ) is '.wal'

-        text = fs.readFileSync "#{basename}.wal",  'utf8'
-        json = fs.readFileSync "#{basename}.js",   'utf8'
-        html = fs.readFileSync "#{basename}.html", 'utf8'
+      do ( file ) ->

-        Walrus.Parser.parser.yy = Walrus.AST
+        base = path.basename file, '.wal'
+
+        text = fs.readFileSync "#{specs}/#{base}.wal",  'utf8'
+        json = fs.readFileSync "#{specs}/#{base}.js",   'utf8'
+        html = fs.readFileSync "#{specs}/#{base}.html", 'utf8'

         tmpl = Walrus.Parser.parse text

+        console.log '*****'
+        console.log file
         console.log tmpl
         console.log eval( "(#{json})" )
         console.log tmpl.compile( eval( "(#{json})" ) )

-        expect( tmpl.compile eval( "(#{json})" ) ).toEqual html
-
-      for file in fs.readdirSync './spec/examples'
-
-        test "./spec/examples/#{path.basename file, '.wal'}" if path.extname( file ) is '.wal'
+        it "should pass the #{base} example", -> expect( tmpl.compile eval( "(#{json})" ) ).toEqual html


Explicitly disable use of react editor in specs

--- spec/spec-helper.coffee
+++ spec/spec-helper.coffee
@@ -84,6 +84,7 @@
   config.set "editor.autoIndent", false
   config.set "core.disabledPackages", ["package-that-throws-an-exception",
     "package-with-broken-package-json", "package-with-broken-keymap"]
+  config.set "core.useReactEditor", false
   config.save.reset()
   atom.config = config


Set defaults after spying on save

Set defaults after spying on save

--- spec/spec-helper.coffee
+++ spec/spec-helper.coffee
@@ -77,10 +77,10 @@
   config = new Config
     resourcePath: window.resourcePath
     configDirPath: atom.getConfigDirPath()
+  spyOn(config, 'load')
+  spyOn(config, 'save')
   config.setDefaults('core', RootView.configDefaults)
   config.setDefaults('editor', Editor.configDefaults)
-  spyOn(config, 'load')
-  spyOn(config, 'save')
   config.set "editor.fontFamily", "Courier"
   config.set "editor.fontSize", 16
   config.set "editor.autoIndent", false


Don't focus the specs window in `beforeEach`

--- spec/spec-helper.coffee
+++ spec/spec-helper.coffee
@@ -18,7 +18,6 @@
 pathsWithSubscriptions = null

 beforeEach ->
-  atom.focus()
   window.fixturesProject = new Project(require.resolve('fixtures'))
   window.resetTimeouts()
   pathsWithSubscriptions = []


Fix test step checking for invalid form

Fix test step checking for invalid form

--- tests/features/step_definitions/common_steps.coffee
+++ tests/features/step_definitions/common_steps.coffee
@@ -63,7 +63,7 @@
         @client.clickWhenVisible('.confirm-deletion')

     @Then /^I should see an invalid form$/, ->
-      invalidInputCount = @client.elements('.form-group.has-error').value.length
+      invalidInputCount = @client.elements('.parsley-error').value.length
       if not invalidInputCount
         throw new Error('The form is invalid when required inputs are empty')


Update smoke test with latest API

Update smoke test with latest API

--- specs/smoke.spec.coffee
+++ specs/smoke.spec.coffee
@@ -21,12 +21,12 @@
                       fib(n) + fib(n-1)
               """

-    fs.createReadStream 'src/coffee'
+    fs.src 'src/coffee/*.coffee'
       .pipe coffee
         bare: true
-      .pipe fs.createWriteStream('dest/js', true)
+      .pipe fs.dest 'dest/js'
       .onFinished done, (folder) ->
-        console.log fs.directory  # Display whole tree of files
+        # console.log fs.directory  # Display whole tree of files
         folder.should.equal fs.openFolder('dest/js')
         folder['sample.js'].should.not.be.null
         folder['another.js'].should.not.be.null


add Dict class, test some changes to printable_usage

--- docopt.coffee
+++ docopt.coffee
@@ -1,4 +1,4 @@
-print = console.log
+print = () -> console.log.apply(@, [].slice.call(arguments))

 class UsageMessageError extends Error
     constructor: (message) ->
@@ -50,6 +50,7 @@
     move: -> @shift() or null
     current: -> @[0] or null
     toString: -> ([].slice.apply @).toString()
+    join: (glue) -> ([].join.apply @, glue)
     error: (message) ->
         throw new @error(message)

@@ -105,7 +106,7 @@
                          UsageMessageError)
     result = parse_expr(tokens, options)
     if tokens.current() is not null
-        raise tokens.error('unexpected ending: %r' % ' '.join(tokens))
+        raise tokens.error('unexpected ending: ' + tokens.join(' '))
     return new Required(result)

@@ -195,17 +196,17 @@
     (Option.parse('-' + s) for s in doc.split(/^ *-|\n *-/)[1..])

 printable_usage = (doc, name) ->
-    if usage = (/\s*usage:\s*/i).exec(doc)[0]
-        usage = usage.replace(/^\s+/, '')
-        indent = '\n' + /(^)?[^\n]*$/.exec(usage)[0].replace(/./g, (c) ->
-           return (if c is '\t' then '\t' else ' '))
-        uses = doc.substr(usage.length).split(/\n\s*\n/)[0].split('\n')
-        uses = (u.replace /^\s+|\s+$/, '' for u in uses)
-        if name
-            uses = (u.replace /^[^\s]+/, name for u in uses)
-        return usage + uses.join(indent)
-    else
-        throw new UsageMessageError("the first word in the usage should be usage.")
+    [usage, patterns] = doc.split(/(?:^|\n)([\s^\n]*usage:\s*)/i)[1..2]
+    usage = usage.replace(/^\s+/, '')
+    if not /\s$/.test(usage) then usage += ' '
+    indent = '\n' + /(^)?[^\n]*$/.exec(usage)[0].replace(/./g, (c) ->
+       return (if c is '\t' then '\t' else ' '))
+    oldname = /^[^\s]+/.exec(patterns)[0]
+    if name is null then name = oldname
+    uses = patterns.split(/\n\s*\n/)[0]
+    uses = uses.split(new RegExp('(?:^|\\n)\\s*' + oldname))
+    uses = (name + u.replace /\s+$/, '' for u in uses[1..])
+    return usage + uses.join(indent)

 formal_usage = (printable_usage) ->
     pu = printable_usage.split()[1..]  # split and drop "usage:"
@@ -223,15 +224,21 @@
         print(version)
         exit()

+class Dict extends Object
+    constructor: (pairs) ->
+        (@[key] = value for [key, value] in pairs)
+    toString: () ->
+        '{' + (k + ': ' + @[k] for k of @).join(',\n  ') + '}'
+
 docopt = (doc, argv=process.argv[1..], name=null, help=true, version=null) ->
     DocoptExit.usage = docopt.usage = usage = printable_usage(doc, name)
     pot_options = parse_doc_options(doc)
-    [options, args] = parse_args(argv, options=pot_options)
+    [options, args] = parse_args(argv, pot_options)

     extras(help, version, options, doc)
-    formal_pattern = parse_pattern(formal_usage(usage), options=pot_options)
-#    pot_arguments = [a for a in formal_pattern.flat
-#                     if type(a) in [Argument, Command]]
+    formal_pattern = parse_pattern(formal_usage(usage), pot_options)
+#    pot_arguments = (a for a in formal_pattern.flat
+#                     if a.constructor in [Argument, Command])
 #    [matched, left, arguments] = formal_pattern.fix().match(argv)
 #    if matched and left == []:  # better message if left?
 #        args = Dict((a.name, a.value) for a in


Clear route when selected units is cleared.

--- src/app.coffee
+++ src/app.coffee
@@ -105,6 +105,7 @@
             @selectedEvents = appModels.selectedEvents
             @searchResults = appModels.searchResults
             @searchState = appModels.searchState
+            @route = appModels.route

             @selectedPosition = appModels.selectedPosition

@@ -138,6 +139,7 @@
         reset: () ->
             @_setSelectedUnits()
             @selectedPosition.clear()
+            @route.clear()
             @units.reset []
             @services.reset []
             @selectedEvents.reset []
@@ -170,6 +172,7 @@
         clearUnits: (opts) ->
             # Only clears selected units, and bbox units,
             # not removed service units nor search results.
+            @route.clear()
             if @searchResults.isSet()
                 return
             if @services.isSet()
@@ -258,6 +261,7 @@
                         deferred.resolve()
             deferred.promise()
         clearSelectedUnit: ->
+            @route.clear()
             @selectedUnits.each (u) -> u.set 'selected', false
             @_setSelectedUnits()
             @clearUnits all: false, bbox: false


Prevent redundant model change and its related event.

--- src/app.coffee
+++ src/app.coffee
@@ -134,7 +134,8 @@
                 _(units).each (u) -> u.set 'selected', true
                 @selectedUnits.reset units, options
             else
-                @selectedUnits.reset [], options
+                if @selectedUnits.length
+                    @selectedUnits.reset [], options

         reset: () ->
             @_setSelectedUnits()


Formatting.

Formatting.

--- src/app.coffee
+++ src/app.coffee
@@ -321,11 +321,10 @@
                 @services.each (s) => @_fetchServiceUnits(s)

         _fetchServiceUnits: (service) ->
-            unitList = new models.UnitList pageSize: PAGE_SIZE
-            service.set 'units', unitList
-
-            unitList.setFilter 'service', service.id
-            unitList.setFilter 'only', 'name,location,root_services'
+            unitList = new models.UnitList(pageSize: PAGE_SIZE)
+                .setFilter('service', service.id)
+                .setFilter('only', 'name,location,root_services')
+
             municipality = p13n.get 'city'
             if municipality
                 unitList.setFilter 'municipality', municipality


Other stuff.

Other stuff.

--- src/Springseed.coffee
+++ src/Springseed.coffee
@@ -7,9 +7,12 @@
 BrowserWindow 	= require "browser-window"
 AboutWindow		 = require "./AboutWindow"

+# We need a global reference of the window because Node.js may GC if if we don't.
+window = null
+
 class SpringseedWindow
-	constructor: (devtools) ->
-		@window = new BrowserWindow
+	constructor: ->
+		window = new BrowserWindow
 			'width': 1024
 			'height': 600
 			'min-width': 500
@@ -20,10 +23,10 @@

 		console.log __dirname

-		@window.loadUrl "file://"+__dirname+"/../public/index.html"
+		window.loadUrl "file://"+__dirname+"/../public/index.html"

-		@window.on "closed",  ->
-			@window = null # Dereference the window.
+		window.on "closed",  ->
+			window = null # Dereference the window.

 		if process.platform is "darwin"
 			@osxMenus()


ScrollThumb: more abstraction

ScrollThumb: more abstraction

--- src/components/scrollview/scrollthumb.coffee
+++ src/components/scrollview/scrollthumb.coffee
@@ -35,6 +35,7 @@
     @resetSizes()
     @calculateSize()
     @calculatePosition()
+

   handleDrag:->

@@ -109,20 +110,22 @@
     @trackSize  = @getTrackSize()
     @scrollSize = @getScrollSize()

-    if @trackSize >= @scrollSize
-    then @track.hide()
-    else @track.show()
-
-    size = @trackSize * @trackSize / @scrollSize
-    @setSize size
+    @setTrackVisibility()
+    @setSize @trackSize * @trackSize / @scrollSize

   calculatePosition:(event)->

     ratio = @getScrollOffset() / @getScrollSize()
-
+    @setTrackVisibility()
     @setOffset @getTrackSize() * ratio

+
+  setTrackVisibility: ->
+
+    if @trackSize >= @scrollSize
+    then @track.hide()
+    else @track.show()

   # I assume, this would fire a lot
   # we may throttle this in case - SY


Send git to user private channel (by profile.room)

--- scripts/welcome-to-zihub.coffee
+++ scripts/welcome-to-zihub.coffee
@@ -59,7 +59,7 @@
       #      robot.adapter.client.chat.postMessage(user.name, welcomeMsg(user.name))
       robot.messageRoom user.name, welcomeMsg(user.name)
       robot.messageRoom '#presentaciones', "Hola @#{user.name}"
-      welcomeGif(user, user.name)
+      welcomeGif(user, res.message.profile.room)
       add_nicks user.name

   robot.respond /la bienvenida/i, (msg) ->


prevent reassigning std constants

prevent reassigning std constants

--- rock.coffee
+++ rock.coffee
@@ -53,6 +53,7 @@
 	'True': true
 	'False': false
 	'Nil': null
+    'NaN': NaN

 _context = [STD_CONTEXT]

@@ -305,6 +306,9 @@

 		when ':='
 			#var first assign (a := expr) - may shadow a pre-existing variable
+            if fst[0] == fst[0].toUpperCase() and STD_CONTEXT.hasOwnProperty(fst))
+                err "Constant #{fst} cannot be assigned it is already defined with value #{STD_CONTEXT[fst]}."
+                return lineno + 1
 			val = evaluate tok[2..]
 			setvar fst, val, true
 			debug "Var define: #{fst} := #{dump val}: #{type val}"


fix validateMoneyByYears validation for hidden values

--- app/assets/javascripts/frontend/form-validation.js.coffee
+++ app/assets/javascripts/frontend/form-validation.js.coffee
@@ -158,18 +158,19 @@

   validateMoneyByYears: (question) ->
     for subquestion in question.find(".js-conditional-question.show-question input")
-      subq = $(subquestion)
-
-      if not subq.val() and question.hasClass("question-required")
-        @appendMessage(subq.parent(), "This field is required.")
-        @addErrorClass(question)
-        continue
-      else if not subq.val()
-        continue
-
-      if not subq.val().toString().match(@numberRegex)
-        @appendMessage(subq.parent(), "Not a valid currency value.")
-        @addErrorClass(question)
+      if $(subquestion).closest(".js-conditional-question").hasClass("show-question")
+        subq = $(subquestion)
+
+        if not subq.val() and question.hasClass("question-required")
+          @appendMessage(subq.parent(), "This field is required.")
+          @addErrorClass(question)
+          continue
+        else if not subq.val()
+          continue
+
+        if not subq.val().toString().match(@numberRegex)
+          @appendMessage(subq.parent(), "Not a valid currency value.")
+          @addErrorClass(question)

   validateDateByYears: (question) ->
     for subquestion in question.find(".js-conditional-question.show-question input")


allow assignment to 0 in mappings

allow assignment to 0 in mappings

--- app/assets/javascripts/oxalis/model/binary/plane2d.coffee
+++ app/assets/javascripts/oxalis/model/binary/plane2d.coffee
@@ -410,7 +410,7 @@
       sourceValue = 0
       for b in [0...bytesSrc]
         sourceValue += (1 << (b * 8)) * source.buffer[ src + b ]
-      sourceValue = mapping? and mapping[ sourceValue ] or sourceValue
+      sourceValue = if mapping? and mapping[ sourceValue ]? then mapping[ sourceValue ] else sourceValue

       # If you have to shorten the data,
       # use the first none-zero byte unless all are zero


Removed uneeded deferrement from Wallet ressource

--- app/assets/javascripts/sprangular/resources/wallet.coffee
+++ app/assets/javascripts/sprangular/resources/wallet.coffee
@@ -10,9 +10,11 @@

     # Load credit cards from account
     load: (account) ->
-      @cards.length = 0
+      @cards = []
+
       for paymentSource in account.payment_sources
         @cards.push CreditCard.load(paymentSource)
+
       @loaded = true

     findCardForSource: (sourceId) ->
@@ -39,13 +41,8 @@
           errorCallback(error)

     delete: (card) ->
-      deferred = $q.defer()
       cards = @cards
       $http.delete("/api/credit_cards/#{card.id}")
         .success (data) ->
           i = cards.indexOf card
           cards.splice(i, 1) unless i is -1
-          deferred.resolve Wallet
-        .error (error) ->
-          deferred.reject error
-


Update edge cases in coffeescript/anagram

--- assignments/coffeescript/anagram/anagram_test.spec.coffee
+++ assignments/coffeescript/anagram/anagram_test.spec.coffee
@@ -35,8 +35,22 @@
     matches = detector.match ["gallery", "ballerina", "regally", "clergy", "largely", "leading"]
     expect(matches).toEqual ["gallery", "regally", "largely"]

-  xit "detects anagrams case-insensitively", ->
+  xit "does not detect identical words", ->
+    detector = new Anagram "corn"
+    matches = detector.match ["corn", "dark", "Corn", "rank", "CORN", "cron", "park"]
+    expect(matches).toEqual ["cron"]
+
+  xit "does not detect non-anagrams with identical checksum", ->
+    detector = new Anagram "mass"
+    matches = detector.match ["last"]
+    expect(matches).toEqual []
+
+  xit "detects anagrams using case-insensitive subject", ->
     detector = new Anagram "Orchestra"
+    matches = detector.match ["cashregister", "carthorse", "radishes"]
+    expect(matches).toEqual ["carthorse"]
+
+  xit "detects anagrams using case-insensitive candidates", ->
+    detector = new Anagram "orchestra"
     matches = detector.match ["cashregister", "Carthorse", "radishes"]
-    expect(matches).toEqual ["Carthorse"]
-
+    expect(matches).toEqual ["carthorse"]


Fix linter errors

Fix linter errors

--- lib/deprecation-cop-view.coffee
+++ lib/deprecation-cop-view.coffee
@@ -28,7 +28,7 @@
     @subscriptions.add(Grim.on('updated', @handleGrimUpdated))
     # TODO: Remove conditional when the new StyleManager deprecation APIs reach stable.
     if atom.styles.onDidUpdateDeprecations?
-      @subscriptions.add(atom.styles.onDidUpdateDeprecations(() => @updateSelectors()))
+      @subscriptions.add(atom.styles.onDidUpdateDeprecations(=> @updateSelectors()))
     @debouncedUpdateCalls = _.debounce(@updateCalls, 1000)

   attached: ->


Remove Saved Props From Most Fields

Remove Saved Props From Most Fields

Remove most of the saved props from most of the fields, with the expect
of single_select_typeahead. In order to test if the saved list is being
used without having to use props to active saved label for that field.

This will also test if the user can force the saved label to display for
a single field as well.

--- examples/kitchen-sink/coffeescript/kitchen-sink.coffee
+++ examples/kitchen-sink/coffeescript/kitchen-sink.coffee
@@ -56,11 +56,9 @@
           f.input "InputWithoutALabel",
             xs: 12
             label: false
-            saved: true
             placeholder: "Input Without a Label"
-          f.input "email", saved: true
+          f.input "email"
           f.input "select_example",
-            saved: true
             options: [
               # The 3 formats for options
               # 1. An object with a label and a value (perfered)
@@ -78,7 +76,6 @@
           f.input "stuff_or_things",
             type: "typeahead",
             multiple: true,
-            saved: true,
             options: [
               # The 3 formats for options
               # 1. An object with a label and a value (perfered)
@@ -91,7 +88,7 @@

           f.input "single_select_typeahead",
             type: "typeahead",
-            saved: true,
+            saves: true,
             options: [
               # The 3 formats for options
               # 1. An object with a label and a value (perfered)
@@ -105,7 +102,6 @@
           f.input "customSelectionRendering",
             type: "typeahead",
             multiple: true,
-            saved: true,
             displaySelections: false,
             options: [
               # The 3 formats for options
@@ -131,7 +127,6 @@
             h2 {}, "Passwords"
           f.input "password",
             xs: 6,
-            saved: true,
           f.input "passwordConfirmation", xs: 6

         div className: "row",
@@ -140,7 +135,6 @@
             type: "text"
             rows: 5
             xs: 12
-            saved: true

           f.input "description-two",
             className: "testing-class-name"
@@ -148,7 +142,6 @@
             rows: 5
             label: false
             placeholder: "Description without a label"
-            saved: true
             xs: 12

         div className: "row",
@@ -156,7 +149,6 @@
             type: "switch",
             xs: "6",
             label: "Time of Day",
-            saved: true
             handleWidth: 100
             onText: "Enabled"
             offText: "Disabled"
@@ -165,7 +157,6 @@
             type: "switch",
             xs: "6",
             label: false
-            saved: true
           f.input "red_or_blue",
             type: "switch"
             onText: "Red"
@@ -178,37 +169,31 @@
             type: "file",
             xs: "6"
             label: "Uploading Avatar"
-            saved: true
           ),
           f.input "uploadVirus",
             type: "file",
             xs: "6"
             label: false
-            saved: true
         div className: "row",
           f.input "startTime",
             type: "time"
             xs: "12"
             placeholder: "12:00pm"
             label: "Start Time"
-            saved: true
           f.input "endTime",
             type: "time"
             xs: "12"
             placeholder: "End Time"
             label: false
-            saved: true
         div className: "row",
           f.input "colorOne",
             type: "color"
             xs: "12"
             label: "Color One"
-            saved: true
           f.input "colorTwo",
             type: "color"
             xs: "12",
             label: false
-            saved: true
         div className: "row",
           div className: "col-xs-12",
             h3 {}, "Nested Fields (Eg. Has Many)"
@@ -225,7 +210,7 @@
             h3 {}, "Additional Sketchy Info"

         div className: "row",
-          f.input "shareSketchyInfo", saved: true
+          f.input "shareSketchyInfo"
           if @state.account.shareSketchyInfo
             [
               f.input "socialSecurityNumber"


Fixes issue with geoip uri

Fixes issue with geoip uri

--- server/controllers/geoip.coffee
+++ server/controllers/geoip.coffee
@@ -13,12 +13,15 @@
       ipToSend = req.ip

     common.log "IP request: " + ipToSend
-    request apiEndpoint + "/" + apiVer + "/" + "/geoip/" + ipToSend
-    , (err, response, body) ->
+    uri = apiEndpoint + "/" + apiVer + "/" + "geoip/" + ipToSend
+    request uri, (err, response, body) ->
       common.log 'back from goinc api'
       if err?
         common.log 'error: ' + err
         res.json 500, err
       else
         common.log body
-        res.json 200, JSON.parse(body)
+        if response.statusCode is 200
+          res.json 200, JSON.parse(body)
+        else
+          res.json 404, {}


DevTools: cleanup

DevTools: cleanup

--- client/DevTools/AppView.coffee
+++ client/DevTools/AppView.coffee
@@ -32,10 +32,8 @@
       partial : "<span>#{labels[Number state]}</span>"
       click   : =>
         mainView.toggleFullscreen()
-        # @getActiveAceView().toggleFullscreen()
         menu.contextMenu.destroy()
-        # menu.click()
-    # behave like a menu item
+
     toggleFullscreen.on "viewAppended", ->
       toggleFullscreen.parent.setClass "default"

@@ -119,7 +117,6 @@
                   else editor = JSEditor

                 editor.openFile file, content
-
             }
             {
               type              : "split"


Sidebar: Increase hoverIntent time.

Sidebar: Increase hoverIntent time.

--- client/app/lib/mainview.coffee
+++ client/app/lib/mainview.coffee
@@ -138,7 +138,7 @@
         testpath : 'main-sidebar'
       mouseenter : =>
         if @isSidebarCollapsed
-          kd.utils.wait 100, => @toggleHoverSidebar()
+          kd.utils.wait 200, => @toggleHoverSidebar()
       mouseleave : =>
         @toggleHoverSidebar()  if @hasClass 'hover'


remove some debuggers

remove some debuggers

--- client/finder/fs/fsitem.coffee
+++ client/finder/fs/fsitem.coffee
@@ -52,23 +52,15 @@

     file = null

-    debugger
-
     ok = osKite.vmStart()
     .then ->
-
-      debugger

       osKite.fsEnsureNonexistentPath(path: targetPath)
       .then (actualPath) ->
         command = "#{ commandPrefix } #{ escapeFilePath sourceItem.path } #{ escapeFilePath actualPath }"

-        debugger
-
         osKite.exec(command)
         .then ->
-
-          debugger

           file = FSHelper.createFile {
             path        : actualPath
@@ -272,7 +264,7 @@
     @osKite.vmStart()

     .then =>
-      @osKite.fsRemove(path: @getPath())
+      @osKite.fsRemove { path: @getPath(), recursive }

     .then (result) ->
       callback null, result


Just set sync directly on prototype

Just set sync directly on prototype

--- client/lanes/data/Model.coffee
+++ client/lanes/data/Model.coffee
@@ -185,8 +185,7 @@
         else
             ''

-    sync: ->
-        Lanes.Data.Sync.apply(this,arguments)
+    sync: Lanes.Data.Sync

     _recordUnsaved: (record,options)->
         attrs = this.changedAttributes()


Page draft editing should now work

Page draft editing should now work

--- server/mixins/page_model.coffee
+++ server/mixins/page_model.coffee
@@ -69,7 +69,11 @@
       Page.findOne({parent_id: @_id, is_draft: true}), 'exec'
     ).then( (page) =>
       if page?
-        deferred.resolve(page)
+        Q.nsend(
+          Page, 'findFatModel', page._id
+        ).then( (fatPage) ->
+          deferred.resolve(fatPage)
+        )
       else
         @getPage().then( (nonDraftPage) ->
           nonDraftPage.createDraftClone()


lasso tool should clear overlay on pan end

--- bokehjs/src/coffee/tool/gestures/lasso_select_tool.coffee
+++ bokehjs/src/coffee/tool/gestures/lasso_select_tool.coffee
@@ -15,11 +15,11 @@

     _active_change: () ->
       if not @mget('active')
-        @mget('overlay').set('data', null)
+        @_clear_overlay()

     _keyup: (e) ->
       if e.keyCode == 13
-        @mget('overlay').set('data', null)
+        @_clear_overlay()

     _pan_start: (e) ->
       canvas = @plot_view.canvas
@@ -45,6 +45,12 @@

       append = e.srcEvent.shiftKey ? false
       @_select(@data.vx, @data.vy, append)
+
+    _pan_end: (e) ->
+      @_clear_overlay()
+
+    _clear_overlay: () ->
+      @mget('overlay').set('data', null)

     _select: (vx, vy, append) ->
       geometry = {


Fixed #79 (wrong indention)

Fixed #79 (wrong indention)

--- lib/atom-html-preview-view.coffee
+++ lib/atom-html-preview-view.coffee
@@ -103,15 +103,15 @@
     fs.writeFile outPath, out, callback

   renderHTMLCode: (text) ->
-    if not atom.config.get("atom-html-preview.triggerOnSave") and @editor.getPath()? then @save () =>
-      iframe = document.createElement("iframe")
-      # Fix from @kwaak (https://github.com/webBoxio/atom-html-preview/issues/1/#issuecomment-49639162)
-      # Allows for the use of relative resources (scripts, styles)
-      iframe.setAttribute("sandbox", "allow-scripts allow-same-origin")
-      iframe.src = @tmpPath
-      @html $ iframe
-      # @trigger('atom-html-preview:html-changed')
-      atom.commands.dispatch 'atom-html-preview', 'html-changed'
+    if not atom.config.get("atom-html-preview.triggerOnSave") and @editor.getPath()? then @save()
+    iframe = document.createElement("iframe")
+    # Fix from @kwaak (https://github.com/webBoxio/atom-html-preview/issues/1/#issuecomment-49639162)
+    # Allows for the use of relative resources (scripts, styles)
+    iframe.setAttribute("sandbox", "allow-scripts allow-same-origin")
+    iframe.src = @tmpPath
+    @html $ iframe
+    # @trigger('atom-html-preview:html-changed')
+    atom.commands.dispatch 'atom-html-preview', 'html-changed'

   getTitle: ->
     if @editor?


:lipstick: Use is and ?

:lipstick: Use is and ?

--- lib/available-package-view.coffee
+++ lib/available-package-view.coffee
@@ -24,7 +24,7 @@
       @packageManager.emit('package-installing', @pack)

       @packageManager.install @pack, (error) =>
-        if error
+        if error?
           console.error("Installing #{@type} #{@pack.name} failed", error.stack ? error, error.stderr)

     @learnMoreButton.on 'click', =>
@@ -32,8 +32,8 @@

   handlePackageEvents: ->
     @subscribe @packageManager, 'package-installed package-install-failed theme-installed theme-install-failed', (pack, error) =>
-      if pack.name == @pack.name
-        if error
+      if pack.name is @pack.name
+        if error?
           @setStatusIcon('alert')
           @installButton.prop('disabled', false)
         else
@@ -41,7 +41,7 @@
           @installButton.text('Installed')

     @subscribe @packageManager, 'package-installing', (pack) =>
-      if pack.name == @pack.name
+      if pack.name is @pack.name
         @installButton.prop('disabled', true)
         @setStatusIcon('cloud-download')


Use W3C compliant `textContent` instead of `innerText

--- assets/js/app.coffee
+++ assets/js/app.coffee
@@ -90,11 +90,11 @@

   # Callback to restore the clipboard button's original text
   clipboardMouseout: (client, args) ->
-    @innerText = $(this).data("clipboard-prompt")
+    @textContent = $(this).data("clipboard-prompt")

   # Post-copy user feedback callback
   clipboardComplete: (client, args) ->
-    @innerText = "Copied!"
+    @textContent = "Copied!"

   # Initializes pill navigation for license variations
   initLicenseVariationNav: ->


renamed find to select

renamed find to select

--- framer/Layer.coffee
+++ framer/Layer.coffee
@@ -1067,7 +1067,7 @@
 		if @_context._parent
 			return @_context._parent

-	find: (selector) ->
+	select: (selector) ->
 		layers = _.find @descendants, (layer) ->
 			Utils.layerMatchesSelector(layer,selector)


Smarter way of gettting nonAnimatible properties

--- framer/Layer.coffee
+++ framer/Layer.coffee
@@ -907,9 +907,9 @@

 		_.defaults(options,properties.options)
 		delete properties.options
+
 		animatableProperties = Animation.filterAnimatableProperties(properties)
-		nonAnimatableKeys = _.difference(_.keys(properties),_.keys(animatableProperties))
-		nonAnimatableProperties = _.pick(_.clone(properties),nonAnimatableKeys)
+		nonAnimatableProperties = _.omit(_.clone(properties),_.keys(animatableProperties))
 		options.properties = animatableProperties
 		options.layer = @


stylistic improvements

stylistic improvements

--- framer/Layer.coffee
+++ framer/Layer.coffee
@@ -252,8 +252,6 @@
 		m

 	_perspectiveMatrix: (element) =>
-		if !element
-			element = Screen
 		ox = element.perspectiveOriginX * element.width
 		oy = element.perspectiveOriginY * element.height
 		ppm = @_perspectiveProjectionMatrix(element)
@@ -264,16 +262,14 @@

 	@define "matrix3d",
 		get: ->
-			ppm = @_perspectiveMatrix(@superLayer)
+			parent = @superLayer or @context
+			ppm = @_perspectiveMatrix(parent)
 			new Matrix()
 				.multiply(ppm)
 				.multiply(@transformMatrix)

 	_screenPoint: (point = {}, context = false) =>
-		point =
-			x: point.x || 0
-			y: point.y || 0
-			z: point.z || 0
+		point = _.defaults(point, {x:0, y:0, z:0})
 		point = @matrix3d.point(point)

 		for layer in @superLayers(context)


Fix to error handling to deal with res.request being missing

--- lib/autoRefreshFromUrl.coffee
+++ lib/autoRefreshFromUrl.coffee
@@ -77,7 +77,7 @@

     processUrlData: (res, raw, oldPayload) -> # May return value or promise
         if res && res.statusCode != 200
-            err = new Error "Failed to refresh url - status code: #{res.statusCode}: #{res.request.href}"
+            err = new Error "Failed to refresh url - status code: #{res.statusCode}: #{res?.request?.href || @url}"
             err.rawResponse = raw
             throw err
         return raw


refactor overview layout factory to hopefully make more sense

--- src/desktop/apps/partner2/client/overview_layout_factory.coffee
+++ src/desktop/apps/partner2/client/overview_layout_factory.coffee
@@ -17,161 +17,97 @@
 module.exports = (partner, profile) ->
   contract =
     institution: [
-      galleryTwoHero partner, profile
-      galleryTwoAbout partner, profile
-      galleryTwoNews partner, profile
-      galleryTwoShows partner, profile
-      galleryTwoFairBooths partner, profile
-      galleryTwoArtists partner, profile
-      galleryTwoArticles partner, profile
+      configurable2ShowsHero partner, profile
+      aboutSection partner, profile
+      newsSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      configurableArtists partner, profile
+      articlesSection partner, profile
     ]
     gallery_default: [
-      galleryDefaultShows partner, profile
-      galleryDefaultArtists partner, profile
-      galleryDefaultLocations partner, profile
+      showsGrid partner, profile
+      possiblyUnclaimedPartnerArtists partner, profile
+      locationsSection partner, profile
     ]
     gallery_one: [
-      galleryOneHero partner, profile
-      galleryOneAbout partner, profile
-      galleryOneShows partner, profile
-      galleryOneFairBooths partner, profile
-      galleryOneArtists partner, profile
+      oneShowOnlyHero partner, profile
+      aboutSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      artistsGrid partner, profile
     ]
     gallery_two: [
-      galleryTwoHero partner, profile
-      galleryTwoAbout partner, profile
-      galleryTwoNews partner, profile
-      galleryTwoShows partner, profile
-      galleryTwoFairBooths partner, profile
-      galleryTwoArtists partner, profile
-      galleryTwoArticles partner, profile
+      configurable2ShowsHero partner, profile
+      aboutSection partner, profile
+      newsSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      configurableArtists partner, profile
+      articlesSection partner, profile
     ]
     gallery_three: [
-      galleryThreeHero partner, profile
-      galleryThreeAbout partner, profile
-      galleryThreeNews partner, profile
-      galleryThreeShows partner, profile
-      galleryThreeFairBooths partner, profile
-      galleryThreeArtists partner, profile
-      galleryThreeArticles partner, profile
+      configurable10ShowsHero partner, profile
+      aboutSection partner, profile
+      newsSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      configurableArtists partner, profile
+      articlesSection partner, profile
     ]
     gallery_four: [
-      galleryFourHero partner, profile
-      galleryFourAbout partner, profile
-      galleryFourNews partner, profile
-      galleryFourShows partner, profile
-      galleryFourFairBooths partner, profile
-      galleryFourArtists partner, profile
-      galleryFourArticles partner, profile
+      configurable10ShowsHero partner, profile
+      aboutSection partner, profile
+      newsSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      configurableArtists partner, profile
+      articlesSection partner, profile
     ]
     gallery_five: [
-      galleryFiveHero partner, profile
-      galleryFiveAbout partner, profile
-      galleryFiveNews partner, profile
-      galleryFiveShows partner, profile
-      galleryFiveFairBooths partner, profile
-      galleryFiveArtists partner, profile
-      galleryFiveArticles partner, profile
+      configurable10ShowsHero partner, profile
+      aboutSection partner, profile
+      newsSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      configurableArtists partner, profile
+      articlesSection partner, profile
     ]
     gallery_six: [
-      gallerySixHero partner, profile
-      gallerySixAbout partner, profile
-      gallerySixShows partner, profile
-      gallerySixFairBooths partner, profile
-      gallerySixArtists partner, profile
+      oneShowOnlyHero partner, profile
+      aboutSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      artistsGrid partner, profile
     ]
     gallery_seven: [
-      gallerySevenHero partner, profile
-      gallerySevenAbout partner, profile
-      gallerySevenShows partner, profile
-      gallerySevenFairBooths partner, profile
-      gallerySevenArtists partner, profile
+      oneShowOnlyHero partner, profile
+      aboutSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      artistsGrid partner, profile
+    ]
+    gallery_eight: [
+      configurable10ShowsHero partner, profile
+      aboutSection partner, profile
+      newsSection partner, profile
+      showsCarousel partner, profile
+      fairBoothsSection partner, profile
+      configurableArtists partner, profile
+      articlesSection partner, profile
     ]

   contract[partner.get('profile_layout')] or []

 #
-# Sections for gallery_default layout.
-#
-galleryDefaultShows = (partner, profile) ->
-  name: 'shows'
-  component: ShowsGrid
-  options:
-    partner: partner
-    isCombined: true
-    numberOfFeatured: if partner.claimed() then 1 else 0
-    numberOfShows: 6
-    seeAll: partner.claimed()
-    heading: 'Shows & Fair Booths' unless partner.claimed()
-
-galleryDefaultArtists = (partner, profile) ->
-  name: 'artists'
-  component: (
-    ArtistsGridView if partner.claimed()
-  )
-  options: partner: partner
-
-galleryDefaultLocations = (partner, profile) ->
-  name: 'locations'
-  title: 'Locations'
-  component: (
-    LocationsView unless partner.claimed()
-  )
-  options: partner: partner
-
-#
-# Sections for gallery_one layout.
-#
-galleryOneHero = (partner, profile) ->
+# Hero Section
+#
+oneShowOnlyHero = (partner, profile) ->
   name: 'hero'
   component: HeroShowsCarousel
   options: partner: partner, maxNumberOfShows: 1

-galleryOneAbout = (partner, profile) ->
-  name: 'about'
-  template: aboutTemplate profile: profile if profile.get('full_bio')
-  title: 'About'
-
-galleryOneShows = (partner, profile) ->
-  name: 'shows'
-  component: FixedCellsCountCarousel
-  options:
-    partner: partner
-    collection: new PartnerShows
-    fetchOptions: [
-      { partner_id: partner.get('_id'), status: 'current', at_a_fair: false, displayable: true, size: 9, sort: 'start_at' }
-      { partner_id: partner.get('_id'), status: 'closed', at_a_fair: false, displayable: true, size: 9, sort: '-end_at' }
-    ]
-    template: showsTemplate
-  title: 'Shows'
-  viewAll: "#{partner.href()}/shows"
-
-galleryOneFairBooths = (partner, profile) ->
-  name: 'fair-booths'
-  component: FixedCellsCountCarousel
-  options:
-    partner: partner
-    collection: new PartnerShows
-    fetchOptions: [
-      { partner_id: partner.get('_id'), status: 'current', at_a_fair: true, displayable: true, size: 9, sort: 'start_at' }
-      { partner_id: partner.get('_id'), status: 'closed', at_a_fair: true, displayable: true, size: 9, sort: '-end_at' }
-    ]
-    template: fairBoothsTemplate
-  title: 'Fair Booths'
-  viewAll: "#{partner.href()}/shows"
-
-galleryOneArtists = (partner, profile) ->
-  name: 'artists'
-  component: ArtistsGridView
-  options: partner: partner
-
-#
-# Sections for gallery_two layout.
-#
-galleryTwoAbout = galleryOneAbout
-galleryTwoShows = galleryOneShows
-galleryTwoFairBooths = galleryOneFairBooths
-galleryTwoHero = (partner, profile) ->
+configurable2ShowsHero = (partner, profile) ->
   name: 'hero'
   component:
     switch partner.get('profile_banner_display')
@@ -186,13 +122,104 @@
       else _.pick options, 'partner', 'maxNumberOfShows'
   )

-galleryTwoNews = (partner, parfile) ->
+configurable10ShowsHero = (partner, profile) ->
+  name: 'hero'
+  component:
+    switch partner.get('profile_banner_display')
+      when 'Artworks' then HeroArtworksCarousel
+      else HeroShowsCarousel
+  options: (
+    options =
+      partner: partner
+      maxNumberOfShows: 10
+    switch partner.get('profile_banner_display')
+      when 'Artworks' then _.pick options, 'partner'
+      else _.pick options, 'partner', 'maxNumberOfShows'
+  )
+
+
+#
+# About Section
+#
+aboutSection = (partner, profile) ->
+  name: 'about'
+  template: aboutTemplate profile: profile if profile.get('full_bio')
+  title: 'About'
+
+
+#
+# News Section
+#
+newsSection = (partner, parfile) ->
   name: 'news'
   component: NewsView
   options: partner: partner
   title: 'News'

-galleryTwoArtists = (partner, profile) ->
+
+#
+# Shows Section
+#
+showsGrid = (partner, profile) ->
+  name: 'shows'
+  component: ShowsGrid
+  options:
+    partner: partner
+    isCombined: true
+    numberOfFeatured: if partner.claimed() then 1 else 0
+    numberOfShows: 6
+    seeAll: partner.claimed()
+    heading: 'Shows & Fair Booths' unless partner.claimed()
+
+showsCarousel = (partner, profile) ->
+  name: 'shows'
+  component: FixedCellsCountCarousel
+  options:
+    partner: partner
+    collection: new PartnerShows
+    fetchOptions: [
+      { partner_id: partner.get('_id'), status: 'current', at_a_fair: false, displayable: true, size: 9, sort: 'start_at' }
+      { partner_id: partner.get('_id'), status: 'closed', at_a_fair: false, displayable: true, size: 9, sort: '-end_at' }
+    ]
+    template: showsTemplate
+  title: 'Shows'
+  viewAll: "#{partner.href()}/shows"
+
+
+#
+# Fair Booths Section
+#
+fairBoothsSection = (partner, profile) ->
+  name: 'fair-booths'
+  component: FixedCellsCountCarousel
+  options:
+    partner: partner
+    collection: new PartnerShows
+    fetchOptions: [
+      { partner_id: partner.get('_id'), status: 'current', at_a_fair: true, displayable: true, size: 9, sort: 'start_at' }
+      { partner_id: partner.get('_id'), status: 'closed', at_a_fair: true, displayable: true, size: 9, sort: '-end_at' }
+    ]
+    template: fairBoothsTemplate
+  title: 'Fair Booths'
+  viewAll: "#{partner.href()}/shows"
+
+
+#
+# Artists Section
+#
+possiblyUnclaimedPartnerArtists = (partner, profile) ->
+  name: 'artists'
+  component: (
+    ArtistsGridView if partner.claimed()
+  )
+  options: partner: partner
+
+artistsGrid = (partner, profile) ->
+  name: 'artists'
+  component: ArtistsGridView
+  options: partner: partner
+
+configurableArtists = (partner, profile) ->
   name: 'artists'
   component:
     if partner.get('display_artists_section')
@@ -203,7 +230,23 @@
   title: 'Artists' unless partner.get('profile_artists_layout') is 'Grid'
   viewAll: "#{partner.href()}/artists" unless partner.get('profile_artists_layout') is 'Grid'

-galleryTwoArticles = (partner, profile) ->
+
+#
+# Locations Section
+#
+locationsSection = (partner, profile) ->
+  name: 'locations'
+  title: 'Locations'
+  component: (
+    LocationsView unless partner.claimed()
+  )
+  options: partner: partner
+
+
+#
+# Articles Section
+#
+articlesSection = (partner, profile) ->
   name: 'articles'
   component: FixedCellsCountCarousel
   options:
@@ -213,67 +256,3 @@
     template: articlesTemplate
   title: 'Articles'
   viewAll: "#{partner.href()}/articles"
-
-#
-# Sections for gallery_three layout.
-#
-galleryThreeAbout = galleryTwoAbout
-galleryThreeNews = galleryTwoNews
-galleryThreeShows = galleryTwoShows
-galleryThreeFairBooths = galleryTwoFairBooths
-galleryThreeArtists = galleryTwoArtists
-galleryThreeArticles = galleryTwoArticles
-galleryThreeHero = (partner, profile) ->
-  name: 'hero'
-  component:
-    switch partner.get('profile_banner_display')
-      when 'Artworks' then HeroArtworksCarousel
-      else HeroShowsCarousel
-  options: (
-    options =
-      partner: partner
-      maxNumberOfShows: 10
-    switch partner.get('profile_banner_display')
-      when 'Artworks' then _.pick options, 'partner'
-      else _.pick options, 'partner', 'maxNumberOfShows'
-  )
-
-#
-# Sections for gallery_four layout.
-#
-galleryFourHero = galleryThreeHero
-galleryFourAbout = galleryTwoAbout
-galleryFourNews = galleryTwoNews
-galleryFourShows = galleryTwoShows
-galleryFourFairBooths = galleryTwoFairBooths
-galleryFourArtists = galleryTwoArtists
-galleryFourArticles = galleryTwoArticles
-
-#
-# Sections for gallery_five layout.
-#
-galleryFiveHero = galleryThreeHero
-galleryFiveAbout = galleryThreeAbout
-galleryFiveNews = galleryThreeNews
-galleryFiveShows = galleryThreeShows
-galleryFiveFairBooths = galleryThreeFairBooths
-galleryFiveArtists = galleryThreeArtists
-galleryFiveArticles = galleryThreeArticles
-
-#
-# Sections for gallery_six layout.
-#
-gallerySixHero = galleryOneHero
-gallerySixAbout = galleryOneAbout
-gallerySixShows = galleryOneShows
-gallerySixFairBooths = galleryOneFairBooths
-gallerySixArtists = galleryOneArtists
-
-#
-# Sections for gallery_seven layout.
-#
-gallerySevenHero = galleryOneHero
-gallerySevenAbout = galleryOneAbout
-gallerySevenShows = galleryOneShows
-gallerySevenFairBooths = galleryOneFairBooths
-gallerySevenArtists = galleryOneArtists


Remove WorkspaceView references from specs

--- spec/autocomplete-spec.coffee
+++ spec/autocomplete-spec.coffee
@@ -1,19 +1,17 @@
-{WorkspaceView} = require 'atom'
 {$} = require 'atom-space-pen-views'
 AutocompleteView = require '../lib/autocomplete-view'
 Autocomplete = require '../lib/autocomplete'

 describe "Autocomplete", ->
-  [activationPromise] = []
+  [workspaceElement, activationPromise] = []

   beforeEach ->
-    atom.workspaceView = new WorkspaceView
-
     waitsForPromise ->
       atom.workspace.open('sample.js')

     runs ->
-      atom.workspaceView.simulateDomAttachment()
+      workspaceElement = atom.views.getView(atom.workspace)
+      jasmine.attachToDOM(workspaceElement)
       activationPromise = atom.packages.activatePackage('autocomplete')

   describe "@activate()", ->
@@ -21,50 +19,47 @@
       spyOn(AutocompleteView.prototype, 'initialize').andCallThrough()

       expect(AutocompleteView.prototype.initialize).not.toHaveBeenCalled()
-
-      atom.workspaceView.attachToDom()
-      leftEditor = atom.workspaceView.getActiveView()
-      rightEditor = leftEditor.splitRight()
-
-      atom.commands.dispatch leftEditor.element, 'autocomplete:toggle'
+      atom.workspace.getActivePane().splitRight(copyActiveItem: true)
+
+      [leftEditorElement, rightEditorElement] = workspaceElement.querySelectorAll('atom-text-editor')
+
+      atom.commands.dispatch leftEditorElement, 'autocomplete:toggle'

       waitsForPromise ->
         activationPromise

       runs ->
-        expect(leftEditor.find('.autocomplete')).toExist()
-        expect(rightEditor.find('.autocomplete')).not.toExist()
+        expect(leftEditorElement.querySelector('.autocomplete')).toExist()
+        expect(rightEditorElement.querySelector('.autocomplete')).not.toExist()
         expect(AutocompleteView.prototype.initialize).toHaveBeenCalled()

-        autoCompleteView = leftEditor.find('.autocomplete').view()
-        atom.commands.dispatch leftEditor.find('.autocomplete').element, 'core:cancel'
-        expect(leftEditor.find('.autocomplete')).not.toExist()
-
-        atom.commands.dispatch rightEditor.element, 'autocomplete:toggle'
-        expect(rightEditor.find('.autocomplete')).toExist()
+        atom.commands.dispatch leftEditorElement.querySelector('.autocomplete'), 'core:cancel'
+        expect(leftEditorElement.querySelector('.autocomplete')).not.toExist()
+
+        atom.commands.dispatch rightEditorElement, 'autocomplete:toggle'
+        expect(rightEditorElement.querySelector('.autocomplete')).toExist()

   describe "@deactivate()", ->
     it "removes all autocomplete views and doesn't create new ones when new editors are opened", ->
-      atom.workspaceView.attachToDom()
-      atom.commands.dispatch atom.workspaceView.getActiveView().element, "autocomplete:toggle"
+      textEditorElement = workspaceElement.querySelector('atom-text-editor')
+      atom.commands.dispatch textEditorElement, "autocomplete:toggle"

       waitsForPromise ->
         activationPromise

       runs ->
-        expect(atom.workspaceView.getActiveView().find('.autocomplete')).toExist()
+        expect(textEditorElement.querySelector('.autocomplete')).toExist()
         atom.packages.deactivatePackage('autocomplete')
-        expect(atom.workspaceView.getActiveView().find('.autocomplete')).not.toExist()
-        atom.workspaceView.getActiveView().splitRight()
-        atom.commands.dispatch atom.workspaceView.getActiveView().element, "autocomplete:toggle"
-        expect(atom.workspaceView.getActiveView().find('.autocomplete')).not.toExist()
+        expect(textEditorElement.querySelector('.autocomplete')).not.toExist()
+
+        atom.workspace.getActivePane().splitRight(copyActiveItem: true)
+        atom.commands.dispatch atom.views.getView(atom.workspace.getActivePaneItem()), "autocomplete:toggle"
+        expect(workspaceElement.querySelector('.autocomplete')).not.toExist()

 describe "AutocompleteView", ->
   [autocomplete, editor, miniEditor] = []

   beforeEach ->
-    atom.workspaceView = new WorkspaceView
-
     waitsForPromise ->
       atom.workspace.open('sample.js').then (anEditor) -> editor = anEditor


Use import paths from themes when loading a less sheet

--- src/app/window.coffee
+++ src/app/window.coffee
@@ -138,10 +138,12 @@
     fsUtils.read(stylesheetPath)

 window.loadLessStylesheet = (lessStylesheetPath) ->
+  importPaths = atom.themes.getImportPaths()
   parser = new less.Parser
     syncImport: true
-    paths: config.lessSearchPaths
+    paths: importPaths.concat(config.lessSearchPaths)
     filename: lessStylesheetPath
+
   try
     content = null
     parser.parse fsUtils.read(lessStylesheetPath), (e, tree) ->


Disable in/out

Disable in/out

--- src/appcontext.coffee
+++ src/appcontext.coffee
@@ -48,12 +48,12 @@
   render: () ->
     reqDate = new Date this.props.data.time
     className = if this.props.selected then 'selected' else 'not-selected'
+
     typeNames =
       '$emit': 'incoming'
       'emit': 'outgoing'
     type = typeNames[this.props.data.name]
     className += " #{type}" if type
-

     `

       {reqDate.getHours()}:{this.twoDigit(reqDate.getMinutes())}:{this.twoDigit(reqDate.getSeconds())}:{this.twoDigit(reqDate.getMilliseconds())}


Fixed test

Fixed test

--- spec/jquery/basic.spec.coffee
+++ spec/jquery/basic.spec.coffee
@@ -27,7 +27,8 @@
     container.trigger("mousedown") # open the drop
     expect(container.hasClass("chosen-container-active")).toBe true
     #select an item
-    container.find(".active-result").last().trigger("mouseup")
+    drop_container = $(".chosen-container.chosen-container-single.chosen-with-drop.chosen-container-active")
+    drop_container.find(".active-result").last().trigger("mouseup")

     expect(select.val()).toBe "Afghanistan"


Remove obsolete prototype definition

Remove obsolete prototype definition

--- lib/written/app/assets/javascripts/written/core/extensions/text.coffee
+++ lib/written/app/assets/javascripts/written/core/extensions/text.coffee
@@ -1,2 +0,0 @@
-Text::toString = ->
-  @textContent


Increased the resolution of the map texture

--- client/terrain/streamer.coffee
+++ client/terrain/streamer.coffee
@@ -29,7 +29,7 @@
   ])

 # How many times higher resolutions should the maps have in relation to the terrain pxWidth
-MAP_SCALE = 1
+MAP_SCALE = 2

 # How many tiles should we keep in the cache
 TILE_CACHE_LIMIT = 40


:new: Add specs for new method

:new: Add specs for new method

--- spec/package-deps-spec.coffee
+++ spec/package-deps-spec.coffee
@@ -88,3 +88,13 @@
           expect(atom.packages.activatePackage.callCount).toBe(3)
           expect(view.show.callCount).toBe(1)
           expect(view.advance.callCount).toBe(2)
+
+  describe 'helpers', ->
+
+    describe 'guessName', ->
+      Helpers = require('../lib/helpers')
+
+      it 'works for nix', ->
+        expect(Helpers.guessName('/home/steel/.atom/packages/linter/lib/main.js')).toBe('linter')
+      it 'works for windows', ->
+        expect(Helpers.guessName('C:\\Users\\Anees Iqbal\\.atom\\packages\\linter\\lib\\main.js')).toBe('linter')


GroupsInvitation: make sure there is a result

--- client/admin/lib/views/groupsinvitationtabpaneview.coffee
+++ client/admin/lib/views/groupsinvitationtabpaneview.coffee
@@ -68,7 +68,8 @@

     @getData().fetchInvitationsByStatus options, (err, results)=>
       @controller.hideLazyLoader()
-      results = results.filter (res)-> res isnt null
+      results ?= []
+      results  = results.filter (res)-> res isnt null
       if err or results.length is 0
         kd.warn err  if err
         return @controller.emit 'noItemsFound'
@@ -76,4 +77,3 @@
       @timestamp = results.last[@options.timestampField]
       @controller.instantiateListItems results
       @emit 'teasersLoaded'  if results.length is @requestLimit
-


Mask participant's names if participants count is greater than 3

--- client/ide/lib/views/tabview/ideapplicationtabview.coffee
+++ client/ide/lib/views/tabview/ideapplicationtabview.coffee
@@ -46,7 +46,7 @@
     { ace } = aceView
     file    = ace.getData()

-    content = "
Your changes will be lost if you don't save them.
"
+    content = "Your changes will be lost if you don't save them. "

     { frontApp } = kd.singletons.appManager

@@ -54,13 +54,21 @@
       participants = frontApp.getWatchingMeParticipantsList()

       if participants.length
-        content += "
Also #{participants.join(', ')} maybe made changes here?
"
+
+        more = ""
+        if participants.length > 3
+          more = " and #{participants.length - 3} others"
+
+        content += """
+          Also #{(participants.slice(0,3).map (p) -> '@'+p+'').join(', ')}
+          #{more} may have some changes here.
+        """

     modal = new KDModalView
       width         : 620
       cssClass      : "modal-with-text"
       title         : "Do you want to save your changes?"
-      content       : content
+      content       : "
#{content}
"
       overlay       : yes
       buttons       :
         "SaveClose" :


No dictionaries on Windows CI

No dictionaries on Windows CI

--- spec/spellchecker-spec.coffee
+++ spec/spellchecker-spec.coffee
@@ -24,7 +24,10 @@
     it "returns an array of string dictionary names", ->
       dictionaries = SpellChecker.getAvailableDictionaries()
       expect(Array.isArray(dictionaries)).toBe true
-      expect(dictionaries.length).toBeGreaterThan 0
+
+      # Dictionaries do not appear to be available on AppVeyor
+      unless process.platform is 'win32' and process.env.CI
+        expect(dictionaries.length).toBeGreaterThan 0

       for dictionary in dictionaries.length
         expect(typeof dictionary).toBe 'string'


Fix missed update to new scroll system

Fix missed update to new scroll system

--- resources/assets/coffee/forum.coffee
+++ resources/assets/coffee/forum.coffee
@@ -99,8 +99,7 @@
   jumpTo: (postN) =>
     $post = $(".js-forum-post[data-post-position='#{postN}']")
     if $post.length
-      postId = $post.attr('data-post-id')
-      window.scrollTo 0, $("#forum-post-#{postId}").offset().top
+      @scrollTo $post.attr('data-post-id')
     else
       Turbolinks.visit("#{document.location.pathname}?n=#{postN}")


Add test specs for remote file paths

Add test specs for remote file paths

--- spec/built-in-tiles-spec.coffee
+++ spec/built-in-tiles-spec.coffee
@@ -47,6 +47,24 @@

         runs ->
           expect(fileInfo.currentPath.textContent).toBe 'sample.txt'
+
+    describe "when associated with remote file path", ->
+      [remotePath] = []
+
+      beforeEach ->
+        remotePath = 'remote://server:123/folder/remote_file.txt'
+        jasmine.attachToDOM(workspaceElement)
+        dummyView.getPath = -> remotePath
+        atom.workspace.getActivePane().activateItem(dummyView)
+
+      it "updates the path in the status bar", ->
+        # The remote path isn't relativized in the test because no remote directory provider is registered.
+        expect(fileInfo.currentPath.textContent).toBe remotePath
+        expect(fileInfo.currentPath).toBeVisible()
+
+      it "when the path is clicked", ->
+        fileInfo.currentPath.click()
+        expect(atom.clipboard.read()).toBe '/folder/remote_file.txt'

     describe "when buffer's path is clicked", ->
       it "copies the absolute path into the clipboard if available", ->


Update arg parsing to be more robust.

Update arg parsing to be more robust.

--- src/cli.coffee
+++ src/cli.coffee
@@ -1,3 +1,7 @@
+exec  =  require 'executive'
+server = require './server'
+utils =  require './utils'
+
 error = (message) ->
   console.error message
   process.exit 1
@@ -29,6 +33,7 @@
   browser:    false
   checkLeaks: false
   compilers:  []
+  files:      []
   globals:    []
   host:       'localhost'
   port:       8080
@@ -58,16 +63,20 @@
     when '--recursive'
       opts.recursive = true
     else
+      error 'Unrecognized option' if opt.charAt(0) is '-'
       opts.files.push opt

-server = (require './server') opts
-server.listen opts.port, ->
-  console.log "mocha-http running on port :#{opts.port}"
+error 'No test files specified' unless opts.files.length

-if opts.browser
-  exec = require 'executive'
-  switch os.platform()
-    when 'darwin'
-      exec "open http://#{opts.host}:#{opts.port}"
-    when 'linux'
-      exec "xdg-open http://#{opts.host}:#{opts.port}"
+utils.findFiles opts.files, (err, files) ->
+  error err if err?
+
+  (server.createServer files, opts).listen opts.port, ->
+    console.log "mocha-http running on port :#{opts.port}"
+
+  if opts.browser
+    switch os.platform()
+      when 'darwin'
+        exec "open http://#{opts.host}:#{opts.port}"
+      when 'linux'
+        exec "xdg-open http://#{opts.host}:#{opts.port}"


:memo: to instead of of

:memo: to instead of of

--- src/cli.coffee
+++ src/cli.coffee
@@ -13,7 +13,7 @@

     Output the syntax highlighted HTML for a file.

-    If no file is specified then the text of highlight is read from standard in.
+    If no file is specified then the text to highlight is read from standard in.
   """

   if cli.argv.help


Minor textual fixes

Minor textual fixes

--- src/cli.coffee
+++ src/cli.coffee
@@ -103,13 +103,13 @@
       }
       {
         name: "password"
-        message: "Password at Versal.com:"
+        message: "Password:"
         required: true
         hidden: true
       }
     ]

-    console.log 'Enter your Versal credentials to sign in:'
+    console.log 'Enter your Versal.com credentials to sign in:'
     prompt.get promptParams, callback

 command = argv._.shift() || 'help'


avoid some weird short-circuiting bug in the Adobe ESTK JS engine

--- AI2ASS.coffee
+++ AI2ASS.coffee
@@ -140,7 +140,7 @@
       if not @pathCnt?
         @pathCnt = countPathItems obj

-      unless obj.hidden or clip? and !clip.isVisible
+      if !obj.hidden and (not clip? or clip.isVisible)
         opacity = if obj.opacity? then opacity * obj.opacity/100 else 100

         switch obj.typename


add relativeFilePath and findRoot to formatDevDepsExecPath

--- lib/linter-js-standard.coffee
+++ lib/linter-js-standard.coffee
@@ -6,6 +6,7 @@
 pkgConfig = require 'pkg-config'
 binPath = require './bin-path.coffee'
 minimatch = require 'minimatch'
+findRoot = require 'find-root'

 class LinterJsStandard extends Linter

@@ -76,6 +77,15 @@
     # Default value
     execPath = false

+    # This is the absolute path
+    # of the project path relative
+    # to the package.json
+    projectPath = findRoot(@filePath)
+
+    # Get relative path of the filePath
+    relativeFilePath = @filePath.replace(projectPath, '')
+    relativeFilePath = relativeFilePath.substring(1)
+
     if devDeps and (devDeps.standard or devDeps.semistandard)
       if devDeps.standard
         # Set execPath to standard bin
@@ -89,12 +99,11 @@

         # If ignore glob patterns are present
         if standardOpts.ignore
-          relativeFilePath = '' ## TODO get relative file path
           ignoreGlobPatterns = []
           ignoreGlobPatterns.concat standardOpts.ignore

           testGlobPatterns = ignoreGlobPatterns.some (pattern) ->
-            minimatch relativeFilePath pattern
+            return minimatch(relativeFilePath, pattern)

           if testGlobPatterns
             execPath = false
@@ -117,12 +126,11 @@

         # If ignore glob patterns are present
         if semistandardOpts.ignore
-          relativeFilePath = '' ## TODO get relative file path
           ignoreGlobPatterns = []
           ignoreGlobPatterns.concat semistandardOpts.ignore

           testGlobPatterns = ignoreGlobPatterns.some (pattern) ->
-            minimatch relativeFilePath pattern
+            return minimatch(relativeFilePath, pattern)

           if testGlobPatterns
             execPath = false


Glue artwork saves relation onto the User

--- models/mixins/relations/user.coffee
+++ models/mixins/relations/user.coffee
@@ -9,6 +9,7 @@
     CollectorProfile = require '../../collector_profile.coffee'
     Location = require '../../location.coffee'
     CreditCards = require '../../../collections/credit_cards.coffee'
+    SavedArtworks = require '../../../collections/saved_artworks.coffee'

     collectorProfile = new CollectorProfile

@@ -25,9 +26,12 @@

     creditCards = new CreditCards

+    savedArtworks = new SavedArtworks
+
     @__related__ =
       collectorProfile: collectorProfile
       account: account
       location: location
       authentications: authentications
       creditCards: creditCards
+      savedArtworks: savedArtworks


[refactor] remove select line functional

--- lib/node-debugger-view.coffee
+++ lib/node-debugger-view.coffee
@@ -21,8 +21,6 @@
     @scripts = debuggerContext.scripts
     @scripts.on 'break', (script, line) =>
       editorUtil.jumpToFile(script, line)
-
-    atom.workspaceView.on "mousedown", ".line-number", @selectLine

   serialize: ->

@@ -55,15 +53,3 @@
         enabled: true
       .then (breakpoint) ->
         # do nothing
-
-  selectLine: (e) ->
-    if e.which != 3
-      return;
-
-    activeEditor = atom.workspace.getActiveEditor()
-    row = parseInt(e.target.getAttribute "data-buffer-row", 10)
-
-    activeEditor.setCursorBufferPosition {
-    	row: row,
-    	column: activeEditor.getCursorBufferPosition().column
-    }


small fix for Google Maps internal attribute change

--- src/GoogleMapsOverlaySvg.coffee
+++ src/GoogleMapsOverlaySvg.coffee
@@ -55,7 +55,7 @@
   onMouseMove: (point) -> # override

   convertMouseCoord: (event) ->   # returns [point, latLon]
-    wkTrans= @dragDiv.style['-webkit-transform']
+    wkTrans= @dragDiv.style['transform']
     if wkTrans? && (re = wkTrans.match RE_MATRIX)?
       dx = parseInt re[1]
       dy = parseInt re[2]


Silence npm when searching

Silence npm when searching

--- src/cli/plugin.coffee
+++ src/cli/plugin.coffee
@@ -64,7 +64,7 @@
 fetchListing = (callback) ->
   async.waterfall [
     (callback) -> npm.load {logstream: new NpmAdapter(logger)}, callback
-    (_, callback) -> npm.search 'wintersmith', callback
+    (_, callback) -> npm.commands.search 'wintersmith', true, 60, callback
     (result, callback) ->
       plugins = (value for key, value of result).filter(isPlugin)
       updated = Date.now()
@@ -82,6 +82,7 @@
     if exists
       readJSON listFile, callback
     else
+      logger.info 'fetching listing for the first time... hang on'
       fetchListing (error, list) ->
         list?._needsSave = true
         callback error, list


fire a sig when emailing

fire a sig when emailing

--- library/membrane/emailer.coffee
+++ library/membrane/emailer.coffee
@@ -101,9 +101,12 @@
     # is asynchronously wired in, so consult with `async` package.
     # Please be sure invoke the `next` arg to proceed, if relevant.
     instance: (kernel, service, next) ->
-        return next undefined if _.has service, "emailer"
+        located = try _.has service, "emailer"
+        return next undefined if located is yes
+        notify = (seq) -> service.emit "email", seq...
         define = -> Object.defineProperty arguments...
-        @email = -> service.emailer.sendMail arguments...
+        sender = -> service.emailer.sendMail arguments...
+        @email = -> notify arguments; sender arguments...
         mkp = (prop) -> define service, "emailer", prop
         dap = -> mkp arguments...; next(); return this
         dap enumerable: yes, configurable: no, get: ->


reorder tasks for a better fit

reorder tasks for a better fit

--- library/nucleus/cakefile.coffee
+++ library/nucleus/cakefile.coffee
@@ -64,6 +64,62 @@
     option "-g", "--git-hub-pages", "Publish documents to GitHub pages"
     option "-n", "--clean-modules", "Remove node_modules during cleanup"

+    # This is one of the major tasks in this Cakefile, it implements
+    # the cleanup of everything that could have been generated by the
+    # build system; such as documentation, compiled JavaScript artifact,
+    # and every other piece of generated data that the system knows of.
+    task "cleanup", "remove everything generated by build", (options) ->
+        knm = "clean-modules" of options or Object()
+        modules = options.modules or DEFAULT_MODULES
+        artifact = options.artifact or DEFAULT_ARTIFACT
+        documents = options.documents or DEFAULT_DOCUMENTS
+        removing = "Removing everything under %s".yellow
+        note = (path) -> logger.warn removing, path
+        note artifact; rmdirSyncRecursive artifact, yes
+        note documents; rmdirSyncRecursive documents, yes
+        (note modules; rmdirSyncRecursive modules, yes) if knm
+        logger.info "Finished cleaning everything up".green
+
+    # This is one of the major tasks in this Cakefile, it implements
+    # the generation of the documentation for the library, using the
+    # Groc documentation tool. The Groc depends on Pygments being set
+    # in place, before running. Takes some minor options via CLI call.
+    task "documents", "generate the library documentation", (options) ->
+        library = options.library or DEFAULT_LIBRARY
+        documents = options.documents or DEFAULT_DOCUMENTS
+        [pattern, index] = ["#{library}/**/*.coffee", "README.md"]
+        parameters = [pattern, "Cakefile", index, "-o", documents]
+        parameters.push "--github" if g = "git-hub-pages" of options
+        logger.info "Publishing docs to GitHub pages".yellow if g
+        assert _.isObject generator = spawn "groc", parameters
+        assert _.isObject generator.stdout.pipe process.stdout
+        assert _.isObject generator.stderr.pipe process.stderr
+        assert _.isObject generator.on "exit", (status) ->
+            failure = "Failed to generate documentation".red
+            success = "Generated documentation successfuly".green
+            logger.error failure if status isnt 0
+            logger.info success if status is 0
+
+    # This is one of the major tasks in this Cakefile, it implements
+    # the compilatation of the library source code from CoffeeScript
+    # to JavaScript, taking into account the supplied options or the
+    # assumed defaults if the options are not supplied via CLI call.
+    task "compile", "compile CoffeeScript into JavaScript", (options) ->
+        library = options.library or DEFAULT_LIBRARY
+        artifact = options.artifact or DEFAULT_ARTIFACT
+        parameters = ["-c", "-o", artifact, library]
+        parameters.unshift "-w" if options.watch?
+        watching = "Watching the %s directory".blue
+        logger.info watching, library if options.watch?
+        assert _.isObject compiler = spawn "coffee", parameters
+        assert _.isObject compiler.stdout.pipe process.stdout
+        assert _.isObject compiler.stderr.pipe process.stderr
+        assert _.isObject compiler.on "exit", (status) ->
+            failure = "Failed to compile library".red
+            success = "Compiled library successfuly".green
+            logger.error failure if status isnt 0
+            logger.info success if status is 0
+
     # This task launches an instance of application where this task
     # is invoked at. It should be either an application build within
     # the framework or the framework itself (it can be launched all
@@ -126,59 +182,3 @@
         assert _.isObject(compiled), "invalid library"
         conf = new Object master: no, instance: yes
         granite.cachedKernel(library).bootstrap conf
-
-    # This is one of the major tasks in this Cakefile, it implements
-    # the cleanup of everything that could have been generated by the
-    # build system; such as documentation, compiled JavaScript artifact,
-    # and every other piece of generated data that the system knows of.
-    task "cleanup", "remove everything generated by build", (options) ->
-        knm = "clean-modules" of options or Object()
-        modules = options.modules or DEFAULT_MODULES
-        artifact = options.artifact or DEFAULT_ARTIFACT
-        documents = options.documents or DEFAULT_DOCUMENTS
-        removing = "Removing everything under %s".yellow
-        note = (path) -> logger.warn removing, path
-        note artifact; rmdirSyncRecursive artifact, yes
-        note documents; rmdirSyncRecursive documents, yes
-        (note modules; rmdirSyncRecursive modules, yes) if knm
-        logger.info "Finished cleaning everything up".green
-
-    # This is one of the major tasks in this Cakefile, it implements
-    # the generation of the documentation for the library, using the
-    # Groc documentation tool. The Groc depends on Pygments being set
-    # in place, before running. Takes some minor options via CLI call.
-    task "documents", "generate the library documentation", (options) ->
-        library = options.library or DEFAULT_LIBRARY
-        documents = options.documents or DEFAULT_DOCUMENTS
-        [pattern, index] = ["#{library}/**/*.coffee", "README.md"]
-        parameters = [pattern, "Cakefile", index, "-o", documents]
-        parameters.push "--github" if g = "git-hub-pages" of options
-        logger.info "Publishing docs to GitHub pages".yellow if g
-        assert _.isObject generator = spawn "groc", parameters
-        assert _.isObject generator.stdout.pipe process.stdout
-        assert _.isObject generator.stderr.pipe process.stderr
-        assert _.isObject generator.on "exit", (status) ->
-            failure = "Failed to generate documentation".red
-            success = "Generated documentation successfuly".green
-            logger.error failure if status isnt 0
-            logger.info success if status is 0
-
-    # This is one of the major tasks in this Cakefile, it implements
-    # the compilatation of the library source code from CoffeeScript
-    # to JavaScript, taking into account the supplied options or the
-    # assumed defaults if the options are not supplied via CLI call.
-    task "compile", "compile CoffeeScript into JavaScript", (options) ->
-        library = options.library or DEFAULT_LIBRARY
-        artifact = options.artifact or DEFAULT_ARTIFACT
-        parameters = ["-c", "-o", artifact, library]
-        parameters.unshift "-w" if options.watch?
-        watching = "Watching the %s directory".blue
-        logger.info watching, library if options.watch?
-        assert _.isObject compiler = spawn "coffee", parameters
-        assert _.isObject compiler.stdout.pipe process.stdout
-        assert _.isObject compiler.stderr.pipe process.stderr
-        assert _.isObject compiler.on "exit", (status) ->
-            failure = "Failed to compile library".red
-            success = "Compiled library successfuly".green
-            logger.error failure if status isnt 0
-            logger.info success if status is 0