libxml-ext 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +2 -2
- data/lib/libxml/ext/find_mixin.rb +2 -2
- data/lib/libxml/ext/version.rb +1 -1
- metadata +16 -11
- data/lib/libxml/ext/namespaces.rb +0 -16
- data/lib/libxml/ext/namespaces_mixin.rb +0 -61
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== VERSION
|
4
4
|
|
5
|
-
This documentation refers to libxml-ext version 0.3.
|
5
|
+
This documentation refers to libxml-ext version 0.3.2
|
6
6
|
|
7
7
|
|
8
8
|
== DESCRIPTION
|
@@ -26,7 +26,7 @@ Rubyforge project (old):: <http://rubyforge.org/projects/prometheus>
|
|
26
26
|
|
27
27
|
== LICENSE AND COPYRIGHT
|
28
28
|
|
29
|
-
Copyright (C) 2007-
|
29
|
+
Copyright (C) 2007-2011 Jens Wille
|
30
30
|
|
31
31
|
libxml-ext is free software: you can redistribute it and/or modify it under
|
32
32
|
the terms of the GNU General Public License as published by the Free Software
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# #
|
4
4
|
# A component of libxml-ext, the LibXML extensions. #
|
5
5
|
# #
|
6
|
-
# Copyright (C) 2007-
|
6
|
+
# Copyright (C) 2007-2011 Jens Wille #
|
7
7
|
# #
|
8
8
|
# Authors: #
|
9
9
|
# Jens Wille <jens.wille@uni-koeln.de> #
|
@@ -29,7 +29,7 @@ module LibXML
|
|
29
29
|
module Find
|
30
30
|
|
31
31
|
def xfind(xpath)
|
32
|
-
find(xpath.gsub(
|
32
|
+
find(xpath.gsub('**', 'descendant::node()'))
|
33
33
|
end
|
34
34
|
|
35
35
|
alias_method :[], :xfind
|
data/lib/libxml/ext/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libxml-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Jens Wille
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
+
date: 2011-01-24 00:00:00 +01:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: libxml-ruby
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 61
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
- 9
|
@@ -43,11 +46,9 @@ extra_rdoc_files:
|
|
43
46
|
- README
|
44
47
|
files:
|
45
48
|
- lib/libxml/ext/find.rb
|
46
|
-
- lib/libxml/ext/namespaces_mixin.rb
|
47
49
|
- lib/libxml/ext/version.rb
|
48
50
|
- lib/libxml/ext/find_mixin.rb
|
49
51
|
- lib/libxml/ext/uniq_mixin.rb
|
50
|
-
- lib/libxml/ext/namespaces.rb
|
51
52
|
- lib/libxml/ext/string.rb
|
52
53
|
- lib/libxml/ext/uniq.rb
|
53
54
|
- lib/libxml/ext.rb
|
@@ -63,35 +64,39 @@ licenses: []
|
|
63
64
|
|
64
65
|
post_install_message:
|
65
66
|
rdoc_options:
|
66
|
-
- --
|
67
|
-
-
|
67
|
+
- --line-numbers
|
68
|
+
- --inline-source
|
68
69
|
- --title
|
69
70
|
- libxml-ext Application documentation
|
70
71
|
- --main
|
71
72
|
- README
|
72
|
-
- --
|
73
|
-
-
|
73
|
+
- --charset
|
74
|
+
- UTF-8
|
74
75
|
- --all
|
75
76
|
require_paths:
|
76
77
|
- lib
|
77
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
78
80
|
requirements:
|
79
81
|
- - ">="
|
80
82
|
- !ruby/object:Gem::Version
|
83
|
+
hash: 3
|
81
84
|
segments:
|
82
85
|
- 0
|
83
86
|
version: "0"
|
84
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
85
89
|
requirements:
|
86
90
|
- - ">="
|
87
91
|
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
88
93
|
segments:
|
89
94
|
- 0
|
90
95
|
version: "0"
|
91
96
|
requirements: []
|
92
97
|
|
93
98
|
rubyforge_project:
|
94
|
-
rubygems_version: 1.
|
99
|
+
rubygems_version: 1.4.2
|
95
100
|
signing_key:
|
96
101
|
specification_version: 3
|
97
102
|
summary: LibXML extensions
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'libxml'
|
2
|
-
require 'libxml/ext/namespaces_mixin'
|
3
|
-
|
4
|
-
[LibXML::XML::Document].each { |klass|
|
5
|
-
klass.send :include, LibXML::Ext::Namespaces
|
6
|
-
}
|
7
|
-
|
8
|
-
class LibXML::XML::Node
|
9
|
-
def namespaces
|
10
|
-
@namespaces ||= LibXML::XML::Document.namespaces[doc.url]
|
11
|
-
end
|
12
|
-
|
13
|
-
def namespaces=(ns)
|
14
|
-
@namespaces = ns
|
15
|
-
end
|
16
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
###############################################################################
|
3
|
-
# #
|
4
|
-
# A component of libxml-ext, the LibXML extensions. #
|
5
|
-
# #
|
6
|
-
# Copyright (C) 2007-2010 Jens Wille #
|
7
|
-
# #
|
8
|
-
# Authors: #
|
9
|
-
# Jens Wille <jens.wille@uni-koeln.de> #
|
10
|
-
# #
|
11
|
-
# libxml-ext is free software; you can redistribute it and/or modify it #
|
12
|
-
# under the terms of the GNU General Public License as published by the Free #
|
13
|
-
# Software Foundation; either version 3 of the License, or (at your option) #
|
14
|
-
# any later version. #
|
15
|
-
# #
|
16
|
-
# libxml-ext is distributed in the hope that it will be useful, but WITHOUT #
|
17
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
18
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
19
|
-
# more details. #
|
20
|
-
# #
|
21
|
-
# You should have received a copy of the GNU General Public License along #
|
22
|
-
# with libxml-ext. If not, see <http://www.gnu.org/licenses/>. #
|
23
|
-
# #
|
24
|
-
###############################################################################
|
25
|
-
#++
|
26
|
-
|
27
|
-
module LibXML
|
28
|
-
module Ext
|
29
|
-
module Namespaces
|
30
|
-
|
31
|
-
def namespaces
|
32
|
-
@namespaces ||= self.class::DEFAULT_NAMESPACES
|
33
|
-
end
|
34
|
-
|
35
|
-
def namespaces=(ns)
|
36
|
-
if url
|
37
|
-
@namespaces = self.class.namespaces[url] = ns
|
38
|
-
else
|
39
|
-
raise "can't set namespaces (document has no URL)"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.included(base)
|
44
|
-
base.const_set(:DEFAULT_NAMESPACES, [])
|
45
|
-
|
46
|
-
# container for XML::Node's access to its document's namespaces
|
47
|
-
base.instance_variable_set(
|
48
|
-
:@namespaces, Hash.new(base.const_get(:DEFAULT_NAMESPACES))
|
49
|
-
)
|
50
|
-
|
51
|
-
class << base; attr_reader :namespaces; end
|
52
|
-
|
53
|
-
# overwrite original methods
|
54
|
-
instance_methods.each { |method|
|
55
|
-
base.send(:define_method, method, instance_method(method))
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|