tidy-ext 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/.gitignore +4 -0
  2. data/LICENSE +50 -0
  3. data/README +12 -0
  4. data/Rakefile +60 -0
  5. data/VERSION +1 -0
  6. data/ext/tidy/access.c +3310 -0
  7. data/ext/tidy/access.h +279 -0
  8. data/ext/tidy/alloc.c +107 -0
  9. data/ext/tidy/attrask.c +209 -0
  10. data/ext/tidy/attrdict.c +2398 -0
  11. data/ext/tidy/attrdict.h +122 -0
  12. data/ext/tidy/attrget.c +213 -0
  13. data/ext/tidy/attrs.c +1911 -0
  14. data/ext/tidy/attrs.h +374 -0
  15. data/ext/tidy/buffio.c +232 -0
  16. data/ext/tidy/buffio.h +118 -0
  17. data/ext/tidy/charsets.c +1032 -0
  18. data/ext/tidy/charsets.h +14 -0
  19. data/ext/tidy/clean.c +2674 -0
  20. data/ext/tidy/clean.h +87 -0
  21. data/ext/tidy/config.c +1746 -0
  22. data/ext/tidy/config.h +153 -0
  23. data/ext/tidy/entities.c +419 -0
  24. data/ext/tidy/entities.h +24 -0
  25. data/ext/tidy/extconf.rb +5 -0
  26. data/ext/tidy/fileio.c +106 -0
  27. data/ext/tidy/fileio.h +46 -0
  28. data/ext/tidy/forward.h +69 -0
  29. data/ext/tidy/iconvtc.c +105 -0
  30. data/ext/tidy/iconvtc.h +15 -0
  31. data/ext/tidy/istack.c +373 -0
  32. data/ext/tidy/lexer.c +3825 -0
  33. data/ext/tidy/lexer.h +617 -0
  34. data/ext/tidy/localize.c +1882 -0
  35. data/ext/tidy/mappedio.c +329 -0
  36. data/ext/tidy/mappedio.h +16 -0
  37. data/ext/tidy/message.h +207 -0
  38. data/ext/tidy/parser.c +4408 -0
  39. data/ext/tidy/parser.h +76 -0
  40. data/ext/tidy/platform.h +636 -0
  41. data/ext/tidy/pprint.c +2276 -0
  42. data/ext/tidy/pprint.h +93 -0
  43. data/ext/tidy/ruby-tidy.c +195 -0
  44. data/ext/tidy/streamio.c +1407 -0
  45. data/ext/tidy/streamio.h +222 -0
  46. data/ext/tidy/tagask.c +286 -0
  47. data/ext/tidy/tags.c +955 -0
  48. data/ext/tidy/tags.h +235 -0
  49. data/ext/tidy/tidy-int.h +129 -0
  50. data/ext/tidy/tidy.h +1097 -0
  51. data/ext/tidy/tidyenum.h +622 -0
  52. data/ext/tidy/tidylib.c +1751 -0
  53. data/ext/tidy/tmbstr.c +306 -0
  54. data/ext/tidy/tmbstr.h +92 -0
  55. data/ext/tidy/utf8.c +539 -0
  56. data/ext/tidy/utf8.h +52 -0
  57. data/ext/tidy/version.h +14 -0
  58. data/ext/tidy/win32tc.c +795 -0
  59. data/ext/tidy/win32tc.h +19 -0
  60. data/spec/spec_helper.rb +5 -0
  61. data/spec/tidy/compat_spec.rb +44 -0
  62. data/spec/tidy/remote_uri_spec.rb +14 -0
  63. data/spec/tidy/test1.html +5 -0
  64. data/spec/tidy/tidy_spec.rb +34 -0
  65. metadata +125 -0
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ ext/*.o
3
+ ext/*.bundle
4
+ ext/Makefile
data/LICENSE ADDED
@@ -0,0 +1,50 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title>HTML Tidy License</title>
5
+ </head>
6
+
7
+ <body>
8
+ <pre>
9
+ HTML Tidy
10
+
11
+ HTML parser and pretty printer
12
+
13
+ Copyright (c) 1998-2003 World Wide Web Consortium
14
+ (Massachusetts Institute of Technology, European Research
15
+ Consortium for Informatics and Mathematics, Keio University).
16
+ All Rights Reserved.
17
+
18
+ This software and documentation is provided "as is," and
19
+ the copyright holders and contributing author(s) make no
20
+ representations or warranties, express or implied, including
21
+ but not limited to, warranties of merchantability or fitness
22
+ for any particular purpose or that the use of the software or
23
+ documentation will not infringe any third party patents,
24
+ copyrights, trademarks or other rights.
25
+
26
+ The copyright holders and contributing author(s) will not be held
27
+ liable for any direct, indirect, special or consequential damages
28
+ arising out of any use of the software or documentation, even if
29
+ advised of the possibility of such damage.
30
+
31
+ Permission is hereby granted to use, copy, modify, and distribute
32
+ this source code, or portions hereof, documentation and executables,
33
+ for any purpose, without fee, subject to the following restrictions:
34
+
35
+ 1. The origin of this source code must not be misrepresented.
36
+ 2. Altered versions must be plainly marked as such and must
37
+ not be misrepresented as being the original source.
38
+ 3. This Copyright notice may not be removed or altered from any
39
+ source or altered source distribution.
40
+
41
+ The copyright holders and contributing author(s) specifically
42
+ permit, without fee, and encourage the use of this source code
43
+ as a component for supporting the Hypertext Markup Language in
44
+ commercial products. If you use this source code in a product,
45
+ acknowledgment is not required but would be appreciated.
46
+ </pre>
47
+
48
+
49
+ </body>
50
+ </html>
data/README ADDED
@@ -0,0 +1,12 @@
1
+ A native Ruby extension for the tidy application.
2
+
3
+ Example usage:
4
+
5
+ require 'tidy'
6
+ require 'open-uri'
7
+
8
+ tidy = Tidy.new
9
+ errors, tidy_output = tidy.parse('http://www.github.com')
10
+
11
+ puts errors, tidy_output
12
+
data/Rakefile ADDED
@@ -0,0 +1,60 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/extensiontask'
4
+
5
+ #require File.join(File.expand_path(File.dirname(__FILE__)), "lib")
6
+
7
+ MAKE = 'make'
8
+
9
+ begin
10
+ require 'jeweler'
11
+ Jeweler::Tasks.new do |gem|
12
+ gem.name = "tidy-ext"
13
+ gem.summary = "HTML Tidy library implemented as a Ruby extension."
14
+ gem.description = <<-EOS
15
+ Tidies up web pages.
16
+ EOS
17
+ gem.email = "carl.douglas@gmail.com"
18
+ gem.homepage = "http://github.com/carld/tidy"
19
+ gem.authors = ["Carl Douglas"]
20
+ gem.extensions = FileList["ext/**/extconf.rb"]
21
+ end
22
+ Jeweler::GemcutterTasks.new
23
+ rescue LoadError
24
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
25
+ end
26
+
27
+ desc "Launch an IRB session with the environment loaded"
28
+ task :console do
29
+ exec("irb -I lib -r tidy/alone")
30
+ end
31
+
32
+ require 'spec/rake/spectask'
33
+ Spec::Rake::SpecTask.new(:spec) do |spec|
34
+ spec.libs << 'lib' << 'spec'
35
+ spec.spec_files = FileList['spec/**/*_spec.rb']
36
+ end
37
+
38
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
39
+ spec.libs << 'lib' << 'spec'
40
+ spec.pattern = 'spec/**/*_spec.rb'
41
+ spec.rcov = true
42
+ end
43
+
44
+ task :spec => :check_dependencies
45
+
46
+ task :default => :spec
47
+
48
+ require 'rake/rdoctask'
49
+ Rake::RDocTask.new do |rdoc|
50
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
51
+
52
+ rdoc.rdoc_dir = 'rdoc'
53
+ rdoc.title = "tidy #{version}"
54
+ rdoc.rdoc_files.include('README*')
55
+ rdoc.rdoc_files.include('lib/**/*.rb')
56
+ end
57
+
58
+ Rake::ExtensionTask.new('tidy')
59
+
60
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.7