module SubDiff
  module CoreExt
    module String
      def sub_diff(*args, &block)
        Builder.new(self, :sub).diff(*args, &block)
      end

      def gsub_diff(*args, &block)
        Builder.new(self, :gsub).diff(*args, &block)
      end
    end
  end
end

module SubDiff
  module CoreExt
    module String
      # Behaves just like {String#sub} but wraps the returned replacement
      # string in an enumerable {Collection} of {Diff} objects.
      #
      # See http://ruby-doc.org/core-2.2.0/String.html#method-i-sub
      def sub_diff(*args, &block)
        Builder.new(self, :sub).diff(*args, &block)
      end

      # Behaves just like {String#gsub} but wraps the returned replacement
      # string in an enumerable {Collection} of {Diff} objects.
      #
      # See http://ruby-doc.org/core-2.2.0/String.html#method-i-gsub
      def gsub_diff(*args, &block)
        Builder.new(self, :gsub).diff(*args, &block)
      end
    end
  end
end

Add inline documentation for sub_diff and gsub_diff
Add inline documentation for sub_diff and gsub_diff
