Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 1e32749

Browse files
author
grpn-bulk-nlm
committed
chore: Apply latest nlm generator
1 parent 0fd8dd3 commit 1e32749

18 files changed

+965
-453
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
/node_modules
1+
node_modules/
2+
npm-debug.log
3+
/tmp

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org

.travis.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
language: node_js
22
node_js:
3-
- 0.10
3+
- '0.10'
4+
- '4'
5+
before_install:
6+
- npm install -g npm@latest-2
7+
before_deploy:
8+
- 'git config --global user.email "[email protected]"'
9+
- 'git config --global user.name "Jan Olaf Krems"'
10+
deploy:
11+
provider: script
12+
script: ./node_modules/.bin/nlm release
13+
skip_cleanup: true
14+
'on':
15+
branch: master
16+
node: '4'

CONTRIBUTING.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<!-- Generated by generator-nlm -->
2+
3+
# Contributing
4+
5+
🎉🏅 Thanks for helping us improve this project! 🙏
6+
7+
This document outlines some of the practices we care about.
8+
If you have any questions or suggestions about the process,
9+
feel free to [open an issue](#reporting-issues)
10+
.
11+
## How Can I Contribute?
12+
13+
### Reporting Issues
14+
15+
If you find any mistakes in the docs or a bug in the code,
16+
please [open an issue in Github](https://github.com/groupon/selenium-download/issues/new) so we can look into it.
17+
You can also [create a PR](#contributing-code) fixing it yourself, or course.
18+
19+
If you report a bug, please follow these guidelines:
20+
21+
* Make sure the bug exists in the latest version.
22+
* Include instructions on how to reproduce the issue.
23+
The instructions should be as minimal as possible
24+
and answer the three big questions:
25+
1. What are the exact steps you took? This includes the exact versions of node, npm, and any packages involved.
26+
1. What result are you expecting?
27+
1. What is the actual result?
28+
29+
### Improving Documentation
30+
31+
For small documentation changes, you can use [Github's editing feature](https://help.github.com/articles/editing-files-in-another-user-s-repository/).
32+
The only thing to keep in mind is to prefix the commit message with "docs: ".
33+
The detault commit message generated by Github will lead to a failing CI build.
34+
35+
For larger updates to the documentation
36+
it might be better to follow the [instructions for contributing code below](#contributing-code).
37+
38+
### Contributing Code
39+
40+
**Note:** If you're planning on making substantial changes,
41+
please [open an issue first to discuss your idea](#reporting-issues).
42+
Otherwise you might end up investing a lot of work
43+
only to discover that it conflicts with plans the maintainers might have.
44+
45+
The general steps for creating a pull request are:
46+
47+
1. Create a branch for your change.
48+
Always start your branch from the latest `master`.
49+
We often prefix the branch name with our initials, e.g. `jk-a-change`.
50+
1. Run `npm install` to install the dependencies.
51+
1. If you're fixing a bug, be sure to write a test *first*.
52+
That way you can validate that the test actually catches the bug and doesn't pass.
53+
1. Make your changes to the code.
54+
Remember to update the tests if you add new features or change behavior.
55+
1. Run the tests via `npm test`. This will also run style checks and other validations.
56+
You might see errors about uncommitted files.
57+
This is expected until you commit your changes.
58+
1. Once you're done, `git add .` and `git commit`.
59+
Please follow the [commit message conventions](#commits--commit-messages) described below.
60+
1. Push your branch to Github & create a PR.
61+
62+
#### Code Style
63+
64+
In addition to any linting rules the project might include,
65+
a few general rules of thumb:
66+
67+
* Try to match the style of the rest of the code.
68+
* We prefer simple code that is easy to understand over terse, expressive code.
69+
* We try to structure projects by semantics instead of role.
70+
E.g. we'd rather have a `tree.js` module that contains tree traversal-related helpers
71+
than a `helpers.js` module.
72+
* Actually, if you create helpers you might want to put those into a separate package.
73+
That way it's easier to reuse them.
74+
75+
#### Commits & Commit Messages
76+
77+
Please follow the [angular commit message conventions](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines).
78+
We use an automated tool for generating releases
79+
that depends on the conventions to determine the next version and the content of the changelog.
80+
Commit messages that don't follow the conventions will cause `npm test` (and thus CI) to fail.
81+
82+
The short summary - a commit message should look like this:
83+
84+
```
85+
<type>: <subject>
86+
87+
<body>
88+
89+
<references>
90+
91+
<footer>
92+
```
93+
94+
Everything but the first line is optional.
95+
The empty lines between the different parts are required.
96+
97+
* `<type>`: One of the following:
98+
- **feat:** Introduces a new feature. This will cause the minor version to go up.
99+
- **fix:** A bug fix. Causes a patch version bump.
100+
- **docs:** Changes to the documentation.
101+
This will also cause an increase of the patch version so that the changes show up in the npm registry.
102+
- **style:** Cleanup & lint rule fixes.
103+
Note that often it's better to just amend the previous commit if it introduced lint errors.
104+
- **refactor:** Changes to the code structure without fixing bugs or adding features.
105+
- **perf:** Performance optimizations.
106+
- **test:** Fixing existing tests or adding missing ones.
107+
Just like with **style**, if you add tests to a feature you just introduced in the previous commit,
108+
consider keeping the tests and the feature in the same commit instead.
109+
- **chore:** Changes to the project setup and tools, dependency bumps, house-keeping.
110+
* `<subject>`: A [good git commit message subject](http://chris.beams.io/posts/git-commit/#limit-50).
111+
- Keep it brief. If possible the whole first line should have at most 50 characters.
112+
- Use imperative mood. "Create" instead of "creates" or "created".
113+
- No period (".") at the end.
114+
* `<body>`: Motivation for the change and any context required for understanding the choices made.
115+
Just like the subject, it should use imperative mood.
116+
* `<references>`: Any URLs relevant to the PR go here.
117+
Use one line per URL and prefix it with the kind of relationship, e.g. "Closes: " or "See: ".
118+
If you are referencing an issue in your commit body or PR description,
119+
never use `#123` but the full URL to the issue or PR you are referencing.
120+
That way the reference is easy to resolve from the git history without having to "guess" the correct link
121+
even if the commit got cherry-picked or merged into a different project.
122+
* `<footer>`: This part only applies if your commit introduces a breaking change.
123+
It's important this is present, otherwise the major version will not increase.
124+
See below for an example.
125+
126+
##### Examples
127+
128+
A feature that introduces a breaking change:
129+
130+
```
131+
feat: Support --yes CLI option
132+
133+
For existing projects all prompts can be inferred automatically.
134+
Manual confirmation for each default provides no value in that case.
135+
136+
Closes https://github.com/my/project/issues/123
137+
138+
BREAKING CHANGE: This removes support for interactive password entry.
139+
Users will have to login beforehand.
140+
```
141+
142+
A simple bug fix:
143+
144+
```
145+
fix: Handle multi-byte characters in search logic
146+
```
147+

Makefile

Lines changed: 0 additions & 35 deletions
This file was deleted.

lib/checksum.js

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,55 @@
1-
// Generated by CoffeeScript 2.0.0-beta7
2-
void function () {
3-
var createHash, fs;
4-
fs = require('fs');
5-
createHash = require('crypto').createHash;
6-
module.exports = function (filePath, checksum, callback) {
7-
var hash, stream;
8-
hash = createHash('md5');
9-
stream = fs.ReadStream(filePath);
10-
stream.on('data', function (data) {
11-
return hash.update(data);
12-
});
13-
return stream.on('end', function () {
14-
var digest, message;
15-
digest = hash.digest('base64');
16-
if (digest !== checksum) {
17-
message = 'File ' + filePath + ' did not match checksum: expected ' + checksum + ' but saw ' + digest;
18-
return callback(new Error(message));
19-
}
20-
return callback();
21-
});
22-
};
23-
}.call(this);
1+
2+
/*
3+
Copyright (c) 2014, Groupon, Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions
8+
are met:
9+
10+
Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
13+
Redistributions in binary form must reproduce the above copyright
14+
notice, this list of conditions and the following disclaimer in the
15+
documentation and/or other materials provided with the distribution.
16+
17+
Neither the name of GROUPON nor the names of its contributors may be
18+
used to endorse or promote products derived from this software without
19+
specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
27+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
*/
33+
var createHash, fs;
34+
35+
fs = require('fs');
36+
37+
createHash = require('crypto').createHash;
38+
39+
module.exports = function(filePath, checksum, callback) {
40+
var hash, stream;
41+
hash = createHash('md5');
42+
stream = fs.ReadStream(filePath);
43+
stream.on('data', function(data) {
44+
return hash.update(data);
45+
});
46+
return stream.on('end', function() {
47+
var digest, message;
48+
digest = hash.digest('base64');
49+
if (digest !== checksum) {
50+
message = "File " + filePath + " did not match checksum: expected " + checksum + " but saw " + digest;
51+
return callback(new Error(message));
52+
}
53+
return callback();
54+
});
55+
};

0 commit comments

Comments
 (0)