all files / app/ helpers.coffee

0% Statements 0/10
0% Branches 0/2
0% Functions 0/4
0% Lines 0/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                                       
Github = require 'github'
_      = require 'lodash'
 
class Helpers
  extractSentinelName: (appName) =>
    _.kebabCase appName
 
  githubUserInfo: (user, callback) =>
    github = new Github
 
    unless _.isEmpty process.env.GITHUB_TOKEN
      github.authenticate
        type: 'oauth'
        token: process.env.GITHUB_TOKEN
 
    github.users.getForUser {user}, (error, user) =>
      callback error, user
 
module.exports = new Helpers