Fix segfault when doing marking and doc is not a document node

This fixes the problem where the doc node can actually also be a
XML_DOCUMENT_FRAG_NODE. In that case it's structured like a node which
means it stores a VALUE inside _private.

This checks the type of the code and uses the correct marking for the
specific cases.

Fixes #939
Select ports patches based on git ls-files instead of Dir[].

Emit a warning if untracked patches are found in the patch directories.
Close #1004. fix #741. Cache Xpath context for faster evaluation on JRuby
update the changelog
Update Code Climate Badge
Merge pull request #1011 from Joshua-Anderson/code-climate-badge

Update Code Climate Badge
fix #998. XML Sax push parser shouldn't leak memory
fixing warnings in Ruby 2.1
check the domain to figure out the exception class
Merge pull request #1006 from dbussink/fix_nokogiri_segfault_on_non_document_nodes

Fix segfault when doing marking and doc is not a document node
pass env's CFLAGS through to sub-builds
Merge pull request #1016 from zenspider/CFLAGS-propagation

pass env's CFLAGS through to sub-builds
.ruby-* to .gitignore
[JRuby] Fix entity expansion bug.

Thanks to Jonas Nicklas for reporting this issue.
updating changelogs for dos releases.
fix customised save format options never override default option
Remove excess + from CHANGELOG.rdoc
Fix 1.6.1 heading in changelog

An extra `+` before the `===` caused the 1.6.1 heading to be rendered as not a heading.
Merge pull request #1026 from lencioni/patch-1

Fix 1.6.1 heading in changelog
Fix to fail searching libxml2/libxslt on mswin.