xpather 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/xpather/xpather.c +8 -8
- metadata +3 -3
data/ext/xpather/xpather.c
CHANGED
@@ -19,7 +19,7 @@ VALUE search(VALUE self, VALUE xpathExpr)
|
|
19
19
|
xmlNodePtr cur;
|
20
20
|
int size;
|
21
21
|
int i;
|
22
|
-
|
22
|
+
|
23
23
|
Data_Get_Struct(self, xmlDoc, doc);
|
24
24
|
|
25
25
|
xpathCtx = xmlXPathNewContext(doc);
|
@@ -34,7 +34,7 @@ VALUE search(VALUE self, VALUE xpathExpr)
|
|
34
34
|
xmlXPathFreeContext(xpathCtx);
|
35
35
|
return Qnil;
|
36
36
|
}
|
37
|
-
|
37
|
+
|
38
38
|
nodes = xpathObj->nodesetval;
|
39
39
|
size = (nodes) ? nodes->nodeNr : 0;
|
40
40
|
|
@@ -49,28 +49,28 @@ VALUE search(VALUE self, VALUE xpathExpr)
|
|
49
49
|
|
50
50
|
xmlXPathFreeObject(xpathObj);
|
51
51
|
xmlXPathFreeContext(xpathCtx);
|
52
|
-
|
52
|
+
|
53
53
|
return results;
|
54
54
|
}
|
55
55
|
|
56
|
-
static VALUE initialize(VALUE self, VALUE filename)
|
56
|
+
static VALUE initialize(VALUE self, VALUE filename)
|
57
57
|
{
|
58
58
|
rb_iv_set(self, "@filename", filename);
|
59
59
|
return self;
|
60
60
|
}
|
61
61
|
|
62
|
-
static VALUE filename(VALUE self)
|
62
|
+
static VALUE filename(VALUE self)
|
63
63
|
{
|
64
64
|
return rb_iv_get(self, "@filename");
|
65
65
|
}
|
66
66
|
|
67
|
-
VALUE constructor(VALUE self, VALUE filename)
|
67
|
+
VALUE constructor(VALUE self, VALUE filename)
|
68
68
|
{
|
69
|
-
xmlDocPtr doc;
|
69
|
+
xmlDocPtr doc;
|
70
70
|
VALUE argv[1];
|
71
71
|
VALUE t_data;
|
72
72
|
|
73
|
-
doc =
|
73
|
+
doc = xmlParseMemory(StringValueCStr(filename), strlen(StringValueCStr(filename)));
|
74
74
|
if (doc == NULL) {
|
75
75
|
fprintf(stderr, "Error: unable to parse file \"%s\"\n", StringValueCStr(filename));
|
76
76
|
return -1;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xpather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Quick and painless XPath searching for Ruby using libxml2
|
15
15
|
email:
|
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
45
|
rubyforge_project: xpather
|
46
|
-
rubygems_version: 1.8.
|
46
|
+
rubygems_version: 1.8.24
|
47
47
|
signing_key:
|
48
48
|
specification_version: 3
|
49
49
|
summary: Quick and painless XPath searching for Ruby
|