Skip to content

Commit

Permalink
Merge pull request #1 from enomic/master
Browse files Browse the repository at this point in the history
asdf
  • Loading branch information
ericvicenti committed Aug 20, 2015
2 parents cdd462e + f73a96c commit dc2b523
Show file tree
Hide file tree
Showing 14 changed files with 18,950 additions and 70 deletions.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
node_modules
.env
.env

# vim temporary files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

# kdiff
*.orig
62 changes: 62 additions & 0 deletions Logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
var request = require('superagent');

var gh_oauth_token = process.env.GITHUB_OAUTH_TOKEN;

var Logger = module.exports = function(options) {

// if (!options.key) throw new Error('Need OauthKey');

var logs = [];

this.log = function log() {
for (var i = 0; i < arguments.length; i++) {
logs.push(arguments[i]);
console.log(arguments[i]);
}
}

this.error = function error() {
for (var i = 0; i < arguments.length; i++) {
logs.push(arguments[i]);
console.error(arguments[i]);
}
}

this.warn = function warn() {
for (var i = 0; i < arguments.length; i++) {
logs.push(arguments[i]);
console.warn(arguments[i]);
}
}

this.save = function save(cb) {
request
.post('https://api.github.com/gists?access_token='+gh_oauth_token)
.send({
description: "Enomic dump",
public: true,
files: {
"dump.txt": {
"content": logs.join('\n')
}
}
})
.end(function (err, res) {
if (err) {
console.log(err);
return cb(err);
}

cb(null, res.body.html_url);
});

}

return this;
}

if (module === require.main) {
var logger = new Logger();
logger.log('Hello world!');
logger.save(console.log);
}
6 changes: 3 additions & 3 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This is a minimal implementation of the game. If the objectives are met, enomic

### Players
- Get node or io.js
- Fork and clone the [github repository](https://github.com/enomic/enomic)
- Fork and clone the [github repository](https://github.com/enomic/enomic), or [browse the code here](/master/).
- Install dependencies with `npm install`
- Run the app with `npm run server`
- Edit ANY of the code or rules- It's your job to accomplish the objectives!
Expand All @@ -36,7 +36,7 @@ To become a hero:
- Run `node init.js` to generate your key pair
- Introduce yourself in a PR that adds your public key to the `heroIds.txt` file

To sign code and get it deployed:
An existing Hero must then:

- Get the pull request commit hash
- Sign the hash: `node sign.js <commit_hash>`
Expand All @@ -50,4 +50,4 @@ To sign code and get it deployed:
## Current Rules & Guidelines
The rules are simple: If you can do it, it is 'legal' to do it.

For guidelines about how to play: see [Guidelines](/docs/Guidelines.md)
For guidelines about how to play: see [Guidelines](/docs/Guidelines.md)
Loading

0 comments on commit dc2b523

Please sign in to comment.