Permalink
Browse files

.rewrite ignore exception for assets

  • Loading branch information...
1 parent 04b1cce commit b1236c3623f2a0cfc7de2f5162f8f7aeabee55f4 @bolasblack bolasblack committed Oct 2, 2013
Showing with 20 additions and 1 deletion.
  1. +1 −1 src/fs_utils/common.coffee
  2. +19 −0 test/fs_utils.common.coffee
@@ -39,7 +39,7 @@ exports.writeFile = (path, data, callback) ->
# RegExp that would filter invalid files (dotfiles, emacs caches etc).
exports.ignored = ignored = (path) ->
- ('.htaccess' isnt sysPath.basename path) and
+ /\.(?!htaccess|rewrite)/.test(sysPath.basename path) and
/(^[.#]|(?:__|~)$)/.test sysPath.basename path
# Files that should be always ignored (git / mercurial metadata etc).
@@ -0,0 +1,19 @@
+common = require '../src/fs_utils/common'
+
+describe 'common', ->
+ describe 'ignored()', ->
+ it 'should ignore invalid files', ->
+ files = [
+ 'app/assets/index.html'
+ 'app/assets/favicon.ico'
+ 'app/assets/.htaccess'
+ 'app/assets/.rewrite'
+ 'app/assets/#index.html#'
+ 'app/assets/.index.html.swp'
+ ]
+ expectedIgnoredFiles = [
+ 'app/assets/#index.html#'
+ 'app/assets/.index.html.swp'
+ ]
+ expect(files.filter common.ignored).to.eql expectedIgnoredFiles
+

0 comments on commit b1236c3

Please sign in to comment.