Keep old Sources#initialize signature

fix/fix-watcher-config
Rene Klacan 2016-10-29 02:48:18 +02:00
parent 8b4e2d043c
commit d7792f788c
1 changed files with 4 additions and 3 deletions

View File

@ -53,9 +53,10 @@ module Middleman
# Create a new collection of sources. # Create a new collection of sources.
# #
# @param [Middleman::Application] app The parent app. # @param [Middleman::Application] app The parent app.
# @param [Hash] options Global options.
# @param [Array] watchers Default watchers. # @param [Array] watchers Default watchers.
Contract IsA['Middleman::Application'], Maybe[Array] => Any Contract IsA['Middleman::Application'], Maybe[Hash], Maybe[Array] => Any
def initialize(app, watchers=[]) def initialize(app, _options={}, watchers=[])
@app = app @app = app
@watchers = watchers @watchers = watchers
@sorted_watchers = @watchers.dup.freeze @sorted_watchers = @watchers.dup.freeze
@ -169,7 +170,7 @@ module Middleman
# @return [Middleman::Sources] # @return [Middleman::Sources]
Contract Symbol => ::Middleman::Sources Contract Symbol => ::Middleman::Sources
def by_type(type) def by_type(type)
self.class.new @app, watchers.select { |d| d.type == type } self.class.new @app, nil, watchers.select { |d| d.type == type }
end end
# Get all files for this collection of watchers. # Get all files for this collection of watchers.