Top Level Namespace
Defined Under Namespace
Constant Summary collapse
- ROOT =
File.(File.join(File.dirname(__FILE__), '..', '..'))
- LIBDIR =
- INCLUDEDIR =
- HEADER_DIRS =
[ # First search /opt/local for macports '/opt/local/include', '/opt/local/include/libxml2', # Then search /usr/local for people that installed from source '/usr/local/include', '/usr/local/include/libxml2', # Check the ruby install locations INCLUDEDIR, File.join(INCLUDEDIR, "libxml2"), # Finally fall back to /usr '/usr/include', '/usr/include/libxml2', ]
- LIB_DIRS =
[ # First search /opt/local for macports '/opt/local/lib', # Then search /usr/local for people that installed from source '/usr/local/lib', # Check the ruby install locations LIBDIR, # Finally fall back to /usr '/usr/lib', ]
- CUSTOM_DASH_I =
[]
Instance Method Summary collapse
-
#Nokogiri(*args, &block) ⇒ Object
Parser a document contained in
args
. - #nokogiri_find_header(header_file, *paths) ⇒ Object
Instance Method Details
#Nokogiri(*args, &block) ⇒ Object
Parser a document contained in args
. Nokogiri will try to guess what type of document you are attempting to parse. For more information, see Nokogiri.parse
To specify the type of document, use Nokogiri.XML or Nokogiri.HTML.
115 116 117 118 119 120 121 122 |
# File 'lib/nokogiri.rb', line 115 def Nokogiri(*args, &block) if block_given? builder = Nokogiri::HTML::Builder.new(&block) return builder.doc.root else Nokogiri.parse(*args) end end |
#nokogiri_find_header(header_file, *paths) ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'ext/nokogiri/extconf.rb', line 82 def nokogiri_find_header header_file, *paths # mkmf in ruby 1.8.5 does not have the "checking_message" method = defined?() ? (header_file, paths) : header_file header = cpp_include header_file checking_for do found = false paths.each do |dir| if File.exists?(File.join(dir, header_file)) opt = "-I#{dir}".quote if try_cpp header, opt unless CUSTOM_DASH_I.include? dir $INCFLAGS = "#{opt} #{$INCFLAGS}" CUSTOM_DASH_I << dir end found = dir break end end end found ||= try_cpp(header) end end |