Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oltruong committed Dec 27, 2017
1 parent 963072e commit 9b2c0b0
Show file tree
Hide file tree
Showing 6 changed files with 1,257 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
package-lock.json
yarn.lock
*.tgz
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.travis.yml
.editorconfig
node_modules
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ deploy:
tags: true
node_js: 'node'
- provider: releases
skip_cleanup: true
api_key:
secure: UQ710bDILz7B+GKtlFNY/u4jgccy+m2W+ZevAFGzsTedxAMybR6HtOCForrl5G2jUduyirCYR5u10COI/E7qrwDM/aXhC6jrCiHsb4Syhbn3S5F+sLOpiSCRfb++JGbs5urLY8JtOMDyxsn6XYiOHnx8A4cVI78PXcCotC5YZz7WPYPuT1w23qcHC6XFdSuAsJ+khYHVeXxjytmW7uYF6AtuRIwj+H3g+xzUVdUYF+L3T95nQw+0Q3ADlHJpJUUo+Jvp87e2ljYhzORQWKJ35/t3I0eR3VNIAQ71W5qkW0e/bOoE1Zd/zKxx7z8yDLCXLBrUDz/1QtzDZBn17JwsJlAOxTAIvo/kdQj8xepl0vCBFKUqF+FP8aqvZmxvAv05WKskn7DZ2z17CncizLe8T4xoGnXFPbdQGya7dg3Njw0+EKByVWfk24qCcH8i7J2NLH3yEeuTWiyMLbJRYxSOa6U34Oc5ODLp6lsWFQWkZWcd1AGNu5WsK9iMnR8i5BwFE/owV1aHaHK3Nmw6vfL9oPuS+dLoIhLnRxnopHksgp2AAHKcI/nLWvZ3HXVtzS+4eAhZwC2tJHhGlBJdnXuIEqyi835OYoZaT3NcQDWAhMAxm1/uKMf23U0QK4YUm76BqxWFBbNcCYxxJ9Ao1yFJj7RT1RhYw18fk9kHA4i/kss=
file: hubot-gitlab-connector-0.0.3.tgz
file: hubot-gitlab-connector-0.0.5.tgz
on:
repo: oltruong/hubot-gitlab-connector
tags: true
Expand Down
6 changes: 3 additions & 3 deletions src/gitlab-connector.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ getProjects = (gitlabClient, res, command) ->
return
data = JSON.parse body
project_info = buildListInfo(data,formatProject)
res.reply "#{data.length} projects found matching name #{searchName}" + '\n' + project_info.join('\n\n')
res.reply "#{data.length} projects found matching name #{searchName}" + '\n' + project_info.join('\n\n\n')

formatProject = (project) ->
"#{project.name}, id:#{project.id}" + '\n' + "#{project.description}"+ '\n' + " web url: #{project.web_url}, group: #{project.namespace.name}, last activity: #{project.last_activity_at}"
"- #{project.name}, id:#{project.id}" + '\n' + " #{project.description}"+ '\n' + " web url: #{project.web_url}, group: #{project.namespace.name}, last activity: #{project.last_activity_at}"


getBranches = (gitlabClient, res, command) ->
Expand All @@ -156,7 +156,7 @@ buildListInfo = (data, callback) ->
return list

formatBranch = (branch) ->
"#{branch.name}" + '\n' + " last commit \"#{branch.commit.short_id}\", title \"#{branch.commit.title}\" by \"#{branch.commit.author_name}\" created at \"#{branch.commit.created_at}\""
"- #{branch.name}" + '\n' + " last commit \"#{branch.commit.short_id}\", title \"#{branch.commit.title}\" by \"#{branch.commit.author_name}\" created at \"#{branch.commit.created_at}\""


getVersion = (gitlabClient, res) ->
Expand Down
4 changes: 2 additions & 2 deletions test/gitlab-connector-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe 'gitlab branches', ->
expect(@room.messages).to.eql [
['alice', '@hubot gitlab branches 123']
['hubot',
'@alice 2 branches found\ndevelop\n last commit \"c0e0062e\", title \"my commit\" by \"John Doe\" created at \"2017-12-13T10:03:59.000+01:00\"\n\nmaster\n last commit \"c0e0062f\", title \"my first commit\" by \"Henry Doe\" created at \"2017-12-01T10:03:59.000+01:00\"']
'@alice 2 branches found\n- develop\n last commit \"c0e0062e\", title \"my commit\" by \"John Doe\" created at \"2017-12-13T10:03:59.000+01:00\"\n\n- master\n last commit \"c0e0062f\", title \"my first commit\" by \"Henry Doe\" created at \"2017-12-01T10:03:59.000+01:00\"']
]

describe 'gitlab project', ->
Expand All @@ -115,7 +115,7 @@ describe 'gitlab project', ->
expect(@room.messages).to.eql [
['alice', '@hubot gitlab projects toto']
['hubot',
'@alice 2 projects found matching name toto\ntoto, id:123\nWonderful project\n web url: http://example.com/toto/toto-client, group: totogroup, last activity: 2017-12-07T13:48:40.953Z\n\ntoto2, id:246\nWonderful project returns\n web url: http://example.com/toto/toto-client2, group: totogroup, last activity: 2017-12-09T13:48:40.953Z']
'@alice 2 projects found matching name toto\n- toto, id:123\n Wonderful project\n web url: http://example.com/toto/toto-client, group: totogroup, last activity: 2017-12-07T13:48:40.953Z\n\n\n- toto2, id:246\n Wonderful project returns\n web url: http://example.com/toto/toto-client2, group: totogroup, last activity: 2017-12-09T13:48:40.953Z']
]

describe 'gitlab-connector commands without http connection', ->
Expand Down
Loading

0 comments on commit 9b2c0b0

Please sign in to comment.