Closed xtoddx closed 8 years ago
Haha thought you were some random with a good suggestion, then looked closer at your avatar. :) Sounds good! Can do.
Can you share which other project had gulp-ruby-haml as a dependency?
Its an internal project. I'll paste a similar package.json here ;)
{
"name": "chickens",
"license": "UNLICENSED",
"private": true,
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-connect": "~0.11.2",
"gulp": "~3.5.2",
"gulp-util": "~2.2.14",
"gulp-concat": "~2.1.7",
"gulp-rename": "~1.0.0",
"gulp-jshint": "~1.4.0",
"gulp-uglify": "~0.2.1",
"gulp-coffee": "~1.4.1",
"gulp-watch": "~0.5.0",
"gulp-less": "~1.2.1",
"gulp-minify-css": "~0.3.0",
"gulp-clean": "~0.2.4",
"gulp-ruby-haml": "0.0.7",
"load-grunt-tasks": "^3.4.0"
},
"scripts": {
"start": "gulp"
}
}
The gulpfile is a bit too long to include here, but some relevant snippets are:
var haml = require('gulp-ruby-haml');
var on_error = function (err) { console.error(err.message); };
// Compile Haml into HTML
gulp.task('haml', function() {
return gulp.src('./app/assets/haml/**/*.haml', {read: false}).
pipe(haml().on('error', on_error)).
pipe(gulp.dest('./public'));
});
// Watch for changes in Haml files
gulp.task('haml-watch', function() {
return gulp.src('./app/assets/haml/**/*.haml', {read: false}).
pipe(watch()).
pipe(haml().on('error', on_error)).
pipe(gulp.dest('./public'));
});
Fixed in version 0.0.9.
A snippet of my logs:
I can see the executing something failed, but it doesn't tell me it was the binary named
haml
, or that I can install it via rubygems.I know it is documented in the README, but in my gulp-ruby-haml was a devDependency in the package.json of another project. I think that use-case is worth supporting a little bit better. You can't control if downstream authors have decent READMEs (or complete Dockerfiles, playbooks, etc).
I think it might be nice to rescue the exception currently thrown and re-throw a nicer message like "Unable to find the
haml
executable on your system $PATH. Visit https://github.com/chesire137/gulp-ruby-haml/wiki/Installing-haml for installation instructions."