Skip to content

Commit

Permalink
Inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny Arehart committed Mar 19, 2018
0 parents commit 35fb293
Show file tree
Hide file tree
Showing 10 changed files with 625 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": [
"prettier"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"prettier"
],
"env": {
"commonjs": true,
"es6": true,
"mocha": true,
"node": true
},
"rules": {
"indent": 0,
"max-len": 0,
"prettier/prettier": [
"error",
{
"semi": false,
"tabWidth": 2,
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 140
}
]
}
}
65 changes: 65 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
### OSX and editor cruft###
.DS_Store
.AppleDouble
.LSOverride
Thumbs.db
.cache
.project
.pydevproject
.settings
.tmproj
*.esproj
nbproject
*.sublime-project
*.sublime-workspace
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.iml


# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.rej
*.swo
*.swp
*.vi
*~
*.psd

# Basics
*.py[cod]
__pycache__

# Logs
*.log
pip-log.txt


# Translations
*.mo
*.pot

# Pycharm
.idea

# Vim

*~
*.swp
*.swo

# npm
node_modules/

# Compass
.sass-cache


!.gitkeep

# for some reson zsh has started putting these everywhere
.oh-my-zsh

2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.prettierrc
.package-lock.json
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
##### RED Interactive Agency - Ad Technology

Contributing
===============

We are open to contributions from everyone. However, we are employed & funded by RED Interactive,
so please keep in mind that our decisioning must be centric to that business.

The goal of this project is to maintain a light-weight, fast-loading, flexible, and robust
framework for building interactive banners.

By participating in this project, you agree to abide by the thoughtbot [code of conduct].

[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct

We expect everyone to follow the code of conduct anywhere in this project codebases,
issue trackers, chatrooms, and mailing lists.

## Contributing Code

As our project matures, we will provide more notes in regard to Contributing. For now,
fork and assign pull requests to one of the core members.
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MIT License

Copyright (c) 2017 FF0000 Ad Tech

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

License applies to all files in this repository not otherwise licensed.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##### RED Interactive Agency - Ad Technology

Creative Server Plugin - Bulk Compile
===============


15 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const argv = require('minimist')(process.argv.slice(2))
const compiler = require('./lib/compiler.js')

const debug = require('debug')
var log = debug('cs-plugin-bulk-compile')

global.api = `http://${argv.api}`

switch (argv.cmd) {
case 'bulk':
const targets = JSON.parse(argv.targets)
log(targets)
compiler.compileOnInterval(targets)
break
}
24 changes: 24 additions & 0 deletions lib/compiler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const fs = require('fs')
const path = require('path')
const request = require('request')

const debug = require('debug')
var log = debug('cs-plugin-bulk-compile:compiler')

function compileOnInterval(targets) {
let delay = 0
Object.keys(targets).forEach(target => {
;(target => {
log(target)
setTimeout(() => {
const apiCmd = `${global.api}/api/compile-start/${target}`
log(apiCmd)
request(apiCmd)
}, delay)
})(target)
delay += 1000
})
}
module.exports = {
compileOnInterval
}
Loading

0 comments on commit 35fb293

Please sign in to comment.