From 90568b022196c7e829aa878f9ea6fafafd46b333 Mon Sep 17 00:00:00 2001 From: miya0001 Date: Mon, 11 Apr 2016 18:16:08 +0900 Subject: [PATCH] add gulp --- .gitignore | 3 +++ .travis.yml | 4 ++++ README.md | 16 ++++++++++++++++ gulpfile.js | 13 +++++++++++++ package.json | 8 +++++++- wapuu.csv | 4 ++-- 6 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 gulpfile.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0ef32e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log +v1 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8d4a61b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: +- '0.11' +- '0.10' diff --git a/README.md b/README.md index e69de29..108d64b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,16 @@ +# Wapuu API + +JSON API for Wapuus in the World. + +## How to Add your Wapuu + +1. Fork this repository. +2. Please add your Wapuu's information into [wapuu.csv](https://github.com/jawordpressorg/wapuu-api/blob/master/wapuu.csv). +3. Give us pull-request. + + +## Build + +``` +$ npm run build +``` diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..918b701 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,13 @@ +var gulp = require('gulp'); +var csv2json = require('gulp-csv2json'); +var rename = require('gulp-rename'); + +gulp.task('default', function () { + +var csvParseOptions = {}; //based on options specified here : http://csv.adaltas.com/parse/ + + gulp.src('wapuu.csv') + .pipe(csv2json(csvParseOptions)) + .pipe(rename({extname: '.json'})) + .pipe(gulp.dest('v1')); +}); diff --git a/package.json b/package.json index fd218d7..97e1893 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,14 @@ "description": "", "main": "index.js", "scripts": { + "build": "gulp", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", - "license": "GPLv2" + "license": "GPLv2", + "dependencies": { + "gulp": "^3.9.1", + "gulp-csv2json": "^0.2.5", + "gulp-rename": "^1.2.2" + } } diff --git a/wapuu.csv b/wapuu.csv index d61ffe7..9a082a8 100644 --- a/wapuu.csv +++ b/wapuu.csv @@ -1,2 +1,2 @@ -Name,GitHub Repository,URL,Author -Wapuu,https://github.com/jawordpressorg/wapuu,https://raw.githubusercontent.com/jawordpressorg/wapuu/gh-pages/wapuu-original/wapuu-original.png,WordPress Japanese Translation Team +id,name,github-url,wapuu-url,wapuu-mimetype,author,url +wapuu,Wapuu,https://github.com/jawordpressorg/wapuu,https://raw.githubusercontent.com/jawordpressorg/wapuu/gh-pages/wapuu-original/wapuu-original.png,image/png,WordPress Japanese Translation Team,https://ja.wordpress.org