libxslt-ruby 0.8.0 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,6 +28,7 @@
28
28
  <a href="files/ext/libxslt/ruby_xslt_transform_context_c.html">ext/libxslt/ruby_xslt_transform_context.c</a><br />
29
29
  <a href="files/lib/libxslt_rb.html">lib/libxslt.rb</a><br />
30
30
  <a href="files/lib/libxslt/deprecated_rb.html">lib/libxslt/deprecated.rb</a><br />
31
+ <a href="files/lib/xslt_rb.html">lib/xslt.rb</a><br />
31
32
  </div>
32
33
  </div>
33
34
  </body>
@@ -1,5 +1,5 @@
1
- #define RUBY_LIBXSLT_VERSION "0.8.0"
1
+ #define RUBY_LIBXSLT_VERSION "0.8.2"
2
2
  #define RUBY_LIBXSLT_VERNUM 0
3
3
  #define RUBY_LIBXSLT_VER_MAJ 0
4
4
  #define RUBY_LIBXSLT_VER_MIN 8
5
- #define RUBY_LIBXSLT_VER_MIC 0
5
+ #define RUBY_LIBXSLT_VER_MIC 2
@@ -0,0 +1,42 @@
1
+ # We can't use Ruby's standard build procedures
2
+ # on Windows because the Ruby executable is
3
+ # built with VC++ while here we want to build
4
+ # with MingW. So just roll our own...
5
+
6
+ require 'rubygems'
7
+ require 'rake/clean'
8
+ require 'rbconfig'
9
+
10
+ RUBY_INCLUDE_DIR = Config::CONFIG["archdir"]
11
+ RUBY_BIN_DIR = Config::CONFIG["bindir"]
12
+ RUBY_LIB_DIR = Config::CONFIG["libdir"]
13
+ RUBY_SHARED_LIB = Config::CONFIG["LIBRUBY"]
14
+ RUBY_SHARED_DLL = RUBY_SHARED_LIB.gsub(/lib$/, 'dll')
15
+
16
+ EXTENSION_NAME = "libxslt_ruby.#{Config::CONFIG['DLEXT']}"
17
+
18
+ gem_specs = Gem::SourceIndex.from_installed_gems.search('libxml-ruby')
19
+ LIBXML_RUBY_DIR = gem_specs.sort_by {|spec| spec.version}.reverse.first.full_gem_path
20
+
21
+ CLEAN.include('*.o')
22
+ CLOBBER.include('libxslt.so')
23
+
24
+ task :default => "libxslt"
25
+
26
+ SRC = FileList['../libxslt/*.c']
27
+ OBJ = SRC.collect do |file_name|
28
+ File.basename(file_name).ext('o')
29
+ end
30
+
31
+ SRC.each do |srcfile|
32
+ objfile = File.basename(srcfile).ext('o')
33
+ file objfile => srcfile do
34
+ command = "gcc -c -fPIC -O2 -Wall -o #{objfile} -I/usr/local/include -I../../rlibxml/ext #{srcfile} -I#{LIBXML_RUBY_DIR}/ext -I#{RUBY_INCLUDE_DIR}"
35
+ sh "sh -c '#{command}'"
36
+ end
37
+ end
38
+
39
+ file "libxslt" => OBJ do
40
+ command = "gcc -shared -o #{EXTENSION_NAME} -L#{LIBXML_RUBY_DIR}/lib -L/usr/local/lib #{OBJ} -lxml_ruby -lxslt -lxml2 #{RUBY_BIN_DIR}/#{RUBY_SHARED_DLL}"
41
+ sh "sh -c '#{command}'"
42
+ end
@@ -1,9 +1,9 @@
1
1
  
2
- Microsoft Visual Studio Solution File, Format Version 9.00
3
- # Visual Studio 2005
2
+ Microsoft Visual Studio Solution File, Format Version 10.00
3
+ # Visual Studio 2008
4
4
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxslt_ruby", "libxslt_ruby.vcproj", "{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}"
5
5
  EndProject
6
- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml_ruby", "..\..\..\libxml-ruby\trunk\vc\libxml_ruby.vcproj", "{0B65CD1D-EEB9-41AE-93BB-75496E504152}"
6
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml_ruby", "..\..\..\libxml-ruby\ext\vc\libxml_ruby.vcproj", "{0B65CD1D-EEB9-41AE-93BB-75496E504152}"
7
7
  EndProject
8
8
  Global
9
9
  GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1,11 +1,12 @@
1
1
  <?xml version="1.0" encoding="Windows-1252"?>
2
2
  <VisualStudioProject
3
3
  ProjectType="Visual C++"
4
- Version="8.00"
4
+ Version="9.00"
5
5
  Name="libxslt_ruby"
6
6
  ProjectGUID="{6DCFD1E6-224E-479C-BBD9-B6931DFCD02C}"
7
7
  RootNamespace="libxsl"
8
8
  Keyword="Win32Proj"
9
+ TargetFrameworkVersion="131072"
9
10
  >
10
11
  <Platforms>
11
12
  <Platform
@@ -17,7 +18,7 @@
17
18
  <Configurations>
18
19
  <Configuration
19
20
  Name="Debug|Win32"
20
- OutputDirectory="C:\Development\ruby\lib\ruby\gems\1.8\gems\libxsl-ruby-0.6.1-x86-mswin32-60\lib"
21
+ OutputDirectory="C:\Development\ruby\lib\ruby\gems\1.8\gems\libxsl-ruby-0.8.2-x86-mswin32-60\lib"
21
22
  IntermediateDirectory="$(ConfigurationName)"
22
23
  ConfigurationType="2"
23
24
  CharacterSet="1"
@@ -40,7 +41,7 @@
40
41
  <Tool
41
42
  Name="VCCLCompilerTool"
42
43
  Optimization="0"
43
- AdditionalIncludeDirectories="&quot;C:\Development\msys\src\libiconv-1.12\include&quot;;&quot;C:\Development\ruby\lib\ruby\1.8\i386-mswin32&quot;;&quot;C:\Development\msys\src\libxml2-2.6.32\include&quot;;&quot;C:\Development\msys\src\libxslt-1.1.24&quot;;&quot;C:\Development\msys\src\libxml-ruby\trunk\ext&quot;"
44
+ AdditionalIncludeDirectories="&quot;C:\Development\src\libxml-ruby\ext&quot;;&quot;C:\Development\ruby\lib\ruby\1.8\i386-mswin32&quot;;C:\Development\msys\local\include;C:\Development\msys\local\include\libxml2"
44
45
  PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;libxsl_EXPORTS"
45
46
  MinimalRebuild="true"
46
47
  BasicRuntimeChecks="3"
@@ -64,9 +65,11 @@
64
65
  AdditionalDependencies="msvcrt-ruby18.lib libxml2.lib libxslt.lib libexslt.lib"
65
66
  OutputFile="C:\Development\ruby\lib\ruby\gems\1.8\gems\libxslt-ruby-0.7.1-x86-mswin32-60\lib\$(ProjectName).so"
66
67
  LinkIncremental="2"
67
- AdditionalLibraryDirectories="C:\Development\ruby\lib;&quot;C:\Development\msys\src\libxml2-2.6.32\win32\bin.msvc&quot;;&quot;C:\Development\msys\src\libxslt-1.1.24\win32\bin.msvc&quot;"
68
+ AdditionalLibraryDirectories="C:\Development\ruby\lib;C:\Development\msys\local\lib"
68
69
  GenerateDebugInformation="true"
69
70
  SubSystem="2"
71
+ RandomizedBaseAddress="1"
72
+ DataExecutionPrevention="0"
70
73
  TargetMachine="1"
71
74
  />
72
75
  <Tool
@@ -87,9 +90,6 @@
87
90
  <Tool
88
91
  Name="VCAppVerifierTool"
89
92
  />
90
- <Tool
91
- Name="VCWebDeploymentTool"
92
- />
93
93
  <Tool
94
94
  Name="VCPostBuildEventTool"
95
95
  />
@@ -146,6 +146,8 @@
146
146
  SubSystem="2"
147
147
  OptimizeReferences="2"
148
148
  EnableCOMDATFolding="2"
149
+ RandomizedBaseAddress="1"
150
+ DataExecutionPrevention="0"
149
151
  TargetMachine="1"
150
152
  />
151
153
  <Tool
@@ -166,9 +168,6 @@
166
168
  <Tool
167
169
  Name="VCAppVerifierTool"
168
170
  />
169
- <Tool
170
- Name="VCWebDeploymentTool"
171
- />
172
171
  <Tool
173
172
  Name="VCPostBuildEventTool"
174
173
  />
@@ -177,7 +176,7 @@
177
176
  <References>
178
177
  <ProjectReference
179
178
  ReferencedProjectIdentifier="{0B65CD1D-EEB9-41AE-93BB-75496E504152}"
180
- RelativePathToProject="..\..\..\libxml-ruby\trunk\vc\libxml_ruby.vcproj"
179
+ RelativePathToProject="..\..\..\libxml-ruby\ext\vc\libxml_ruby.vcproj"
181
180
  />
182
181
  </References>
183
182
  <Files>
@@ -187,15 +186,15 @@
187
186
  UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
188
187
  >
189
188
  <File
190
- RelativePath="..\ext\libxslt\libxslt.c"
189
+ RelativePath="..\libxslt\libxslt.c"
191
190
  >
192
191
  </File>
193
192
  <File
194
- RelativePath="..\ext\libxslt\ruby_xslt_stylesheet.c"
193
+ RelativePath="..\libxslt\ruby_xslt_stylesheet.c"
195
194
  >
196
195
  </File>
197
196
  <File
198
- RelativePath="..\ext\libxslt\ruby_xslt_transform_context.c"
197
+ RelativePath="..\libxslt\ruby_xslt_transform_context.c"
199
198
  >
200
199
  </File>
201
200
  </Filter>
@@ -205,19 +204,19 @@
205
204
  UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
206
205
  >
207
206
  <File
208
- RelativePath="..\ext\libxslt\libxslt.h"
207
+ RelativePath="..\libxslt\libxslt.h"
209
208
  >
210
209
  </File>
211
210
  <File
212
- RelativePath="..\ext\libxslt\ruby_xslt_stylesheet.h"
211
+ RelativePath="..\libxslt\ruby_xslt_stylesheet.h"
213
212
  >
214
213
  </File>
215
214
  <File
216
- RelativePath="..\ext\libxslt\ruby_xslt_transform_context.h"
215
+ RelativePath="..\libxslt\ruby_xslt_transform_context.h"
217
216
  >
218
217
  </File>
219
218
  <File
220
- RelativePath="..\ext\libxslt\version.h"
219
+ RelativePath="..\libxslt\version.h"
221
220
  >
222
221
  </File>
223
222
  </Filter>
data/lib/libxslt.rb CHANGED
@@ -1,9 +1,13 @@
1
+ # First make sure libxml is loaded
1
2
  require 'libxml'
3
+
4
+ # Now if running on Windows, then add the current directory to the PATH
5
+ # for the current process so it can find the pre-built libxml2 and
6
+ # iconv2 shared libraries (dlls).
7
+ if RUBY_PLATFORM.match(/mswin/i)
8
+ ENV['PATH'] += ";#{File.dirname(__FILE__)}"
9
+ end
10
+
2
11
  require 'libxslt_ruby'
3
- require 'libxslt/deprecated'
4
12
 
5
- # Map the LibXSLT module into the XSLT module for both backwards
6
- # compatibility and ease of use.
7
- module XSLT
8
- include LibXSLT::XSLT
9
- end
13
+ require 'libxslt/deprecated'
@@ -2,65 +2,66 @@
2
2
  # These classes provide provide backwards compatibility with
3
3
  # versions of libxslt-ruby prior to version 0.7.0
4
4
 
5
- module XML
6
- module XSLT
7
- MAX_DEPTH = LibXSLT::XSLT::MAX_DEPTH
8
- MAX_SORT = LibXSLT::XSLT::MAX_SORT
9
- ENGINE_VERSION = LibXSLT::XSLT::ENGINE_VERSION
10
- LIBXSLT_VERSION = LibXSLT::XSLT::LIBXSLT_VERSION
11
- LIBXML_VERSION = LibXSLT::XSLT::LIBXML_VERSION
12
- XSLT_NAMESPACE = LibXSLT::XSLT::XSLT_NAMESPACE
13
- DEFAULT_VENDOR = LibXSLT::XSLT::DEFAULT_VENDOR
14
- DEFAULT_VERSION = LibXSLT::XSLT::DEFAULT_VERSION
15
- DEFAULT_URL = LibXSLT::XSLT::DEFAULT_URL
16
- NAMESPACE_LIBXSLT = LibXSLT::XSLT::NAMESPACE_LIBXSLT
17
- NAMESPACE_NORM_SAXON = LibXSLT::XSLT::NAMESPACE_NORM_SAXON
18
- NAMESPACE_SAXON = LibXSLT::XSLT::NAMESPACE_SAXON
19
- NAMESPACE_XT = LibXSLT::XSLT::NAMESPACE_XT
20
- NAMESPACE_XALAN = LibXSLT::XSLT::NAMESPACE_XALAN
21
-
22
- def self.new
23
- Stylesheet.new(nil)
24
- end
25
-
26
- def self.file(filename)
27
- doc = XML::Document.file(filename)
28
- stylesheet = LibXSLT::XSLT::Stylesheet.new(doc)
29
-
30
- result = Stylesheet.new(stylesheet)
31
- result.filename = filename
32
- result
33
- end
34
-
35
- class Stylesheet
36
- attr_accessor :doc, :filename
37
-
38
- def initialize(stylesheet)
39
- @stylesheet = stylesheet
40
- end
41
-
42
- def filename=(value)
43
- @doc = XML::Document.file(value)
44
- @filename = value
45
- end
46
-
47
- def parse
48
- self
49
- end
50
-
51
- def apply
52
- @result = @stylesheet.apply(@doc)
5
+ module LibXML
6
+ module XML
7
+ module XSLT
8
+ MAX_DEPTH = LibXSLT::XSLT::MAX_DEPTH
9
+ MAX_SORT = LibXSLT::XSLT::MAX_SORT
10
+ ENGINE_VERSION = LibXSLT::XSLT::ENGINE_VERSION
11
+ LIBXSLT_VERSION = LibXSLT::XSLT::LIBXSLT_VERSION
12
+ LIBXML_VERSION = LibXSLT::XSLT::LIBXML_VERSION
13
+ XSLT_NAMESPACE = LibXSLT::XSLT::XSLT_NAMESPACE
14
+ DEFAULT_VENDOR = LibXSLT::XSLT::DEFAULT_VENDOR
15
+ DEFAULT_VERSION = LibXSLT::XSLT::DEFAULT_VERSION
16
+ DEFAULT_URL = LibXSLT::XSLT::DEFAULT_URL
17
+ NAMESPACE_LIBXSLT = LibXSLT::XSLT::NAMESPACE_LIBXSLT
18
+ NAMESPACE_NORM_SAXON = LibXSLT::XSLT::NAMESPACE_NORM_SAXON
19
+ NAMESPACE_SAXON = LibXSLT::XSLT::NAMESPACE_SAXON
20
+ NAMESPACE_XT = LibXSLT::XSLT::NAMESPACE_XT
21
+ NAMESPACE_XALAN = LibXSLT::XSLT::NAMESPACE_XALAN
22
+
23
+ def self.new
24
+ Stylesheet.new(nil)
53
25
  end
54
-
55
- def save(filename)
56
- raise(ArgumentError) unless @result
57
- @result.save(filename)
26
+
27
+ def self.file(filename)
28
+ doc = ::LibXML::XML::Document.file(filename)
29
+ stylesheet = LibXSLT::XSLT::Stylesheet.new(doc)
30
+
31
+ result = Stylesheet.new(stylesheet)
32
+ result.filename = filename
33
+ result
58
34
  end
59
-
60
- def print(filename)
61
- raise(ArgumentError) unless @result
35
+
36
+ class Stylesheet
37
+ attr_accessor :doc, :filename
38
+
39
+ def initialize(stylesheet)
40
+ @stylesheet = stylesheet
41
+ end
42
+
43
+ def filename=(value)
44
+ @doc = ::LibXML::XML::Document.file(value)
45
+ @filename = value
46
+ end
47
+
48
+ def parse
49
+ self
50
+ end
51
+
52
+ def apply
53
+ @result = @stylesheet.apply(@doc)
54
+ end
55
+
56
+ def save(filename)
57
+ raise(ArgumentError) unless @result
58
+ @result.save(filename)
59
+ end
60
+
61
+ def print(filename)
62
+ raise(ArgumentError) unless @result
63
+ end
62
64
  end
63
65
  end
64
66
  end
65
67
  end
66
-
data/lib/text.xml ADDED
@@ -0,0 +1,129 @@
1
+ <?xml version="1.0"?>
2
+ <html><head><title>Ramblings - Fuzface... - The Internet's a big place and here's some proof...</title></head><body><h1>Fuzface...</h1><h3>The Internet's a big place and here's some proof...</h3>
3
+ By: SeanChittenden<br/>
4
+ Date: $Date: 2008-07-09 23:35:19 -0600 (Wed, 09 Jul 2008) $<br/>
5
+ <p>
6
+ I think it's a tragedy that I'm going to start off my new
7
+ commentary by talking about facial hair and the Internet.
8
+ Something about that just screams pathetic, but whatever: it's
9
+ humor and that's life.
10
+ </p>
11
+
12
+ <p>
13
+ I've been working at home for a while now, which has been great.
14
+ I've been doing a lot of reading, good work, contributing to the
15
+ FreeBSD project, and living life at my own pace. The problem?
16
+ I don't have to interact with people, so I've let my appearance
17
+ slide a bit, most notably I've gone two weeks without shaving
18
+ and I have an awful hairy face.
19
+ </p>
20
+
21
+ <p>
22
+ Nothing is worse than going for a hard run, coming back, and
23
+ then bending your head down so that the hairs under your chin
24
+ touch the hairs on your neck. This has to be one of the most
25
+ disgusting/gross feelings I've experienced in a while. While
26
+ today wasn't the first time I'd experienced such a slimy tangled
27
+ mess, it is the first time I seriously considered shaving part
28
+ of my face, but not all of it: I was considering a beard.
29
+ </p>
30
+
31
+ <p>
32
+ Alright, so it's 5pm and I'm a sweaty post-run mess (it was 110
33
+ degrees in direct sunlight according to my thermometer) and
34
+ considering the possibility of growing a beard. Swifty nift?
35
+ Maybe. This is something I'd never done before, let alone
36
+ seriously consider. Normally I'd call my dad for such manly
37
+ advice, but he is: a) normally in another state, and; b) in
38
+ another country right now probably growing a beard (he's
39
+ notorious for coming back from a trip with a gnarly unshaven
40
+ face, sometimes he'll shape it into a decent beard). So, what's
41
+ a tech-junkie to do? Hop on the Internet and see if Google's
42
+ able to provide me with some inspiration.
43
+ </p>
44
+
45
+ <p>
46
+ Sure enough, I typed in "pictures of bearded men" and I was able
47
+ to find something: 14,000 pages of something to be exact.
48
+ Anyway, so most of these were rinky dink sites, a few of them
49
+ had some promise. One guy was trying to start a tradition where
50
+ everyone grows a beard for New Years. As I was scrolling down
51
+ the page trying to find some pictures, my mind was having the
52
+ following thought process: <i>This seems like a dumb
53
+ idea... New Years provides a perfectly good excuse to kiss some
54
+ total stranger that you've had your eye on for the duration of a
55
+ New Years party. Why waste such an opportunity with a crappy
56
+ kiss?</i> And at about this point I said this page sucks,
57
+ and flipped back to my search results.
58
+ </p>
59
+
60
+ <p>
61
+ Since I'd never done this before, I didn't know what was
62
+ fashionably correct in terms of where a guy should shave under
63
+ his neck, or what the deal was... I knew there were lots of
64
+ styles out there, just none that I could picture in my mind
65
+ (save maybe Santa Claus and a few really gnarly beards that are
66
+ long enough to be used as full-body covering. Oooh! And don't
67
+ forget the Russian and Amish beards, those stand out in my mind
68
+ too.). Google, being pretty comprehensive, and the Internet
69
+ being huge, found the exact screwball page I was looking for:
70
+ http://fuzface-gallery.tripod.com/
71
+ </p>
72
+
73
+ <p>
74
+ I don't know if I really should be amazed at the sheer number of
75
+ entries that Google returned, or that the Internet is big enough
76
+ to house such random gallery of crap, but it is and it never
77
+ ceases to amaze me... it's almost as amazing as the fact that
78
+ some bozo spent the time to create such a page. Don't people
79
+ have lives? Oh wait, I just visited his page... so back to my
80
+ diatribe...
81
+ </p>
82
+
83
+ <p>
84
+ There were tons of faces, lots of men, lots of hair, and plenty
85
+ of styles to choose from. Page after page of faces and hair.
86
+ Ugh. This wasn't getting any where and I was now entertaining
87
+ the rebound though of shaving my head. Time to close my browser
88
+ and hop in the shower: I reak. So what'd I do? Well, after
89
+ looking through enough of those pictures, I decided a few
90
+ things:
91
+ </p>
92
+
93
+ <p>
94
+ <ol><li>
95
+ I'm amazed that the Internet is big enough to foster the
96
+ creation of such random and utterly useless information. Then
97
+ again, I've been on and using the Net since '95, so this
98
+ shouldn't surprise me that much.
99
+ </li><li>
100
+ There are a lot of guys out there with varying tastes in,
101
+ shall we say, "facial hair styles," most of which I find
102
+ pretty unappealing.
103
+ </li><li>
104
+ I don't like beards. After one clogged drain, two
105
+ reapplications of shaving cream, and a few pases with the
106
+ razor, it took me about 5-10 minutes to get a nice cleanly
107
+ shaven face.
108
+ </li><li>
109
+ &lt;crass comment&gt;And - back me up here fellas, you can
110
+ sympathize with this feeling after you get done looking
111
+ through a magazine for a hair-cut style (ladies.. just smile
112
+ and nod and pretend you care) - after looking at a few dozen
113
+ pictures of men, I was able to safely reaffirm my desire for
114
+ heterosexual relations (translation from Bill Clintonese: have
115
+ sex with a woman). And with that thought in mind, I began to
116
+ pine for the college porn collection of old. Mmmm,
117
+ Playboy.&lt;/crass comment&gt;
118
+ </li></ol>
119
+ </p>
120
+
121
+ <p>
122
+ ::grin:: Until next time. -Sean
123
+ </p>
124
+
125
+ <p>
126
+ P.S. To the guys out there with beards, this is just my
127
+ opinion: take it with a grain of salt.
128
+ </p>
129
+ </body></html>