 path = require 'path'
+util = require 'util'
 fs = require 'fs-plus'
 chokidar = require 'chokidar'
 globToRegexp = require 'glob-to-regexp'

      devMode = atom.inDevMode()
      clearTimeout @functionPoll
      @functionConditions = []
      for btn in toolBarButtons

        if ( btn.hide? && @condition(btn.hide) ) or ( btn.show? && !@condition(btn.show) )
          continue

        continue if btn.mode and btn.mode is 'dev' and not devMode

          for val in ary
            button.element.classList.add val.trim()

        try
          if ( btn.disable? && @condition(btn.disable) ) or ( btn.enable? && !@condition(btn.enable) )
            button.setEnabled false
        catch err
          btnErrors.push "#{err.message}\n#{util.inspect(btn, depth: 4)}"

      if btnErrors.length > 0
        atom.notifications.addError 'Invalid toolbar.json', {
          detail: btnErrors.join '\n\n'
          dismissable: true
          buttons: [{
            text: 'Edit Config'
            onDidClick: => atom.workspace.open @configFilePath
          }]
        }

      @pollFunctions()

