Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added docpad.getIgnoreOpts method and used it where relevant

  • Loading branch information...
commit b289cb1b0f121e620a17251935ee7e9221a95571 1 parent 2e90276
@Delapouite Delapouite authored
Showing with 7 additions and 19 deletions.
  1. +7 −19 src/lib/docpad.coffee
View
26 src/lib/docpad.coffee
@@ -1292,34 +1292,22 @@ class DocPad extends EventEmitterGrouped
# =================================
# Helpers
+ getIgnoreOpts: ->
+ return _.pick(@config, 'ignorePaths', 'ignoreHiddenFiles', 'ignoreCommonPatterns', 'ignoreCustomPatterns')
+
# Is Ignored Path
isIgnoredPath: (path,opts={}) ->
- opts = extendr.extend({
- ignorePaths: @config.ignorePaths
- ignoreHiddenFiles: @config.ignoreHiddenFiles
- ignoreCommonPatterns: @config.ignoreCommonPatterns
- ignoreCustomPatterns: @config.ignoreCustomPatterns
- },opts)
- return balUtil.isIgnoredPath(path,opts)
+ opts = extendr.extend(@getIgnoreOpts(), opts)
+ return balUtil.isIgnoredPath(path, opts)
# Scan Directory
scandir: (opts={}) ->
- opts = extendr.extend({
- ignorePaths: @config.ignorePaths
- ignoreHiddenFiles: @config.ignoreHiddenFiles
- ignoreCommonPatterns: @config.ignoreCommonPatterns
- ignoreCustomPatterns: @config.ignoreCustomPatterns
- },opts)
+ opts = extendr.extend(@getIgnoreOpts(), opts)
return balUtil.scandir(opts)
# Watch Directory
watchdir: (opts={}) ->
- opts = extendr.extend({
- ignorePaths: @config.ignorePaths
- ignoreHiddenFiles: @config.ignoreHiddenFiles
- ignoreCommonPatterns: @config.ignoreCommonPatterns
- ignoreCustomPatterns: @config.ignoreCustomPatterns
- },opts,@config.watchOptions)
+ opts = extendr.extend(@getIgnoreOpts(), opts, @config.watchOptions)
return require('watchr').watch(opts)
Please sign in to comment.
Something went wrong with that request. Please try again.