hubot-deploy
Version:
hubot script for GitHub Flow
38 lines (30 loc) • 1.09 kB
text/coffeescript
Url = require "url"
Path = require "path"
###########################################################################
class GitHubApi
constructor: (, ) ->
=
= Url.parse()
= .host
apiUri: ->
(? and ['github_api']) or
process.env.HUBOT_GITHUB_API or
'https://api.github.com'
apiToken: ->
(? and ['github_token']) or
(? and ) or
process.env.HUBOT_GITHUB_TOKEN
filterPaths: ->
newArr = .filter (word) -> word isnt ""
pathParts: ->
.path.split("/")
path: (suffix) ->
if suffix?.length > 0
parts =
parts.push(suffix)
"/#{parts.join('/')}"
else
.path
exports.Api = GitHubApi
exports.Deployment = require(Path.join(__dirname, "api", "deployment")).Deployment
exports.DeploymentStatus = require(Path.join(__dirname, "api", "deployment_status")).DeploymentStatus