def regeneratePath(path)
      path = File.expand_path(path)
      #puts "SiteRegenerator.regeneratePath, path = #{path}"
      relativePath = Pathname.new(path).relative_path_from(Pathname.new(@baseDir))
      #puts " relativePath = #{relativePath}"
      relativePathComponents = relativePath.to_s.split("/")
      #puts " relativePathComponents = #{relativePathComponents.inspect}"
      subDir = relativePathComponents[0]
      relativeSubDirPathComponents = relativePathComponents[1..-1]
      foundNonCopySubDirectory = false
      for pathComponent in relativeSubDirPathComponents do
        if !foundNonCopySubDirectory && @nonCopySubDirectories.include?(pathComponent)
          puts "NOT COPYING files from #{relativeSubDirPathComponents.join('/')} " + 
            "with non-copy sub-directory #{pathComponent.inspect}"
          foundNonCopySubDirectory = true
        end
      end
      if !foundNonCopySubDirectory
        checkNotSourceOnly(relativeSubDirPathComponents)
        if subDir == @sourceSubDir
          regenerateSubPath(relativeSubDirPathComponents, :source, makeBackups)
        elsif subDir == @outputSubDir
          regenerateSubPath(relativeSubDirPathComponents, :output, makeBackups)
        else
          raise "Path #{path} to regenerate is not contained in #{@sourceSubDir} (source) or #{@outputSubDir} (output) sub-directory of base dir #{@baseDir}"
        end
      end
    end
def regeneratePath(path)
      path = File.expand_path(path)
      #puts "SiteRegenerator.regeneratePath, path = #{path}"
      relativePath = Pathname.new(path).relative_path_from(Pathname.new(@baseDir))
      #puts " relativePath = #{relativePath}"
      relativePathComponents = relativePath.to_s.split("/")
      #puts " relativePathComponents = #{relativePathComponents.inspect}"
      subDir = relativePathComponents[0]
      relativeSubDirPathComponents = relativePathComponents[1..-1]
      foundNonCopySubDirectory = false
      for pathComponent in relativeSubDirPathComponents do
        if !foundNonCopySubDirectory && @nonCopySubDirectories.include?(pathComponent)
          puts "NOT COPYING files from #{relativeSubDirPathComponents.join('/')} " + 
            "with non-copy sub-directory #{pathComponent.inspect}"
          foundNonCopySubDirectory = true
        end
      end
      if !foundNonCopySubDirectory
        checkNotSourceOnly(relativeSubDirPathComponents)
        if subDir == @sourceSubDir
          regenerateSubPath(relativeSubDirPathComponents, :source, makeBackups)
        elsif subDir == @outputSubDir
          regenerateSubPath(relativeSubDirPathComponents, :output, makeBackups)
        else
          raise "Path #{path} to regenerate is not contained in #{@sourceSubDir} (source) or #{@outputSubDir} (output) sub-directory of base dir #{@baseDir}"
        end
      end
    end
Regenerate (or generate) from specified source file (according to whether the path is within
 the source or output root directory).