Skip to content

Commit

Permalink
Added gulp to the mix
Browse files Browse the repository at this point in the history
  • Loading branch information
dorothyDorothy committed May 30, 2017
1 parent 260b91d commit c1cd0d3
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/vendor
/node_modules
/logs/*
!/logs/.gitkeep
composer.lock
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ language: php
php:
- 5.6
- 7.0
- hhvm

before_script:
- composer self-update
Expand Down
Empty file modified README.md
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions src/Learning.php → _src/Learning.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public function hasCheese($bool = true)
return $bool;
}


public function getCheese() {
return $this->cheese;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"autoload": {
"psr-4": {
"DorothyMolloy\\LearningProject\\": "src"
"DorothyMolloy\\LearningProject\\": "_src"
}
}
}
47 changes: 47 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
var gulp = require('gulp');

var plugins = require("gulp-load-plugins")({
pattern: ['gulp-*', 'gulp.*'],
replaceString: /\bgulp[\-.]/
});

/* --- File paths --- */
var basePaths = {
root: '_src/',
sass_source: '_src/scss/',
js_source: '_src/js/',
css_dest: 'deploy/html/css/',
js_dest: 'deploy/html/js/'
};

var appFiles = {
php: basePaths.root + '*.php'
};

/* --- gutils --- */

var gutil = require('gulp-util');
var changeEvent = function(evt) {
gutil.log('File', gutil.colors.cyan(evt.path.replace(new RegExp('/.*(?=/' + basePaths.src + ')/'), '')), 'was', gutil.colors.magenta(evt.type));
};

/* --- Composer --- */
composer = require('gulp-composer');
gulp.task('composer', function(){
composer('self-update');
});

/* --- Replace with something useful! --- */
gulp.task('thing' , function(){
console.log("now calling thing");
});


gulp.task('watch', function(){
gulp.watch(['./composer.json', appFiles.php], [ 'composer', 'thing'])
.on('change', function(evt){
changeEvent(evt);
});
});

gulp.task('default', ['composer', 'watch']);
34 changes: 34 additions & 0 deletions html/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
use DorothyMolloy\LearningProject\Learning;
require_once '../vendor/autoload.php';
?>

<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>the learning project</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--<link rel="stylesheet" href="css/main.css"> -->
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<!-- Add your site or application content here -->
<h1>The Learning Project</h1>
<p>
<?php

$learning = new Learning();
echo("what cheese? " . $learning->getCheese());
?>
</p>

</body>
</html>


Empty file added logs/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions npm_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm i gulp-composer gulp-load-plugins --save-dev
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "learningproject",
"version": "1.0",
"description": "Just for fun",
"main": "gulpfile.js",
"dependencies": {
"gulp-composer": "^1.4.2",
"gulp-load-plugins": "^1.5.0"
},
"devDependencies": {
"browser-sync": "^2.15.0",
"gulp": "^3.9.1",
"gulp-composer": "^0.4.0",
"gulp-load-plugins": "^1.5.0",
"gulp-util": "^2.2.14",
"gulp-sass": "^2.3.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "ssh://[email protected]:dorothyDorothy/learingproject.git"
},
"keywords": [
"Learning",
"climbingturn"
],
"author": "Dorothy Molloy",
"license": "ISC"
}
Empty file modified phpunit.xml
100644 → 100755
Empty file.
Empty file modified tests/LearningTest.php
100644 → 100755
Empty file.

0 comments on commit c1cd0d3

Please sign in to comment.