 File = require 'file'
 EventEmitter = require 'event-emitter'
 
-# Public: Represents a directory in the project.
-#
-# Directories contain an array of {File}s.
+# Public: Represents a directory using {File}s
 module.exports =
 class Directory
   _.extend @prototype, EventEmitter

        @realPath = @path
    @realPath

  # Is the given path inside this directory?
  #
  # pathToCheck - the {String} path to check.
  #
  # Returns a {Boolean}.
  contains: (pathToCheck) ->
    return false unless pathToCheck



    directories.concat(files)

  # Private:
  afterSubscribe: ->
    @subscribeToNativeChangeEvents() if @subscriptionCount() == 1

  # Private:
  afterUnsubscribe: ->
    @unsubscribeFromNativeChangeEvents() if @subscriptionCount() == 0

  # Private:
  subscribeToNativeChangeEvents: ->
    @watchSubscription = pathWatcher.watch @path, (eventType) =>
      @trigger "contents-changed" if eventType is "change"

  # Private:
  unsubscribeFromNativeChangeEvents: ->
    if @watchSubscription?
      @watchSubscription.close()
