libxslt-ruby 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +161 -154
- data/LICENSE +21 -21
- data/README.rdoc +170 -160
- data/Rakefile +90 -90
- data/ext/libxslt/extconf.h +6 -0
- data/ext/libxslt/extconf.rb +112 -157
- data/ext/libxslt/libxslt.c +68 -69
- data/ext/libxslt/libxslt.h +37 -37
- data/ext/libxslt/ruby_exslt.c +149 -149
- data/ext/libxslt/ruby_exslt.h +8 -8
- data/ext/libxslt/ruby_xslt_stylesheet.c +302 -302
- data/ext/libxslt/ruby_xslt_stylesheet.h +10 -10
- data/ext/libxslt/version.h +5 -5
- data/ext/vc/libxslt_ruby.sln +12 -8
- data/ext/vc/libxslt_ruby.vcxproj +87 -3
- data/lib/libxslt-ruby.rb +14 -0
- data/lib/libxslt.rb +3 -16
- data/lib/libxslt/stylesheet.rb +32 -30
- data/lib/xslt.rb +15 -15
- data/libxslt-ruby.gemspec +45 -43
- data/setup.rb +1585 -1585
- data/test/files/commentary.dtd +34 -34
- data/test/files/fuzface.xml +154 -154
- data/test/files/fuzface.xsl +4 -4
- data/test/files/params.xml +2 -2
- data/test/files/params.xsl +10 -10
- data/test/files/ramblings.xsl +46 -46
- data/test/test_exslt.rb +69 -70
- data/test/test_helper.rb +5 -15
- data/test/test_libxslt.rb +20 -22
- data/test/test_stylesheet.rb +213 -214
- metadata +34 -10
- data/lib/libxslt/deprecated.rb +0 -68
- data/test/test_deprecated.rb +0 -100
- data/test/test_suite.rb +0 -11
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libxslt-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Savage
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libxml-ruby
|
@@ -24,6 +24,34 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.4.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rake-compiler
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,6 +79,7 @@ files:
|
|
51
79
|
- LICENSE
|
52
80
|
- README.rdoc
|
53
81
|
- Rakefile
|
82
|
+
- ext/libxslt/extconf.h
|
54
83
|
- ext/libxslt/extconf.rb
|
55
84
|
- ext/libxslt/libxslt.c
|
56
85
|
- ext/libxslt/libxslt.h
|
@@ -61,8 +90,8 @@ files:
|
|
61
90
|
- ext/libxslt/version.h
|
62
91
|
- ext/vc/libxslt_ruby.sln
|
63
92
|
- ext/vc/libxslt_ruby.vcxproj
|
93
|
+
- lib/libxslt-ruby.rb
|
64
94
|
- lib/libxslt.rb
|
65
|
-
- lib/libxslt/deprecated.rb
|
66
95
|
- lib/libxslt/stylesheet.rb
|
67
96
|
- lib/xslt.rb
|
68
97
|
- libxslt-ruby.gemspec
|
@@ -73,12 +102,10 @@ files:
|
|
73
102
|
- test/files/params.xml
|
74
103
|
- test/files/params.xsl
|
75
104
|
- test/files/ramblings.xsl
|
76
|
-
- test/test_deprecated.rb
|
77
105
|
- test/test_exslt.rb
|
78
106
|
- test/test_helper.rb
|
79
107
|
- test/test_libxslt.rb
|
80
108
|
- test/test_stylesheet.rb
|
81
|
-
- test/test_suite.rb
|
82
109
|
homepage: http://libxslt.rubyforge.org/
|
83
110
|
licenses: []
|
84
111
|
metadata: {}
|
@@ -91,22 +118,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
118
|
requirements:
|
92
119
|
- - ">="
|
93
120
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
121
|
+
version: 2.5.0
|
95
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
123
|
requirements:
|
97
124
|
- - ">="
|
98
125
|
- !ruby/object:Gem::Version
|
99
126
|
version: '0'
|
100
127
|
requirements: []
|
101
|
-
|
102
|
-
rubygems_version: 2.2.2
|
128
|
+
rubygems_version: 3.1.2
|
103
129
|
signing_key:
|
104
130
|
specification_version: 4
|
105
131
|
summary: Ruby libxslt bindings
|
106
132
|
test_files:
|
107
|
-
- test/test_deprecated.rb
|
108
133
|
- test/test_exslt.rb
|
109
134
|
- test/test_helper.rb
|
110
135
|
- test/test_libxslt.rb
|
111
136
|
- test/test_stylesheet.rb
|
112
|
-
- test/test_suite.rb
|
data/lib/libxslt/deprecated.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# :enddoc:
|
3
|
-
# These classes provide provide backwards compatibility with
|
4
|
-
# versions of libxslt-ruby prior to version 0.7.0
|
5
|
-
|
6
|
-
module LibXML
|
7
|
-
module XML
|
8
|
-
module XSLT
|
9
|
-
MAX_DEPTH = LibXSLT::XSLT::MAX_DEPTH
|
10
|
-
MAX_SORT = LibXSLT::XSLT::MAX_SORT
|
11
|
-
ENGINE_VERSION = LibXSLT::XSLT::ENGINE_VERSION
|
12
|
-
LIBXSLT_VERSION = LibXSLT::XSLT::LIBXSLT_VERSION
|
13
|
-
LIBXML_VERSION = LibXSLT::XSLT::LIBXML_VERSION
|
14
|
-
XSLT_NAMESPACE = LibXSLT::XSLT::XSLT_NAMESPACE
|
15
|
-
DEFAULT_VENDOR = LibXSLT::XSLT::DEFAULT_VENDOR
|
16
|
-
DEFAULT_VERSION = LibXSLT::XSLT::DEFAULT_VERSION
|
17
|
-
DEFAULT_URL = LibXSLT::XSLT::DEFAULT_URL
|
18
|
-
NAMESPACE_LIBXSLT = LibXSLT::XSLT::NAMESPACE_LIBXSLT
|
19
|
-
NAMESPACE_NORM_SAXON = LibXSLT::XSLT::NAMESPACE_NORM_SAXON
|
20
|
-
NAMESPACE_SAXON = LibXSLT::XSLT::NAMESPACE_SAXON
|
21
|
-
NAMESPACE_XT = LibXSLT::XSLT::NAMESPACE_XT
|
22
|
-
NAMESPACE_XALAN = LibXSLT::XSLT::NAMESPACE_XALAN
|
23
|
-
|
24
|
-
def self.new
|
25
|
-
Stylesheet.new(nil)
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.file(filename)
|
29
|
-
doc = ::LibXML::XML::Document.file(filename)
|
30
|
-
stylesheet = LibXSLT::XSLT::Stylesheet.new(doc)
|
31
|
-
|
32
|
-
result = Stylesheet.new(stylesheet)
|
33
|
-
result.filename = filename
|
34
|
-
result
|
35
|
-
end
|
36
|
-
|
37
|
-
class Stylesheet
|
38
|
-
attr_accessor :doc, :filename
|
39
|
-
|
40
|
-
def initialize(stylesheet)
|
41
|
-
@stylesheet = stylesheet
|
42
|
-
end
|
43
|
-
|
44
|
-
def filename=(value)
|
45
|
-
@doc = ::LibXML::XML::Document.file(value)
|
46
|
-
@filename = value
|
47
|
-
end
|
48
|
-
|
49
|
-
def parse
|
50
|
-
self
|
51
|
-
end
|
52
|
-
|
53
|
-
def apply
|
54
|
-
@result = @stylesheet.apply(@doc)
|
55
|
-
end
|
56
|
-
|
57
|
-
def save(filename)
|
58
|
-
raise(ArgumentError) unless @result
|
59
|
-
@result.save(filename)
|
60
|
-
end
|
61
|
-
|
62
|
-
def print(filename)
|
63
|
-
raise(ArgumentError) unless @result
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
data/test/test_deprecated.rb
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
require 'test_helper'
|
3
|
-
require 'test/unit'
|
4
|
-
|
5
|
-
class TestDeprecated < Test::Unit::TestCase
|
6
|
-
def setup()
|
7
|
-
xsl_file = File.join(File.dirname(__FILE__), 'files/fuzface.xsl')
|
8
|
-
xml_file = File.join(File.dirname(__FILE__), 'files/fuzface.xml')
|
9
|
-
|
10
|
-
@xslt = XML::XSLT.file(xsl_file)
|
11
|
-
@xslt.doc = XML::Document.file(xml_file)
|
12
|
-
@stylesheet = @xslt.parse
|
13
|
-
end
|
14
|
-
|
15
|
-
def tear_down()
|
16
|
-
@xslt = nil
|
17
|
-
@stylesheet = nil
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_constants
|
21
|
-
assert_instance_of(Fixnum, XML::XSLT::MAX_DEPTH)
|
22
|
-
assert_instance_of(Fixnum, XML::XSLT::MAX_SORT)
|
23
|
-
assert_instance_of(String, XML::XSLT::ENGINE_VERSION)
|
24
|
-
assert_instance_of(Fixnum, XML::XSLT::LIBXSLT_VERSION)
|
25
|
-
assert_instance_of(Fixnum, XML::XSLT::LIBXML_VERSION)
|
26
|
-
assert_instance_of(String, XML::XSLT::XSLT_NAMESPACE)
|
27
|
-
assert_instance_of(String, XML::XSLT::DEFAULT_URL)
|
28
|
-
assert_instance_of(String, XML::XSLT::DEFAULT_VENDOR)
|
29
|
-
assert_instance_of(String, XML::XSLT::DEFAULT_VERSION)
|
30
|
-
assert_instance_of(String, XML::XSLT::NAMESPACE_LIBXSLT)
|
31
|
-
assert_instance_of(String, XML::XSLT::NAMESPACE_SAXON)
|
32
|
-
assert_instance_of(String, XML::XSLT::NAMESPACE_XT)
|
33
|
-
assert_instance_of(String, XML::XSLT::NAMESPACE_XALAN)
|
34
|
-
assert_instance_of(String, XML::XSLT::NAMESPACE_NORM_SAXON)
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_new
|
38
|
-
xslt = XML::XSLT.new
|
39
|
-
assert_instance_of(XML::XSLT::Stylesheet, xslt)
|
40
|
-
|
41
|
-
xslt.filename = File.join(File.dirname(__FILE__), 'files/fuzface.xsl')
|
42
|
-
assert_instance_of(String, xslt.filename)
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_file_type
|
46
|
-
assert_instance_of(XML::XSLT::Stylesheet, @xslt)
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_doc
|
50
|
-
xsl_file = File.join(File.dirname(__FILE__), 'files/fuzface.xsl')
|
51
|
-
xml_file = File.join(File.dirname(__FILE__), 'files/fuzface.xml')
|
52
|
-
|
53
|
-
xslt = XML::XSLT.file(xsl_file)
|
54
|
-
xslt.doc = XML::Document.file(xml_file)
|
55
|
-
assert_instance_of(XML::Document, xslt.doc)
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_parse
|
59
|
-
xsl_file = File.join(File.dirname(__FILE__), 'files/fuzface.xsl')
|
60
|
-
xml_file = File.join(File.dirname(__FILE__), 'files/fuzface.xml')
|
61
|
-
|
62
|
-
xslt = XML::XSLT.file(xsl_file)
|
63
|
-
stylesheet = xslt.parse
|
64
|
-
assert_instance_of(XML::XSLT::Stylesheet, stylesheet)
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_parse
|
68
|
-
assert_instance_of(XML::XSLT::Stylesheet, @stylesheet)
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_to_s
|
72
|
-
@stylesheet.apply
|
73
|
-
str = @stylesheet.to_s
|
74
|
-
assert_instance_of(String, str)
|
75
|
-
end
|
76
|
-
|
77
|
-
def test_save
|
78
|
-
@stylesheet.apply
|
79
|
-
@stylesheet.save(file = 'text.xml')
|
80
|
-
ensure
|
81
|
-
File.unlink(file) if file && File.exist?(file)
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_print_invalid
|
85
|
-
@stylesheet.apply
|
86
|
-
@stylesheet.print
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_save_invalid
|
90
|
-
assert_raises(ArgumentError) do
|
91
|
-
@stylesheet.save("str")
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_print_invalid
|
96
|
-
assert_raises(ArgumentError) do
|
97
|
-
@stylesheet.print
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
data/test/test_suite.rb
DELETED