nokogiri 1.0.0-x86-mswin32-60 → 1.0.3-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- data/History.txt +23 -0
- data/Manifest.txt +2 -1
- data/README.ja.txt +4 -3
- data/README.txt +5 -3
- data/Rakefile +8 -1
- data/ext/nokogiri/extconf.rb +8 -12
- data/ext/nokogiri/html_document.c +1 -1
- data/ext/nokogiri/native.h +2 -4
- data/ext/nokogiri/native.so +0 -0
- data/ext/nokogiri/xml_cdata.c +1 -11
- data/ext/nokogiri/xml_document.c +14 -7
- data/ext/nokogiri/xml_node.c +48 -16
- data/ext/nokogiri/xml_node.h +3 -0
- data/ext/nokogiri/xml_node_set.c +6 -5
- data/ext/nokogiri/xml_reader.c +1 -1
- data/ext/nokogiri/xml_syntax_error.c +1 -1
- data/ext/nokogiri/xml_text.c +1 -11
- data/ext/nokogiri/xml_xpath_context.c +8 -1
- data/ext/nokogiri/xslt_stylesheet.c +2 -2
- data/lib/nokogiri/version.rb +1 -1
- data/lib/nokogiri/xml/document.rb +4 -0
- data/lib/nokogiri/xml/node.rb +5 -1
- data/lib/nokogiri/xml/node_set.rb +4 -0
- data/test/files/dont_hurt_em_why.xml +422 -0
- data/test/helper.rb +4 -1
- data/test/html/test_document.rb +32 -0
- data/test/test_gc.rb +15 -0
- data/test/xml/test_document.rb +7 -0
- data/test/xml/test_node_set.rb +7 -0
- metadata +5 -3
- data/nokogiri.gemspec +0 -34
data/History.txt
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
=== 1.0.3
|
2
|
+
|
3
|
+
* 5 Bigfixes
|
4
|
+
|
5
|
+
* NodeSet now implements to_ary
|
6
|
+
* XML::Document should not implement parent
|
7
|
+
* More GC Bugs fixed. (Mike is AWESOME!)
|
8
|
+
* Removed RARRAY_LEN for 1.8.5 compatibility. Thanks Shane Hanna.
|
9
|
+
* inner_html fixed. (Thanks Yehuda!)
|
10
|
+
|
11
|
+
=== 1.0.2
|
12
|
+
|
13
|
+
* 1 Bugfix
|
14
|
+
|
15
|
+
* extconf.rb should not check for frex and racc
|
16
|
+
|
17
|
+
=== 1.0.1
|
18
|
+
|
19
|
+
* 1 Bugfix
|
20
|
+
|
21
|
+
* Made sure extconf.rb searched libdir and prefix so that ports libxml/ruby
|
22
|
+
will link properly. Thanks lucsky!
|
23
|
+
|
1
24
|
=== 1.0.0 / 2008-07-13
|
2
25
|
|
3
26
|
* 1 major enhancement
|
data/Manifest.txt
CHANGED
@@ -77,11 +77,11 @@ lib/nokogiri/xml/xpath.rb
|
|
77
77
|
lib/nokogiri/xml/xpath_context.rb
|
78
78
|
lib/nokogiri/xslt.rb
|
79
79
|
lib/nokogiri/xslt/stylesheet.rb
|
80
|
-
nokogiri.gemspec
|
81
80
|
test/css/test_nthiness.rb
|
82
81
|
test/css/test_parser.rb
|
83
82
|
test/css/test_tokenizer.rb
|
84
83
|
test/css/test_xpath_visitor.rb
|
84
|
+
test/files/dont_hurt_em_why.xml
|
85
85
|
test/files/staff.xml
|
86
86
|
test/files/staff.xslt
|
87
87
|
test/files/tlm.html
|
@@ -107,6 +107,7 @@ test/html/sax/test_parser.rb
|
|
107
107
|
test/html/test_builder.rb
|
108
108
|
test/html/test_document.rb
|
109
109
|
test/test_convert_xpath.rb
|
110
|
+
test/test_gc.rb
|
110
111
|
test/test_nokogiri.rb
|
111
112
|
test/test_reader.rb
|
112
113
|
test/test_xslt_transforms.rb
|
data/README.ja.txt
CHANGED
@@ -14,10 +14,11 @@ Nokogiri はHTMLやXMLやSAXやXSLTやReaderのパーサーです。
|
|
14
14
|
* CSS3 のセレクターで探せる
|
15
15
|
* XML/HTMLのビルダーはある
|
16
16
|
|
17
|
-
|
18
|
-
正確にCSS3とXPathをサポート出来たりする。
|
17
|
+
検索出来たり、正確にCSS3とXPathをサポート出来たりする。
|
19
18
|
|
20
|
-
|
19
|
+
これはスピッドテストです:
|
20
|
+
|
21
|
+
* http://gist.github.com/22176
|
21
22
|
|
22
23
|
NokogiriはHpricotの代わりに使用出来る。
|
23
24
|
その互換性は簡単に正しいCSSとXPathを使用する事が出来る。
|
data/README.txt
CHANGED
@@ -13,12 +13,14 @@ Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser.
|
|
13
13
|
* XPath support for document searching
|
14
14
|
* CSS3 selector support for document searching
|
15
15
|
* XML/HTML builder
|
16
|
-
* Drop in replacement for Hpricot
|
16
|
+
* Drop in replacement for Hpricot (though not bug for bug)
|
17
17
|
|
18
|
-
Nokogiri parses and searches XML/HTML
|
18
|
+
Nokogiri parses and searches XML/HTML very quickly, and also has
|
19
19
|
correctly implemented CSS3 selector support as well as XPath support.
|
20
20
|
|
21
|
-
|
21
|
+
Here is a speed test:
|
22
|
+
|
23
|
+
* http://gist.github.com/22176
|
22
24
|
|
23
25
|
Nokogiri also features an Hpricot compatibility layer to help ease the change
|
24
26
|
to using correct CSS and XPath.
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
+
require 'mkmf'
|
4
5
|
require 'hoe'
|
5
6
|
|
6
7
|
kind = Config::CONFIG['DLEXT']
|
@@ -40,7 +41,7 @@ namespace :gem do
|
|
40
41
|
end
|
41
42
|
|
42
43
|
namespace :win32 do
|
43
|
-
task :spec do
|
44
|
+
task :spec => ['build:win32'] do
|
44
45
|
File.open("#{HOE.name}.gemspec", 'w') do |f|
|
45
46
|
HOE.spec.files += Dir['ext/nokogiri/**.{dll,so}']
|
46
47
|
if windows
|
@@ -72,10 +73,16 @@ task :coverage do
|
|
72
73
|
end
|
73
74
|
|
74
75
|
file GENERATED_PARSER => "lib/nokogiri/css/parser.y" do |t|
|
76
|
+
unless find_executable("racc")
|
77
|
+
abort "need racc, get the tarball from http://i.loveruby.net/archive/racc/racc-1.4.5-all.tar.gz"
|
78
|
+
end
|
75
79
|
sh "racc -o #{t.name} #{t.prerequisites.first}"
|
76
80
|
end
|
77
81
|
|
78
82
|
file GENERATED_TOKENIZER => "lib/nokogiri/css/tokenizer.rex" do |t|
|
83
|
+
unless find_executable("frex")
|
84
|
+
abort "need frex, sudo gem install aaronp-frex -s http://gems.github.com"
|
85
|
+
end
|
79
86
|
sh "frex -i --independent -o #{t.name} #{t.prerequisites.first}"
|
80
87
|
end
|
81
88
|
|
data/ext/nokogiri/extconf.rb
CHANGED
@@ -3,6 +3,8 @@ ENV["ARCHFLAGS"] = "-arch #{`uname -p` =~ /powerpc/ ? 'ppc' : 'i386'}"
|
|
3
3
|
require 'mkmf'
|
4
4
|
|
5
5
|
ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
6
|
+
LIBDIR = Config::CONFIG['libdir']
|
7
|
+
INCLUDEDIR = Config::CONFIG['includedir']
|
6
8
|
|
7
9
|
$CFLAGS << " #{ENV["CFLAGS"]}"
|
8
10
|
if Config::CONFIG['target_os'] == 'mingw32'
|
@@ -19,8 +21,8 @@ if Config::CONFIG['target_os'] == 'mingw32'
|
|
19
21
|
find_library('xslt', 'xsltParseStylesheetDoc',
|
20
22
|
File.join(ROOT, 'cross', 'libxslt-1.1.24.win32', 'bin'))
|
21
23
|
else
|
22
|
-
find_library('xml2', 'xmlParseDoc')
|
23
|
-
find_library('xslt', 'xsltParseStylesheetDoc')
|
24
|
+
find_library('xml2', 'xmlParseDoc', LIBDIR)
|
25
|
+
find_library('xslt', 'xsltParseStylesheetDoc', LIBDIR)
|
24
26
|
end
|
25
27
|
|
26
28
|
|
@@ -40,20 +42,14 @@ if Config::CONFIG['target_os'] == 'mingw32'
|
|
40
42
|
abort "need iconv"
|
41
43
|
end
|
42
44
|
else
|
43
|
-
unless find_header('libxml/xmlversion.h',
|
45
|
+
unless find_header('libxml/xmlversion.h',
|
46
|
+
File.join(INCLUDEDIR, "libxml2"), '/usr/include/libxml2'
|
47
|
+
)
|
44
48
|
abort "need libxml"
|
45
49
|
end
|
46
|
-
unless find_header('libxslt/xslt.h', '/usr/include')
|
50
|
+
unless find_header('libxslt/xslt.h', INCLUDEDIR, '/usr/include')
|
47
51
|
abort "need libxslt"
|
48
52
|
end
|
49
53
|
end
|
50
54
|
|
51
|
-
unless find_executable("racc")
|
52
|
-
abort "need racc, get the tarball from http://i.loveruby.net/archive/racc/racc-1.4.5-all.tar.gz"
|
53
|
-
end
|
54
|
-
|
55
|
-
unless find_executable("frex")
|
56
|
-
abort "need frex, sudo gem install aaronp-frex -s http://gems.github.com"
|
57
|
-
end
|
58
|
-
|
59
55
|
create_makefile('nokogiri/native')
|
data/ext/nokogiri/native.h
CHANGED
@@ -34,15 +34,13 @@ extern VALUE mNokogiriXslt ;
|
|
34
34
|
|
35
35
|
#ifdef DEBUG
|
36
36
|
|
37
|
-
#define NOKOGIRI_DEBUG_START_NODE(p) if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"
|
38
|
-
#define
|
39
|
-
#define NOKOGIRI_DEBUG_START(p) if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p start\n", __FILE__, __LINE__, p);
|
37
|
+
#define NOKOGIRI_DEBUG_START_NODE(p) if (getenv("NOKOGIRI_NO_FREE")) return ; if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p start node (%p %x %p/%s)\n", __FILE__, __LINE__, p, p->_private, p->type, p->name, p->name);
|
38
|
+
#define NOKOGIRI_DEBUG_START(p) if (getenv("NOKOGIRI_NO_FREE")) return ; if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p start\n", __FILE__, __LINE__, p);
|
40
39
|
#define NOKOGIRI_DEBUG_END(p) if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p end\n", __FILE__, __LINE__, p);
|
41
40
|
|
42
41
|
#else
|
43
42
|
|
44
43
|
#define NOKOGIRI_DEBUG_START_NODE(p)
|
45
|
-
#define NOKOGIRI_DEBUG_START_TEXT(p)
|
46
44
|
#define NOKOGIRI_DEBUG_START(p)
|
47
45
|
#define NOKOGIRI_DEBUG_END(p)
|
48
46
|
|
data/ext/nokogiri/native.so
CHANGED
Binary file
|
data/ext/nokogiri/xml_cdata.c
CHANGED
@@ -1,14 +1,5 @@
|
|
1
1
|
#include <xml_cdata.h>
|
2
2
|
|
3
|
-
static void dealloc(xmlNodePtr node)
|
4
|
-
{
|
5
|
-
if (node->doc == NULL) {
|
6
|
-
NOKOGIRI_DEBUG_START_NODE(node);
|
7
|
-
xmlFreeNode(node);
|
8
|
-
NOKOGIRI_DEBUG_END(node);
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
3
|
/*
|
13
4
|
* call-seq:
|
14
5
|
* new(document, content)
|
@@ -26,8 +17,7 @@ static VALUE new(VALUE klass, VALUE doc, VALUE content)
|
|
26
17
|
NUM2INT(rb_funcall(content, rb_intern("length"), 0))
|
27
18
|
);
|
28
19
|
|
29
|
-
VALUE rb_node =
|
30
|
-
node->_private = (void *)rb_node;
|
20
|
+
VALUE rb_node = Nokogiri_wrap_xml_node(node);
|
31
21
|
|
32
22
|
if(rb_block_given_p()) rb_yield(rb_node);
|
33
23
|
|
data/ext/nokogiri/xml_document.c
CHANGED
@@ -6,17 +6,19 @@
|
|
6
6
|
*/
|
7
7
|
static void gc_mark(xmlNodePtr node)
|
8
8
|
{
|
9
|
+
VALUE rb_obj ;
|
9
10
|
xmlNodePtr child ;
|
10
11
|
/* mark children nodes */
|
11
12
|
for (child = node->children ; child ; child = child->next) {
|
12
|
-
if (child
|
13
|
-
rb_gc_mark(
|
13
|
+
if ((rb_obj = Nokogiri_xml_node2obj_get(child)) != Qnil)
|
14
|
+
rb_gc_mark(rb_obj);
|
14
15
|
}
|
15
16
|
}
|
16
17
|
|
17
18
|
static void dealloc(xmlDocPtr doc)
|
18
19
|
{
|
19
20
|
NOKOGIRI_DEBUG_START(doc);
|
21
|
+
Nokogiri_xml_node2obj_remove((xmlNodePtr)doc);
|
20
22
|
xmlFreeDoc(doc);
|
21
23
|
NOKOGIRI_DEBUG_END(doc);
|
22
24
|
}
|
@@ -36,7 +38,7 @@ static VALUE serialize(VALUE self)
|
|
36
38
|
|
37
39
|
xmlDocDumpMemory(doc, &buf, &size);
|
38
40
|
VALUE rb_str = rb_str_new((char *)buf, (long)size);
|
39
|
-
|
41
|
+
xmlFree(buf);
|
40
42
|
return rb_str;
|
41
43
|
}
|
42
44
|
|
@@ -145,15 +147,20 @@ void init_xml_document()
|
|
145
147
|
rb_define_method(klass, "root", root, 0);
|
146
148
|
rb_define_method(klass, "root=", set_root, 1);
|
147
149
|
rb_define_method(klass, "serialize", serialize, 0);
|
150
|
+
rb_undef_method(klass, "parent");
|
148
151
|
}
|
149
152
|
|
150
153
|
|
151
154
|
/* this takes klass as a param because it's used for HtmlDocument, too. */
|
152
155
|
VALUE Nokogiri_wrap_xml_document(VALUE klass, xmlDocPtr doc)
|
153
156
|
{
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
157
|
+
VALUE rb_doc = Qnil;
|
158
|
+
|
159
|
+
if ((rb_doc = Nokogiri_xml_node2obj_get((xmlNodePtr)doc)) != Qnil)
|
160
|
+
return rb_doc ;
|
161
|
+
|
162
|
+
rb_doc = Data_Wrap_Struct(klass ? klass : cNokogiriXmlDocument, gc_mark, dealloc, doc) ;
|
163
|
+
|
164
|
+
Nokogiri_xml_node2obj_set((xmlNodePtr)doc, rb_doc);
|
158
165
|
return rb_doc ;
|
159
166
|
}
|
data/ext/nokogiri/xml_node.c
CHANGED
@@ -16,7 +16,7 @@ static VALUE encode_special_chars(VALUE self, VALUE string)
|
|
16
16
|
);
|
17
17
|
|
18
18
|
VALUE encoded_str = rb_str_new2((const char *)encoded);
|
19
|
-
|
19
|
+
xmlFree(encoded);
|
20
20
|
|
21
21
|
return encoded_str;
|
22
22
|
}
|
@@ -403,7 +403,7 @@ static VALUE document(VALUE self)
|
|
403
403
|
Data_Get_Struct(self, xmlNode, node);
|
404
404
|
|
405
405
|
if(!node->doc) return Qnil;
|
406
|
-
return (
|
406
|
+
return Nokogiri_xml_node2obj_get(node->doc);
|
407
407
|
}
|
408
408
|
|
409
409
|
/*
|
@@ -510,6 +510,7 @@ static VALUE new_from_str(VALUE klass, VALUE xml)
|
|
510
510
|
|
511
511
|
static void deallocate(xmlNodePtr node)
|
512
512
|
{
|
513
|
+
Nokogiri_xml_node2obj_remove(node);
|
513
514
|
if (! Nokogiri_xml_node_owned_get(node)) {
|
514
515
|
NOKOGIRI_DEBUG_START_NODE(node);
|
515
516
|
xmlFreeNode(node);
|
@@ -520,30 +521,31 @@ static void deallocate(xmlNodePtr node)
|
|
520
521
|
static void gc_mark_node(xmlNodePtr node)
|
521
522
|
{
|
522
523
|
xmlNodePtr child ;
|
524
|
+
VALUE rb_obj ;
|
523
525
|
/* mark document */
|
524
|
-
if (node && node->doc && node->doc
|
525
|
-
rb_gc_mark(
|
526
|
+
if (node && node->doc && (rb_obj = Nokogiri_xml_node2obj_get((xmlNodePtr)node->doc)) != Qnil)
|
527
|
+
rb_gc_mark(rb_obj);
|
526
528
|
/* mark parent node */
|
527
|
-
if (node && node->parent && node->parent
|
528
|
-
rb_gc_mark(
|
529
|
+
if (node && node->parent && (rb_obj = Nokogiri_xml_node2obj_get(node->parent)) != Qnil)
|
530
|
+
rb_gc_mark(rb_obj);
|
529
531
|
/* mark children nodes */
|
530
532
|
for (child = node->children ; child ; child = child->next) {
|
531
|
-
if (child
|
532
|
-
rb_gc_mark(
|
533
|
+
if ((rb_obj = Nokogiri_xml_node2obj_get(child)) != Qnil)
|
534
|
+
rb_gc_mark(rb_obj);
|
533
535
|
}
|
534
536
|
/* mark sibling nodes */
|
535
|
-
if (node->next && node->next
|
536
|
-
rb_gc_mark(
|
537
|
-
if (node->prev && node->prev
|
538
|
-
rb_gc_mark(
|
537
|
+
if (node->next && (rb_obj = Nokogiri_xml_node2obj_get(node->next)) != Qnil)
|
538
|
+
rb_gc_mark(rb_obj);
|
539
|
+
if (node->prev && (rb_obj = Nokogiri_xml_node2obj_get(node->prev)) != Qnil)
|
540
|
+
rb_gc_mark(rb_obj);
|
539
541
|
}
|
540
542
|
|
541
543
|
VALUE Nokogiri_wrap_xml_node(xmlNodePtr node)
|
542
544
|
{
|
543
|
-
if (node->_private)
|
544
|
-
return (VALUE)node->_private ;
|
545
|
-
|
546
545
|
VALUE rb_node = Qnil;
|
546
|
+
|
547
|
+
if ((rb_node = Nokogiri_xml_node2obj_get(node)) != Qnil)
|
548
|
+
return rb_node ;
|
547
549
|
|
548
550
|
switch(node->type)
|
549
551
|
{
|
@@ -573,7 +575,7 @@ VALUE Nokogiri_wrap_xml_node(xmlNodePtr node)
|
|
573
575
|
rb_node = Data_Wrap_Struct(cNokogiriXmlNode, gc_mark_node, deallocate, node) ;
|
574
576
|
}
|
575
577
|
|
576
|
-
node
|
578
|
+
Nokogiri_xml_node2obj_set(node, rb_node);
|
577
579
|
rb_funcall(rb_node, rb_intern("decorate!"), 0);
|
578
580
|
Nokogiri_xml_node_owned_set(node);
|
579
581
|
return rb_node ;
|
@@ -632,6 +634,36 @@ void Nokogiri_xml_node_namespaces(xmlNodePtr node, VALUE attr_hash)
|
|
632
634
|
}
|
633
635
|
|
634
636
|
|
637
|
+
void Nokogiri_xml_node2obj_set(xmlNodePtr node, VALUE rb_obj)
|
638
|
+
{
|
639
|
+
VALUE hash = rb_cvar_get(cNokogiriXmlNode, rb_intern("@@node2obj"));
|
640
|
+
VALUE weakref = rb_obj_id(rb_obj) ; /* so GC won't mark the object. sneaky
|
641
|
+
sneaky. */
|
642
|
+
rb_hash_aset(hash, INT2NUM((long)node), weakref);
|
643
|
+
}
|
644
|
+
|
645
|
+
VALUE Nokogiri_xml_node2obj_get(xmlNodePtr node)
|
646
|
+
{
|
647
|
+
static VALUE ObjectSpace = 0 ;
|
648
|
+
static ID id2ref = 0 ;
|
649
|
+
|
650
|
+
if (! ObjectSpace) ObjectSpace = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
|
651
|
+
if (! id2ref) id2ref = rb_intern("_id2ref");
|
652
|
+
|
653
|
+
VALUE hash = rb_cvar_get(cNokogiriXmlNode, rb_intern("@@node2obj"));
|
654
|
+
VALUE weakref = rb_hash_aref(hash, INT2NUM((long)node)) ;
|
655
|
+
if (weakref == Qnil)
|
656
|
+
return Qnil ;
|
657
|
+
return rb_funcall(ObjectSpace, id2ref, 1, weakref); /* translate weakref to
|
658
|
+
* the object */
|
659
|
+
}
|
660
|
+
|
661
|
+
void Nokogiri_xml_node2obj_remove(xmlNodePtr node)
|
662
|
+
{
|
663
|
+
VALUE hash = rb_cvar_get(cNokogiriXmlNode, rb_intern("@@node2obj"));
|
664
|
+
rb_hash_delete(hash, INT2NUM((long)node));
|
665
|
+
}
|
666
|
+
|
635
667
|
void Nokogiri_xml_node_owned_set(xmlNodePtr node)
|
636
668
|
{
|
637
669
|
VALUE hash = rb_cvar_get(cNokogiriXmlNode, rb_intern("@@owned"));
|
data/ext/nokogiri/xml_node.h
CHANGED
@@ -12,4 +12,7 @@ void Nokogiri_xml_node_properties(xmlNodePtr node, VALUE attr_hash) ;
|
|
12
12
|
void Nokogiri_xml_node_namespaces(xmlNodePtr node, VALUE attr_hash) ;
|
13
13
|
int Nokogiri_xml_node_owned_get(xmlNodePtr node) ;
|
14
14
|
void Nokogiri_xml_node_owned_set(xmlNodePtr node) ;
|
15
|
+
void Nokogiri_xml_node2obj_set(xmlNodePtr node, VALUE rb_obj) ;
|
16
|
+
VALUE Nokogiri_xml_node2obj_get(xmlNodePtr node) ;
|
17
|
+
void Nokogiri_xml_node2obj_remove(xmlNodePtr node) ;
|
15
18
|
#endif
|
data/ext/nokogiri/xml_node_set.c
CHANGED
@@ -57,11 +57,12 @@ static VALUE index_at(VALUE self, VALUE number)
|
|
57
57
|
|
58
58
|
static void gc_mark(xmlNodeSetPtr node_set)
|
59
59
|
{
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
VALUE rb_obj ;
|
61
|
+
int j ;
|
62
|
+
for (j = 0 ; j < node_set->nodeNr ; ++j) {
|
63
|
+
if ((rb_obj = Nokogiri_xml_node2obj_get(node_set->nodeTab[j])) != Qnil)
|
64
|
+
rb_gc_mark(rb_obj);
|
65
|
+
}
|
65
66
|
}
|
66
67
|
|
67
68
|
static void deallocate(xmlNodeSetPtr node_set)
|
data/ext/nokogiri/xml_reader.c
CHANGED
@@ -151,7 +151,7 @@ static VALUE reader_attribute(VALUE self, VALUE name)
|
|
151
151
|
xmlChar *localname = xmlSplitQName2((xmlChar*)StringValuePtr(name), &prefix);
|
152
152
|
if (localname != NULL) {
|
153
153
|
value = xmlTextReaderLookupNamespace(reader, localname);
|
154
|
-
|
154
|
+
xmlFree(localname) ;
|
155
155
|
} else {
|
156
156
|
value = xmlTextReaderLookupNamespace(reader, prefix);
|
157
157
|
}
|
data/ext/nokogiri/xml_text.c
CHANGED
@@ -1,19 +1,9 @@
|
|
1
1
|
#include <xml_text.h>
|
2
2
|
|
3
|
-
static void dealloc(xmlNodePtr node)
|
4
|
-
{
|
5
|
-
if (node->doc == NULL) {
|
6
|
-
NOKOGIRI_DEBUG_START_TEXT(node);
|
7
|
-
xmlFreeNode(node);
|
8
|
-
NOKOGIRI_DEBUG_END(node);
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
3
|
static VALUE new(VALUE klass, VALUE string)
|
13
4
|
{
|
14
5
|
xmlNodePtr node = xmlNewText((xmlChar *)StringValuePtr(string));
|
15
|
-
VALUE rb_node =
|
16
|
-
node->_private = (void *)rb_node;
|
6
|
+
VALUE rb_node = Nokogiri_wrap_xml_node(node) ;
|
17
7
|
|
18
8
|
if(rb_block_given_p()) rb_yield(rb_node);
|
19
9
|
|
@@ -7,6 +7,13 @@ static void deallocate(xmlXPathContextPtr ctx)
|
|
7
7
|
NOKOGIRI_DEBUG_END(ctx);
|
8
8
|
}
|
9
9
|
|
10
|
+
static void gc_mark_context(xmlXPathContextPtr ctx)
|
11
|
+
{
|
12
|
+
VALUE rb_obj ;
|
13
|
+
if (ctx && ctx->node && (rb_obj = Nokogiri_xml_node2obj_get(ctx->node)) != Qnil)
|
14
|
+
rb_gc_mark(rb_obj);
|
15
|
+
}
|
16
|
+
|
10
17
|
/*
|
11
18
|
* call-seq:
|
12
19
|
* register_ns(prefix, uri)
|
@@ -59,7 +66,7 @@ static VALUE new(VALUE klass, VALUE nodeobj)
|
|
59
66
|
|
60
67
|
xmlXPathContextPtr ctx = xmlXPathNewContext(node->doc);
|
61
68
|
ctx->node = node ;
|
62
|
-
return Data_Wrap_Struct(klass,
|
69
|
+
return Data_Wrap_Struct(klass, gc_mark_context, deallocate, ctx);
|
63
70
|
}
|
64
71
|
|
65
72
|
VALUE cNokogiriXmlXpathContext;
|
@@ -45,7 +45,7 @@ static VALUE serialize(VALUE self, VALUE xmlobj)
|
|
45
45
|
Data_Get_Struct(self, xsltStylesheet, ss);
|
46
46
|
xsltSaveResultToString(&doc_ptr, &doc_len, xml, ss);
|
47
47
|
rval = rb_str_new((char*)doc_ptr, doc_len);
|
48
|
-
|
48
|
+
xmlFree(doc_ptr);
|
49
49
|
return rval ;
|
50
50
|
}
|
51
51
|
|
@@ -73,7 +73,7 @@ static VALUE apply_to(int argc, VALUE* argv, VALUE self)
|
|
73
73
|
Data_Get_Struct(xmldoc, xmlDoc, xml);
|
74
74
|
Data_Get_Struct(self, xsltStylesheet, ss);
|
75
75
|
|
76
|
-
param_len =
|
76
|
+
param_len = RARRAY(paramobj)->len;
|
77
77
|
params = calloc((size_t)param_len+1, sizeof(char*));
|
78
78
|
for (j = 0 ; j < param_len ; j++) {
|
79
79
|
VALUE entry = rb_ary_entry(paramobj, j);
|
data/lib/nokogiri/version.rb
CHANGED
data/lib/nokogiri/xml/node.rb
CHANGED
@@ -15,6 +15,7 @@ module Nokogiri
|
|
15
15
|
DOCB_DOCUMENT_NODE = 21
|
16
16
|
|
17
17
|
@@owned = {}
|
18
|
+
@@node2obj = {}
|
18
19
|
|
19
20
|
###
|
20
21
|
# Decorate this node with the decorators set up in this node's Document
|
@@ -168,7 +169,10 @@ module Nokogiri
|
|
168
169
|
to_xml
|
169
170
|
end
|
170
171
|
alias :to_s :to_html
|
171
|
-
|
172
|
+
|
173
|
+
def inner_html
|
174
|
+
children.map { |x| x.to_html }.join
|
175
|
+
end
|
172
176
|
|
173
177
|
def css_path
|
174
178
|
path.split(/\//).map { |part|
|
@@ -0,0 +1,422 @@
|
|
1
|
+
<statuses type="array">
|
2
|
+
<status>
|
3
|
+
<created_at>Sat Aug 09 05:38:12 +0000 2008</created_at>
|
4
|
+
<id>882281424</id>
|
5
|
+
<text>I so just thought the guy lighting the Olympic torch was falling when he began to run on the wall. Wow that would have been catastrophic.</text>
|
6
|
+
<source>web</source>
|
7
|
+
<truncated>false</truncated>
|
8
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
9
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
10
|
+
<favorited></favorited>
|
11
|
+
<user>
|
12
|
+
<id>4243</id>
|
13
|
+
<name>John Nunemaker</name>
|
14
|
+
<screen_name>jnunemaker</screen_name>
|
15
|
+
<location>Mishawaka, IN, US</location>
|
16
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
17
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
18
|
+
<url>http://addictedtonew.com</url>
|
19
|
+
<protected>false</protected>
|
20
|
+
<followers_count>486</followers_count>
|
21
|
+
</user>
|
22
|
+
</status>
|
23
|
+
<status>
|
24
|
+
<created_at>Sat Aug 09 02:04:56 +0000 2008</created_at>
|
25
|
+
<id>882145663</id>
|
26
|
+
<text>@ijonas - wow that stuff sounds sweet</text>
|
27
|
+
<source>web</source>
|
28
|
+
<truncated>false</truncated>
|
29
|
+
<in_reply_to_status_id>882005142</in_reply_to_status_id>
|
30
|
+
<in_reply_to_user_id>1000471</in_reply_to_user_id>
|
31
|
+
<favorited></favorited>
|
32
|
+
<user>
|
33
|
+
<id>4243</id>
|
34
|
+
<name>John Nunemaker</name>
|
35
|
+
<screen_name>jnunemaker</screen_name>
|
36
|
+
<location>Mishawaka, IN, US</location>
|
37
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
38
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
39
|
+
<url>http://addictedtonew.com</url>
|
40
|
+
<protected>false</protected>
|
41
|
+
<followers_count>486</followers_count>
|
42
|
+
</user>
|
43
|
+
</status>
|
44
|
+
<status>
|
45
|
+
<created_at>Sat Aug 09 01:36:41 +0000 2008</created_at>
|
46
|
+
<id>882126691</id>
|
47
|
+
<text>Steph is driving Sally for the first time. I'm proud of her.</text>
|
48
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
49
|
+
<truncated>false</truncated>
|
50
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
51
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
52
|
+
<favorited></favorited>
|
53
|
+
<user>
|
54
|
+
<id>4243</id>
|
55
|
+
<name>John Nunemaker</name>
|
56
|
+
<screen_name>jnunemaker</screen_name>
|
57
|
+
<location>Mishawaka, IN, US</location>
|
58
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
59
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
60
|
+
<url>http://addictedtonew.com</url>
|
61
|
+
<protected>false</protected>
|
62
|
+
<followers_count>486</followers_count>
|
63
|
+
</user>
|
64
|
+
</status>
|
65
|
+
<status>
|
66
|
+
<created_at>Fri Aug 08 22:21:21 +0000 2008</created_at>
|
67
|
+
<id>881987762</id>
|
68
|
+
<text>@ijonas - what are you making with couchdb, ruby and httparty?</text>
|
69
|
+
<source>web</source>
|
70
|
+
<truncated>false</truncated>
|
71
|
+
<in_reply_to_status_id>881947237</in_reply_to_status_id>
|
72
|
+
<in_reply_to_user_id>1000471</in_reply_to_user_id>
|
73
|
+
<favorited></favorited>
|
74
|
+
<user>
|
75
|
+
<id>4243</id>
|
76
|
+
<name>John Nunemaker</name>
|
77
|
+
<screen_name>jnunemaker</screen_name>
|
78
|
+
<location>Mishawaka, IN, US</location>
|
79
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
80
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
81
|
+
<url>http://addictedtonew.com</url>
|
82
|
+
<protected>false</protected>
|
83
|
+
<followers_count>486</followers_count>
|
84
|
+
</user>
|
85
|
+
</status>
|
86
|
+
<status>
|
87
|
+
<created_at>Fri Aug 08 14:20:14 +0000 2008</created_at>
|
88
|
+
<id>881535796</id>
|
89
|
+
<text>@oaknd1 - delete it off phone and iTunes.</text>
|
90
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
91
|
+
<truncated>false</truncated>
|
92
|
+
<in_reply_to_status_id>881526234</in_reply_to_status_id>
|
93
|
+
<in_reply_to_user_id>3038211</in_reply_to_user_id>
|
94
|
+
<favorited></favorited>
|
95
|
+
<user>
|
96
|
+
<id>4243</id>
|
97
|
+
<name>John Nunemaker</name>
|
98
|
+
<screen_name>jnunemaker</screen_name>
|
99
|
+
<location>Mishawaka, IN, US</location>
|
100
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
101
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
102
|
+
<url>http://addictedtonew.com</url>
|
103
|
+
<protected>false</protected>
|
104
|
+
<followers_count>486</followers_count>
|
105
|
+
</user>
|
106
|
+
</status>
|
107
|
+
<status>
|
108
|
+
<created_at>Fri Aug 08 14:07:29 +0000 2008</created_at>
|
109
|
+
<id>881522394</id>
|
110
|
+
<text>Listening to U2 "beautiful day" in honor of it being such a beautiful day.</text>
|
111
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
112
|
+
<truncated>false</truncated>
|
113
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
114
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
115
|
+
<favorited></favorited>
|
116
|
+
<user>
|
117
|
+
<id>4243</id>
|
118
|
+
<name>John Nunemaker</name>
|
119
|
+
<screen_name>jnunemaker</screen_name>
|
120
|
+
<location>Mishawaka, IN, US</location>
|
121
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
122
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
123
|
+
<url>http://addictedtonew.com</url>
|
124
|
+
<protected>false</protected>
|
125
|
+
<followers_count>486</followers_count>
|
126
|
+
</user>
|
127
|
+
</status>
|
128
|
+
<status>
|
129
|
+
<created_at>Fri Aug 08 14:06:44 +0000 2008</created_at>
|
130
|
+
<id>881521592</id>
|
131
|
+
<text>@lizsmc1 - hi! (just passed her on the road)</text>
|
132
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
133
|
+
<truncated>false</truncated>
|
134
|
+
<in_reply_to_status_id>881519558</in_reply_to_status_id>
|
135
|
+
<in_reply_to_user_id>11485452</in_reply_to_user_id>
|
136
|
+
<favorited></favorited>
|
137
|
+
<user>
|
138
|
+
<id>4243</id>
|
139
|
+
<name>John Nunemaker</name>
|
140
|
+
<screen_name>jnunemaker</screen_name>
|
141
|
+
<location>Mishawaka, IN, US</location>
|
142
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
143
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
144
|
+
<url>http://addictedtonew.com</url>
|
145
|
+
<protected>false</protected>
|
146
|
+
<followers_count>486</followers_count>
|
147
|
+
</user>
|
148
|
+
</status>
|
149
|
+
<status>
|
150
|
+
<created_at>Fri Aug 08 13:59:35 +0000 2008</created_at>
|
151
|
+
<id>881514030</id>
|
152
|
+
<text>Beautiful day for a motorcycle ride.</text>
|
153
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
154
|
+
<truncated>false</truncated>
|
155
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
156
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
157
|
+
<favorited></favorited>
|
158
|
+
<user>
|
159
|
+
<id>4243</id>
|
160
|
+
<name>John Nunemaker</name>
|
161
|
+
<screen_name>jnunemaker</screen_name>
|
162
|
+
<location>Mishawaka, IN, US</location>
|
163
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
164
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
165
|
+
<url>http://addictedtonew.com</url>
|
166
|
+
<protected>false</protected>
|
167
|
+
<followers_count>486</followers_count>
|
168
|
+
</user>
|
169
|
+
</status>
|
170
|
+
<status>
|
171
|
+
<created_at>Fri Aug 08 13:45:21 +0000 2008</created_at>
|
172
|
+
<id>881499439</id>
|
173
|
+
<text>@lizamc1 - no way! Politos will be missed. I remember eating a whole garlic pizza there with Joe.</text>
|
174
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
175
|
+
<truncated>false</truncated>
|
176
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
177
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
178
|
+
<favorited></favorited>
|
179
|
+
<user>
|
180
|
+
<id>4243</id>
|
181
|
+
<name>John Nunemaker</name>
|
182
|
+
<screen_name>jnunemaker</screen_name>
|
183
|
+
<location>Mishawaka, IN, US</location>
|
184
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
185
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
186
|
+
<url>http://addictedtonew.com</url>
|
187
|
+
<protected>false</protected>
|
188
|
+
<followers_count>486</followers_count>
|
189
|
+
</user>
|
190
|
+
</status>
|
191
|
+
<status>
|
192
|
+
<created_at>Fri Aug 08 13:41:50 +0000 2008</created_at>
|
193
|
+
<id>881496024</id>
|
194
|
+
<text>Riding my motorcyle to campus. Using the library basement for a meeting.</text>
|
195
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
196
|
+
<truncated>false</truncated>
|
197
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
198
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
199
|
+
<favorited></favorited>
|
200
|
+
<user>
|
201
|
+
<id>4243</id>
|
202
|
+
<name>John Nunemaker</name>
|
203
|
+
<screen_name>jnunemaker</screen_name>
|
204
|
+
<location>Mishawaka, IN, US</location>
|
205
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
206
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
207
|
+
<url>http://addictedtonew.com</url>
|
208
|
+
<protected>false</protected>
|
209
|
+
<followers_count>486</followers_count>
|
210
|
+
</user>
|
211
|
+
</status>
|
212
|
+
<status>
|
213
|
+
<created_at>Thu Aug 07 22:52:20 +0000 2008</created_at>
|
214
|
+
<id>880896190</id>
|
215
|
+
<text>Scraping super glue off my finger with a knife.</text>
|
216
|
+
<source>web</source>
|
217
|
+
<truncated>false</truncated>
|
218
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
219
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
220
|
+
<favorited></favorited>
|
221
|
+
<user>
|
222
|
+
<id>4243</id>
|
223
|
+
<name>John Nunemaker</name>
|
224
|
+
<screen_name>jnunemaker</screen_name>
|
225
|
+
<location>Mishawaka, IN, US</location>
|
226
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
227
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
228
|
+
<url>http://addictedtonew.com</url>
|
229
|
+
<protected>false</protected>
|
230
|
+
<followers_count>486</followers_count>
|
231
|
+
</user>
|
232
|
+
</status>
|
233
|
+
<status>
|
234
|
+
<created_at>Thu Aug 07 22:14:35 +0000 2008</created_at>
|
235
|
+
<id>880866160</id>
|
236
|
+
<text>So cold...Starbucks north side, you win the day, but I shall bring a sweatshirt to our next battle!</text>
|
237
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
238
|
+
<truncated>false</truncated>
|
239
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
240
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
241
|
+
<favorited></favorited>
|
242
|
+
<user>
|
243
|
+
<id>4243</id>
|
244
|
+
<name>John Nunemaker</name>
|
245
|
+
<screen_name>jnunemaker</screen_name>
|
246
|
+
<location>Mishawaka, IN, US</location>
|
247
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
248
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
249
|
+
<url>http://addictedtonew.com</url>
|
250
|
+
<protected>false</protected>
|
251
|
+
<followers_count>486</followers_count>
|
252
|
+
</user>
|
253
|
+
</status>
|
254
|
+
<status>
|
255
|
+
<created_at>Thu Aug 07 17:25:40 +0000 2008</created_at>
|
256
|
+
<id>880610064</id>
|
257
|
+
<text>Headed home for a bit to get my headphones and then to the north side to meet @orderedlist.</text>
|
258
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
259
|
+
<truncated>false</truncated>
|
260
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
261
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
262
|
+
<favorited></favorited>
|
263
|
+
<user>
|
264
|
+
<id>4243</id>
|
265
|
+
<name>John Nunemaker</name>
|
266
|
+
<screen_name>jnunemaker</screen_name>
|
267
|
+
<location>Mishawaka, IN, US</location>
|
268
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
269
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
270
|
+
<url>http://addictedtonew.com</url>
|
271
|
+
<protected>false</protected>
|
272
|
+
<followers_count>485</followers_count>
|
273
|
+
</user>
|
274
|
+
</status>
|
275
|
+
<status>
|
276
|
+
<created_at>Thu Aug 07 17:15:59 +0000 2008</created_at>
|
277
|
+
<id>880600278</id>
|
278
|
+
<text>Panera wifi, why do you hate me?</text>
|
279
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
280
|
+
<truncated>false</truncated>
|
281
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
282
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
283
|
+
<favorited></favorited>
|
284
|
+
<user>
|
285
|
+
<id>4243</id>
|
286
|
+
<name>John Nunemaker</name>
|
287
|
+
<screen_name>jnunemaker</screen_name>
|
288
|
+
<location>Mishawaka, IN, US</location>
|
289
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
290
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
291
|
+
<url>http://addictedtonew.com</url>
|
292
|
+
<protected>false</protected>
|
293
|
+
<followers_count>485</followers_count>
|
294
|
+
</user>
|
295
|
+
</status>
|
296
|
+
<status>
|
297
|
+
<created_at>Thu Aug 07 15:46:25 +0000 2008</created_at>
|
298
|
+
<id>880509577</id>
|
299
|
+
<text>At panera. Turned my alarm off this morning and woke up late. Oh well.</text>
|
300
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
301
|
+
<truncated>false</truncated>
|
302
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
303
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
304
|
+
<favorited></favorited>
|
305
|
+
<user>
|
306
|
+
<id>4243</id>
|
307
|
+
<name>John Nunemaker</name>
|
308
|
+
<screen_name>jnunemaker</screen_name>
|
309
|
+
<location>Mishawaka, IN, US</location>
|
310
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
311
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
312
|
+
<url>http://addictedtonew.com</url>
|
313
|
+
<protected>false</protected>
|
314
|
+
<followers_count>485</followers_count>
|
315
|
+
</user>
|
316
|
+
</status>
|
317
|
+
<status>
|
318
|
+
<created_at>Thu Aug 07 15:01:35 +0000 2008</created_at>
|
319
|
+
<id>880463746</id>
|
320
|
+
<text>@kloh I remember days like that. Exhausting. Also, NullRiver said to sync again, uninstall app from phone and then resync app. Evidently ...</text>
|
321
|
+
<source>web</source>
|
322
|
+
<truncated>true</truncated>
|
323
|
+
<in_reply_to_status_id>880432701</in_reply_to_status_id>
|
324
|
+
<in_reply_to_user_id>10193732</in_reply_to_user_id>
|
325
|
+
<favorited></favorited>
|
326
|
+
<user>
|
327
|
+
<id>4243</id>
|
328
|
+
<name>John Nunemaker</name>
|
329
|
+
<screen_name>jnunemaker</screen_name>
|
330
|
+
<location>Mishawaka, IN, US</location>
|
331
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
332
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
333
|
+
<url>http://addictedtonew.com</url>
|
334
|
+
<protected>false</protected>
|
335
|
+
<followers_count>485</followers_count>
|
336
|
+
</user>
|
337
|
+
</status>
|
338
|
+
<status>
|
339
|
+
<created_at>Thu Aug 07 02:52:38 +0000 2008</created_at>
|
340
|
+
<id>879986739</id>
|
341
|
+
<text>@kloh - I haven't updated my OS so I'm wondering how apple could have made the app stop working. I did contact NullRiver support just no ...</text>
|
342
|
+
<source>web</source>
|
343
|
+
<truncated>true</truncated>
|
344
|
+
<in_reply_to_status_id>879980813</in_reply_to_status_id>
|
345
|
+
<in_reply_to_user_id>10193732</in_reply_to_user_id>
|
346
|
+
<favorited></favorited>
|
347
|
+
<user>
|
348
|
+
<id>4243</id>
|
349
|
+
<name>John Nunemaker</name>
|
350
|
+
<screen_name>jnunemaker</screen_name>
|
351
|
+
<location>Mishawaka, IN, US</location>
|
352
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
353
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
354
|
+
<url>http://addictedtonew.com</url>
|
355
|
+
<protected>false</protected>
|
356
|
+
<followers_count>486</followers_count>
|
357
|
+
</user>
|
358
|
+
</status>
|
359
|
+
<status>
|
360
|
+
<created_at>Thu Aug 07 02:38:58 +0000 2008</created_at>
|
361
|
+
<id>879976045</id>
|
362
|
+
<text>@jerry - i went with the pdf download.</text>
|
363
|
+
<source>web</source>
|
364
|
+
<truncated>false</truncated>
|
365
|
+
<in_reply_to_status_id>879878196</in_reply_to_status_id>
|
366
|
+
<in_reply_to_user_id>613</in_reply_to_user_id>
|
367
|
+
<favorited></favorited>
|
368
|
+
<user>
|
369
|
+
<id>4243</id>
|
370
|
+
<name>John Nunemaker</name>
|
371
|
+
<screen_name>jnunemaker</screen_name>
|
372
|
+
<location>Mishawaka, IN, US</location>
|
373
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
374
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
375
|
+
<url>http://addictedtonew.com</url>
|
376
|
+
<protected>false</protected>
|
377
|
+
<followers_count>486</followers_count>
|
378
|
+
</user>
|
379
|
+
</status>
|
380
|
+
<status>
|
381
|
+
<created_at>Thu Aug 07 02:31:26 +0000 2008</created_at>
|
382
|
+
<id>879969851</id>
|
383
|
+
<text>@kloh - it worked at home for multiple tests and just stopped when I acyltually needed it.</text>
|
384
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
385
|
+
<truncated>false</truncated>
|
386
|
+
<in_reply_to_status_id>879968483</in_reply_to_status_id>
|
387
|
+
<in_reply_to_user_id>10193732</in_reply_to_user_id>
|
388
|
+
<favorited></favorited>
|
389
|
+
<user>
|
390
|
+
<id>4243</id>
|
391
|
+
<name>John Nunemaker</name>
|
392
|
+
<screen_name>jnunemaker</screen_name>
|
393
|
+
<location>Mishawaka, IN, US</location>
|
394
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
395
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
396
|
+
<url>http://addictedtonew.com</url>
|
397
|
+
<protected>false</protected>
|
398
|
+
<followers_count>486</followers_count>
|
399
|
+
</user>
|
400
|
+
</status>
|
401
|
+
<status>
|
402
|
+
<created_at>Thu Aug 07 01:18:28 +0000 2008</created_at>
|
403
|
+
<id>879913748</id>
|
404
|
+
<text>Netshare will no longer start up for me. Of course it borks the first time I actually want to use it.</text>
|
405
|
+
<source><a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a></source>
|
406
|
+
<truncated>false</truncated>
|
407
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
408
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
409
|
+
<favorited></favorited>
|
410
|
+
<user>
|
411
|
+
<id>4243</id>
|
412
|
+
<name>John Nunemaker</name>
|
413
|
+
<screen_name>jnunemaker</screen_name>
|
414
|
+
<location>Mishawaka, IN, US</location>
|
415
|
+
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
416
|
+
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
417
|
+
<url>http://addictedtonew.com</url>
|
418
|
+
<protected>false</protected>
|
419
|
+
<followers_count>486</followers_count>
|
420
|
+
</user>
|
421
|
+
</status>
|
422
|
+
</statuses>
|
data/test/helper.rb
CHANGED
data/test/html/test_document.rb
CHANGED
@@ -12,6 +12,38 @@ module Nokogiri
|
|
12
12
|
assert html.html?
|
13
13
|
end
|
14
14
|
|
15
|
+
def test_inner_text
|
16
|
+
html = Nokogiri::HTML(<<-eohtml)
|
17
|
+
<html>
|
18
|
+
<body>
|
19
|
+
<div>
|
20
|
+
<p>
|
21
|
+
Hello world!
|
22
|
+
</p>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
26
|
+
eohtml
|
27
|
+
node = html.xpath('//div').first
|
28
|
+
assert_equal('Hello world!', node.inner_text.strip)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_inner_html
|
32
|
+
html = Nokogiri::HTML(<<-eohtml)
|
33
|
+
<html>
|
34
|
+
<body>
|
35
|
+
<div>
|
36
|
+
<p>
|
37
|
+
Hello world!
|
38
|
+
</p>
|
39
|
+
</div>
|
40
|
+
</body>
|
41
|
+
</html>
|
42
|
+
eohtml
|
43
|
+
node = html.xpath('//div').first
|
44
|
+
assert_equal('<p>Helloworld!</p>', node.inner_html.gsub(/\s/, ''))
|
45
|
+
end
|
46
|
+
|
15
47
|
def test_fragment
|
16
48
|
node_set = Nokogiri::HTML.fragment(<<-eohtml)
|
17
49
|
<div>
|
data/test/test_gc.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
|
2
|
+
|
3
|
+
class TestGc < Nokogiri::TestCase
|
4
|
+
|
5
|
+
def test_dont_hurt_em_why
|
6
|
+
content = File.open("#{File.dirname(__FILE__)}/files/dont_hurt_em_why.xml").read
|
7
|
+
ndoc = Nokogiri::XML(content)
|
8
|
+
2.times do
|
9
|
+
info = ndoc.search('status text').first.inner_text
|
10
|
+
url = ndoc.search('user name').first.inner_text
|
11
|
+
GC.start
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/test/xml/test_document.rb
CHANGED
@@ -12,6 +12,13 @@ module Nokogiri
|
|
12
12
|
assert xml.xml?
|
13
13
|
end
|
14
14
|
|
15
|
+
def test_document_parent
|
16
|
+
xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
|
17
|
+
assert_raises(NoMethodError) {
|
18
|
+
xml.parent
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
15
22
|
def test_document_name
|
16
23
|
xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
|
17
24
|
assert_equal 'document', xml.name
|
data/test/xml/test_node_set.rb
CHANGED
@@ -17,6 +17,13 @@ module Nokogiri
|
|
17
17
|
assert_equal node_set.first, node_set.at(0)
|
18
18
|
end
|
19
19
|
|
20
|
+
def test_to_ary
|
21
|
+
assert node_set = @xml.search('//employee')
|
22
|
+
foo = []
|
23
|
+
foo += node_set
|
24
|
+
assert_equal node_set.length, foo.length
|
25
|
+
end
|
26
|
+
|
20
27
|
def test_push
|
21
28
|
node = Nokogiri::XML::Node.new('foo')
|
22
29
|
node.content = 'bar'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: x86-mswin32-60
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-04 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -114,11 +114,11 @@ files:
|
|
114
114
|
- lib/nokogiri/xml/xpath_context.rb
|
115
115
|
- lib/nokogiri/xslt.rb
|
116
116
|
- lib/nokogiri/xslt/stylesheet.rb
|
117
|
-
- nokogiri.gemspec
|
118
117
|
- test/css/test_nthiness.rb
|
119
118
|
- test/css/test_parser.rb
|
120
119
|
- test/css/test_tokenizer.rb
|
121
120
|
- test/css/test_xpath_visitor.rb
|
121
|
+
- test/files/dont_hurt_em_why.xml
|
122
122
|
- test/files/staff.xml
|
123
123
|
- test/files/staff.xslt
|
124
124
|
- test/files/tlm.html
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- test/html/test_builder.rb
|
145
145
|
- test/html/test_document.rb
|
146
146
|
- test/test_convert_xpath.rb
|
147
|
+
- test/test_gc.rb
|
147
148
|
- test/test_nokogiri.rb
|
148
149
|
- test/test_reader.rb
|
149
150
|
- test/test_xslt_transforms.rb
|
@@ -204,6 +205,7 @@ test_files:
|
|
204
205
|
- test/html/test_builder.rb
|
205
206
|
- test/html/test_document.rb
|
206
207
|
- test/test_convert_xpath.rb
|
208
|
+
- test/test_gc.rb
|
207
209
|
- test/test_nokogiri.rb
|
208
210
|
- test/test_reader.rb
|
209
211
|
- test/test_xslt_transforms.rb
|
data/nokogiri.gemspec
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = %q{nokogiri}
|
3
|
-
s.version = "1.0.0"
|
4
|
-
s.platform = %q{x86-mswin32-60}
|
5
|
-
|
6
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
7
|
-
s.authors = ["Aaron Patterson"]
|
8
|
-
s.date = %q{2008-10-30}
|
9
|
-
s.description = %q{Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser.}
|
10
|
-
s.email = ["aaronp@rubyforge.org"]
|
11
|
-
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.ja.txt", "README.txt"]
|
12
|
-
s.files = ["History.txt", "Manifest.txt", "README.ja.txt", "README.txt", "Rakefile", "ext/nokogiri/extconf.rb", "ext/nokogiri/html_document.c", "ext/nokogiri/html_document.h", "ext/nokogiri/html_sax_parser.c", "ext/nokogiri/html_sax_parser.h", "ext/nokogiri/native.c", "ext/nokogiri/native.h", "ext/nokogiri/xml_cdata.c", "ext/nokogiri/xml_cdata.h", "ext/nokogiri/xml_document.c", "ext/nokogiri/xml_document.h", "ext/nokogiri/xml_dtd.c", "ext/nokogiri/xml_dtd.h", "ext/nokogiri/xml_node.c", "ext/nokogiri/xml_node.h", "ext/nokogiri/xml_node_set.c", "ext/nokogiri/xml_node_set.h", "ext/nokogiri/xml_reader.c", "ext/nokogiri/xml_reader.h", "ext/nokogiri/xml_sax_parser.c", "ext/nokogiri/xml_sax_parser.h", "ext/nokogiri/xml_syntax_error.c", "ext/nokogiri/xml_syntax_error.h", "ext/nokogiri/xml_text.c", "ext/nokogiri/xml_text.h", "ext/nokogiri/xml_xpath.c", "ext/nokogiri/xml_xpath.h", "ext/nokogiri/xml_xpath_context.c", "ext/nokogiri/xml_xpath_context.h", "ext/nokogiri/xslt_stylesheet.c", "ext/nokogiri/xslt_stylesheet.h", "lib/nokogiri.rb", "lib/nokogiri/css.rb", "lib/nokogiri/css/generated_parser.rb", "lib/nokogiri/css/generated_tokenizer.rb", "lib/nokogiri/css/node.rb", "lib/nokogiri/css/parser.rb", "lib/nokogiri/css/parser.y", "lib/nokogiri/css/tokenizer.rb", "lib/nokogiri/css/tokenizer.rex", "lib/nokogiri/css/xpath_visitor.rb", "lib/nokogiri/decorators.rb", "lib/nokogiri/decorators/hpricot.rb", "lib/nokogiri/decorators/hpricot/node.rb", "lib/nokogiri/decorators/hpricot/node_set.rb", "lib/nokogiri/decorators/hpricot/xpath_visitor.rb", "lib/nokogiri/hpricot.rb", "lib/nokogiri/html.rb", "lib/nokogiri/html/builder.rb", "lib/nokogiri/html/document.rb", "lib/nokogiri/html/sax/parser.rb", "lib/nokogiri/version.rb", "lib/nokogiri/xml.rb", "lib/nokogiri/xml/after_handler.rb", "lib/nokogiri/xml/before_handler.rb", "lib/nokogiri/xml/builder.rb", "lib/nokogiri/xml/cdata.rb", "lib/nokogiri/xml/document.rb", "lib/nokogiri/xml/dtd.rb", "lib/nokogiri/xml/element.rb", "lib/nokogiri/xml/entity_declaration.rb", "lib/nokogiri/xml/node.rb", "lib/nokogiri/xml/node_set.rb", "lib/nokogiri/xml/notation.rb", "lib/nokogiri/xml/reader.rb", "lib/nokogiri/xml/sax.rb", "lib/nokogiri/xml/sax/document.rb", "lib/nokogiri/xml/sax/parser.rb", "lib/nokogiri/xml/syntax_error.rb", "lib/nokogiri/xml/text.rb", "lib/nokogiri/xml/xpath.rb", "lib/nokogiri/xml/xpath_context.rb", "lib/nokogiri/xslt.rb", "lib/nokogiri/xslt/stylesheet.rb", "nokogiri.gemspec", "test/css/test_nthiness.rb", "test/css/test_parser.rb", "test/css/test_tokenizer.rb", "test/css/test_xpath_visitor.rb", "test/files/staff.xml", "test/files/staff.xslt", "test/files/tlm.html", "test/helper.rb", "test/hpricot/files/basic.xhtml", "test/hpricot/files/boingboing.html", "test/hpricot/files/cy0.html", "test/hpricot/files/immob.html", "test/hpricot/files/pace_application.html", "test/hpricot/files/tenderlove.html", "test/hpricot/files/uswebgen.html", "test/hpricot/files/utf8.html", "test/hpricot/files/week9.html", "test/hpricot/files/why.xml", "test/hpricot/load_files.rb", "test/hpricot/test_alter.rb", "test/hpricot/test_builder.rb", "test/hpricot/test_parser.rb", "test/hpricot/test_paths.rb", "test/hpricot/test_preserved.rb", "test/hpricot/test_xml.rb", "test/html/sax/test_parser.rb", "test/html/test_builder.rb", "test/html/test_document.rb", "test/test_convert_xpath.rb", "test/test_nokogiri.rb", "test/test_reader.rb", "test/test_xslt_transforms.rb", "test/xml/sax/test_parser.rb", "test/xml/test_builder.rb", "test/xml/test_cdata.rb", "test/xml/test_document.rb", "test/xml/test_dtd.rb", "test/xml/test_node.rb", "test/xml/test_node_set.rb", "test/xml/test_text.rb", "ext/nokogiri/iconv.dll", "ext/nokogiri/libexslt.dll", "ext/nokogiri/libxml2.dll", "ext/nokogiri/libxslt.dll", "ext/nokogiri/zlib1.dll", "ext/nokogiri/native.so"]
|
13
|
-
s.has_rdoc = true
|
14
|
-
s.homepage = %q{http://nokogiri.rubyforge.org/}
|
15
|
-
s.rdoc_options = ["--main", "README.txt"]
|
16
|
-
s.require_paths = ["lib", "ext"]
|
17
|
-
s.rubyforge_project = %q{nokogiri}
|
18
|
-
s.rubygems_version = %q{1.2.0}
|
19
|
-
s.summary = %q{Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser.}
|
20
|
-
s.test_files = ["test/css/test_nthiness.rb", "test/css/test_parser.rb", "test/css/test_tokenizer.rb", "test/css/test_xpath_visitor.rb", "test/hpricot/test_alter.rb", "test/hpricot/test_builder.rb", "test/hpricot/test_parser.rb", "test/hpricot/test_paths.rb", "test/hpricot/test_preserved.rb", "test/hpricot/test_xml.rb", "test/html/sax/test_parser.rb", "test/html/test_builder.rb", "test/html/test_document.rb", "test/test_convert_xpath.rb", "test/test_nokogiri.rb", "test/test_reader.rb", "test/test_xslt_transforms.rb", "test/xml/sax/test_parser.rb", "test/xml/test_builder.rb", "test/xml/test_cdata.rb", "test/xml/test_document.rb", "test/xml/test_dtd.rb", "test/xml/test_node.rb", "test/xml/test_node_set.rb", "test/xml/test_text.rb"]
|
21
|
-
|
22
|
-
if s.respond_to? :specification_version then
|
23
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
-
s.specification_version = 2
|
25
|
-
|
26
|
-
if current_version >= 3 then
|
27
|
-
s.add_development_dependency(%q<hoe>, [">= 1.7.0"])
|
28
|
-
else
|
29
|
-
s.add_dependency(%q<hoe>, [">= 1.7.0"])
|
30
|
-
end
|
31
|
-
else
|
32
|
-
s.add_dependency(%q<hoe>, [">= 1.7.0"])
|
33
|
-
end
|
34
|
-
end
|