title: Modify file in place (same dest) using Gulp.js and a globbing pattern
body: <p>I have a gulp task that is attempting to convert .scss files into .css files (using gulp-ruby-sass) and then place the resulting .css file into the same place it found the original file. The problem is, since I'm using a globbing pattern, I don't necessarily know where the original file is stored. </p>
  
  <p>In the code below I'm trying to use gulp-tap to tap into the stream and figure out the file path of the current file the stream was read from:</p>
  
  <pre><code>gulp.task('convertSass', function() {
      var fileLocation = "";
      gulp.src("sass/**/*.scss")
          .pipe(sass())
          .pipe(tap(function(file,t){
              fileLocation = path.dirname(file.path);
              console.log(fileLocation);
          }))
          .pipe(gulp.dest(fileLocation));
  });
  </code></pre>
  
  <p>Based on the output of the <code>console.log(fileLocation)</code>, this code seems like it should work fine. However, the resulting CSS files seem to be placed one directory higher than I'm expecting. Where it should be <code>project/sass/partials</code>, the resulting file path is just <code>project/partials</code>. </p>
  
  <p>If there's a much simplier way of doing this, I would definitely appreciate that solution even more. Thanks!</p>