Skip to content
This repository was archived by the owner on Oct 24, 2019. It is now read-only.

Commit 39cbeb7

Browse files
committed
Merge branch 'develop'
* develop: (34 commits) v1.4.0 Removed sourcegraph badges Reverted version number change Added project search functionality Added Steve Norman to Contributors list. Added ability to get users keys Fixed loading all users and groups by getting all pages. Added Felix Fichte to Contributors list. Drop 0.8 from Travis, add 0.12. Containers *are* cool Travis. Update ProjectMilestones.coffee Update ProjectMilestones.coffee showcase new option add possibility to pass params to list milestones Added functionality to remove projects Use headers for PRIVATE-TOKEN Fix broken link for HTTP api Use cake and mocha under node_modules Added Connor Weng to Contributors list. Update LICENSE.md ...
2 parents d338c9a + 6ff5fa6 commit 39cbeb7

40 files changed

Lines changed: 552 additions & 280 deletions

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[.*ignore]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[**.{coffee,js,json}]
13+
charset = utf-8
14+
end_of_line = lf
15+
indent_size = 2
16+
indent_style = space
17+
insert_final_newline = false
18+
trim_trailing_whitespace = true
19+
20+
[*.md]
21+
charset = utf-8
22+
end_of_line = lf
23+
insert_final_newline = true
24+
trim_trailing_whitespace = false

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
language: node_js
22
node_js:
3+
- "0.12"
34
- "0.11"
45
- "0.10"
5-
- "0.8"
6+
sudo: false
67
notifications:
78
webhooks:
89
urls:

Cakefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{spawn, exec} = require 'child_process'
22

3+
coffee = './node_modules/.bin/coffee'
4+
35
call = (command, args = [], fn = null) ->
46
exec "#{command} #{args.join(' ')}", (err, stdout, stderr) ->
57
if err?
@@ -11,14 +13,14 @@ system = (command, args) ->
1113
spawn command, args, stdio: "inherit"
1214

1315
build = (fn = null) ->
14-
call 'coffee', ['-c', '--no-header', '-o', 'lib', 'src']
15-
call 'coffee', ['-c', '--no-header', '-o', 'examples', 'examples']
16-
call 'coffee', ['-c', '--no-header', '-o', 'tests', 'tests']
16+
call coffee, ['-c', '--no-header', '-o', 'lib', 'src']
17+
call coffee, ['-c', '--no-header', '-o', 'examples', 'examples']
18+
call coffee, ['-c', '--no-header', '-o', 'tests', 'tests']
1719

1820
watch = (fn = null) ->
19-
system 'coffee', ['-w', '--no-header', '-c', '-o', 'lib', 'src']
20-
system 'coffee', ['-w', '--no-header', '-c', '-o', 'examples', 'examples']
21-
system 'coffee', ['-w', '--no-header', '-c', '-o', 'tests', 'tests']
21+
system coffee, ['-w', '--no-header', '-c', '-o', 'lib', 'src']
22+
system coffee, ['-w', '--no-header', '-c', '-o', 'examples', 'examples']
23+
system coffee, ['-w', '--no-header', '-c', '-o', 'tests', 'tests']
2224

2325
task 'watch', 'continually build the JavaScript code', ->
2426
watch ->

LICENSE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
The MIT License
2+
===============
3+
4+
Copyright (c)
5+
**2012-2015 Manfred Touron** <m@42.am> ([@moul](https://twitter.com/moul)),
6+
**2013-2015 Dave Irvine** ([@dave_irvine](https://twitter.com/dave_irvine))
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in
16+
all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
THE SOFTWARE.

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ node-gitlab
33

44
[![Build Status (Travis)](https://travis-ci.org/node-gitlab/node-gitlab.png?branch=master)](https://travis-ci.org/node-gitlab/node-gitlab)
55
[![Dependency Status](https://david-dm.org/node-gitlab/node-gitlab.png?theme=shields.io)](https://david-dm.org/node-gitlab/node-gitlab)
6-
[![authors](https://sourcegraph.com/api/repos/github.com/node-gitlab/node-gitlab/badges/authors.png)](https://sourcegraph.com/github.com/node-gitlab/node-gitlab)
7-
[![library users](https://sourcegraph.com/api/repos/github.com/node-gitlab/node-gitlab/badges/library-users.png)](https://sourcegraph.com/github.com/node-gitlab/node-gitlab)
8-
[![Total views](https://sourcegraph.com/api/repos/github.com/node-gitlab/node-gitlab/counters/views.png)](https://sourcegraph.com/github.com/node-gitlab/node-gitlab)
9-
[![Views in the last 24 hours](https://sourcegraph.com/api/repos/github.com/node-gitlab/node-gitlab/counters/views-24h.png)](https://sourcegraph.com/github.com/node-gitlab/node-gitlab)
106
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/node-gitlab/node-gitlab/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
7+
[![Code Climate](https://codeclimate.com/github/node-gitlab/node-gitlab/badges/gpa.svg)](https://codeclimate.com/github/node-gitlab/node-gitlab)
118

129
[![NPM Badge](https://nodei.co/npm/gitlab.png?downloads=true&stars=true)](https://npmjs.org/package/gitlab)
1310
--
1411

1512
[GitLab](https://github.com/gitlabhq/gitlabhq) API Nodejs library.
16-
It wraps the HTTP api library described [here](https://github.com/node-gitlab/gitlabhq/tree/master/doc/api).
13+
It wraps the HTTP api library described [here](https://github.com/gitlabhq/gitlabhq/tree/master/doc/api).
1714

1815
Maintained by [Manfred Touron](https://github.com/moul) and [Dave Irvine](https://github.com/dave-irvine)
1916

@@ -105,6 +102,10 @@ Contributors
105102
- [shaoshuai0102](https://github.com/shaoshuai0102)
106103
- [Sakesan Panjamawat](https://github.com/sakp)
107104
- [Jose Jiménez](https://github.com/jjimenezlopez)
105+
- [huhgawz](https://github.com/huhgawz)
106+
- [Connor Weng](https://github.com/ConnorWeng)
107+
- [Felix Fichte](https://github.com/spruce)
108+
- [Steve Norman](https://github.com/stevenorman)
108109

109110
License
110111
-------
@@ -115,7 +116,27 @@ MIT
115116
Changelog
116117
=========
117118

118-
1.3.0 (2015-02-09)
119+
[1.4.0](https://github.com/node-gitlab/node-gitlab/tree/v1.4.0) (2015-08-11)
120+
------------------
121+
122+
- Now using headers for PRIVATE-TOKEN
123+
- Add `Groups.create`, `Groups.addProject` and `Groups.search` methods
124+
- Add `Projects.remove` and `Projects.search` methods
125+
- Add `UserKeys` resource
126+
- Add `Users.search` method
127+
- Rename `ProjectMielstones.get` to `ProjectMilestones.all`
128+
- Handling pagination on multiple new `.all()` methods
129+
- Various stability and performance fixes
130+
131+
Thanks to [@huhgawz](https://github.com/huhgawz),
132+
[@ConnorWeng](https://github.com/ConnorWeng), [@langma](https://github.com/langma),
133+
[@spruce](https://github.com/spruce), [@stevenorman](https://github.com/stevenorman)
134+
and [@nogs](https://github.com/nogs)
135+
136+
137+
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.3.0...develop)
138+
139+
[1.3.0](https://github.com/node-gitlab/node-gitlab/tree/v1.3.0) (2015-02-09)
119140
------------------
120141

121142
- Now handling notes
@@ -125,7 +146,7 @@ Changelog
125146
- Added tests
126147
- Code cleanup and various small improvements
127148

128-
1.2.0 (2014-12-24)
149+
[1.2.0](https://github.com/node-gitlab/node-gitlab/tree/v1.2.0) (2014-12-24)
129150
------------------
130151

131152
- Switched to new organization, some urls changed
@@ -134,16 +155,21 @@ Changelog
134155
- Changed AddHook parameters
135156
- Happy Christmas
136157

137-
1.1.0 (2014-11-04)
158+
[1.1.0](https://github.com/node-gitlab/node-gitlab/tree/v1.1.0) (2014-11-04)
138159
------------------
139160

140161
- Added project branch support
141162
- Improved compatibility with API
142163
- Improved global error handling
143164
- Rebuilt javascript using latest Coffee-Script
144165

145-
1.0.0 (2014-08-19)
166+
[1.0.0](https://github.com/node-gitlab/node-gitlab/tree/v1.0.0) (2014-08-19)
146167
------------------
147168

148169
- Not fully stable, need more tests
149170
- Now we have a CHANGELOG
171+
172+
[POC](https://github.com/node-gitlab/node-gitlab/tree/e7a5eedea4c27aed8bd567a3c455ec311b915d60) (2012-12-11)
173+
----------------
174+
175+
- POC

examples/list-projects.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
});
1414

1515
gitlab.projects.all(function(projects) {
16-
var project, _i, _len, _results;
17-
_results = [];
18-
for (_i = 0, _len = projects.length; _i < _len; _i++) {
19-
project = projects[_i];
20-
_results.push(console.log("#" + project.id + ": " + project.name + ", path: " + project.path + ", default_branch: " + project.default_branch + ", private: " + project["private"] + ", owner: " + project.owner.name + " (" + project.owner.email + "), date: " + project.created_at));
16+
var i, len, project, results;
17+
results = [];
18+
for (i = 0, len = projects.length; i < len; i++) {
19+
project = projects[i];
20+
results.push(console.log("#" + project.id + ": " + project.name + ", path: " + project.path + ", default_branch: " + project.default_branch + ", private: " + project["private"] + ", owner: " + project.owner.name + " (" + project.owner.email + "), date: " + project.created_at));
2121
}
22-
return _results;
22+
return results;
2323
});
2424

2525
}).call(this);

examples/list-users.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
});
1414

1515
gitlab.users.all(function(users) {
16-
var user, _i, _len, _results;
17-
_results = [];
18-
for (_i = 0, _len = users.length; _i < _len; _i++) {
19-
user = users[_i];
20-
_results.push(console.log("#" + user.id + ": " + user.email + ", " + user.name + ", " + user.created_at));
16+
var i, len, results, user;
17+
results = [];
18+
for (i = 0, len = users.length; i < len; i++) {
19+
user = users[i];
20+
results.push(console.log("#" + user.id + ": " + user.email + ", " + user.name + ", " + user.created_at));
2121
}
22-
return _results;
22+
return results;
2323
});
2424

2525
}).call(this);

examples/reset-hooks.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
});
1414

1515
gitlab.projects.all(function(projects) {
16-
var _i, _len, _project, _results;
17-
_results = [];
18-
for (_i = 0, _len = projects.length; _i < _len; _i++) {
19-
_project = projects[_i];
20-
_results.push((function() {
16+
var _project, i, len, results;
17+
results = [];
18+
for (i = 0, len = projects.length; i < len; i++) {
19+
_project = projects[i];
20+
results.push((function() {
2121
var project;
2222
project = _project;
2323
return gitlab.projects.hooks.list(project.id, function(hooks) {
24-
var hook, url, _j, _len1;
24+
var hook, j, len1, url;
2525
url = "" + credentials.service_hook_base + project.path_with_namespace;
2626
if (hooks.length > 1) {
2727
return console.log(url + " too much hooks");
2828
} else if (hooks.length === 1) {
29-
for (_j = 0, _len1 = hooks.length; _j < _len1; _j++) {
30-
hook = hooks[_j];
29+
for (j = 0, len1 = hooks.length; j < len1; j++) {
30+
hook = hooks[j];
3131
if (hook.url !== url) {
3232
gitlab.projects.hooks.remove(project.id, hook.id, function(ret) {
3333
return console.log(ret);
@@ -43,7 +43,7 @@
4343
});
4444
})());
4545
}
46-
return _results;
46+
return results;
4747
});
4848

4949
}).call(this);

examples/show-project.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ gitlab.projects.members.list projectId, (members) ->
2323
console.log ""
2424
console.log "=== Members ==="
2525
console.log members
26+
27+
gitlab.projects.milestones.list projectId, {per_page: 100}, (milestones) ->
28+
console.log ""
29+
console.log "=== Milestones ==="
30+
console.log milestones

lib/ApiBase.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
(function() {
22
var debug,
3-
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
3+
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
44

55
debug = require('debug')('gitlab:ApiBase');
66

77
module.exports.ApiBase = (function() {
8-
function ApiBase(_at_options) {
9-
this.options = _at_options;
10-
this.init = __bind(this.init, this);
11-
this.handleOptions = __bind(this.handleOptions, this);
8+
function ApiBase(options) {
9+
this.options = options;
10+
this.init = bind(this.init, this);
11+
this.handleOptions = bind(this.handleOptions, this);
1212
this.handleOptions();
1313
this.init();
1414
debug("constructor()");
1515
}
1616

1717
ApiBase.prototype.handleOptions = function() {
18-
var _base;
19-
if ((_base = this.options).verbose == null) {
20-
_base.verbose = false;
18+
var base;
19+
if ((base = this.options).verbose == null) {
20+
base.verbose = false;
2121
}
2222
return debug("handleOptions()");
2323
};

0 commit comments

Comments
 (0)