rubyful_soup 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/lib/rubyful_soup.rb +7 -7
- metadata +1 -1
data/CHANGELOG
CHANGED
data/lib/rubyful_soup.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#Rubyful Soup
|
2
2
|
#Elixir and Tonic
|
3
3
|
#"The Screen-Scraper's Friend"
|
4
|
-
#v1.0.
|
4
|
+
#v1.0.3
|
5
5
|
#http://www.crummy.com/software/RubyfulSoup/
|
6
6
|
#
|
7
7
|
#Rubyful Soup is a port to the Ruby language and idiom of the Python
|
@@ -18,7 +18,7 @@ $KCODE = 'u'
|
|
18
18
|
require 'jcode'
|
19
19
|
|
20
20
|
#This code makes SGMLParser able to parse XML with namespaces.
|
21
|
-
class SGMLParser
|
21
|
+
class HTML::SGMLParser
|
22
22
|
if const_defined? :Tagfind
|
23
23
|
remove_const(:Tagfind)
|
24
24
|
Tagfind = /[a-zA-Z][-_.:a-zA-Z0-9]*/
|
@@ -223,9 +223,9 @@ module TagModule
|
|
223
223
|
setup(parent, previous)
|
224
224
|
end
|
225
225
|
|
226
|
-
#soup.title_tag or soup.title is the same as soup.find('title')
|
226
|
+
#soup.title_tag, or soup.title, is the same as soup.find('title')
|
227
227
|
def method_missing(name, *args)
|
228
|
-
#puts "Missing method #{name}"
|
228
|
+
#puts "Missing method #{name} for #{self.class.name}"
|
229
229
|
name = name.to_s
|
230
230
|
if name[-4...name.length] == '_tag'
|
231
231
|
name = name[0...name.length-4]
|
@@ -433,7 +433,7 @@ end
|
|
433
433
|
#This class is useful for parsing XML or made-up markup languages,
|
434
434
|
#or when BeautifulSoup makes an assumption counter to what you were
|
435
435
|
#expecting."""
|
436
|
-
class BeautifulStoneSoup < SGMLParser
|
436
|
+
class BeautifulStoneSoup < HTML::SGMLParser
|
437
437
|
include TagModule
|
438
438
|
|
439
439
|
#As a public service we will by default silently replace MS smart quotes
|
@@ -619,7 +619,7 @@ class BeautifulStoneSoup < SGMLParser
|
|
619
619
|
|
620
620
|
#Propagate comments right through.
|
621
621
|
def handle_comment(data)
|
622
|
-
handle_data("<!--#{
|
622
|
+
handle_data("<!--#{data}-->")
|
623
623
|
end
|
624
624
|
|
625
625
|
def handle_special(data)
|
@@ -631,7 +631,7 @@ class BeautifulStoneSoup < SGMLParser
|
|
631
631
|
end
|
632
632
|
|
633
633
|
def unknown_entityref(ref)
|
634
|
-
handle_data("%#{
|
634
|
+
handle_data("%#{ref}")
|
635
635
|
end
|
636
636
|
|
637
637
|
def attlistdecl(element_name, attributes, raw_content)
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.8.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rubyful_soup
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
6
|
+
version: 1.0.3
|
7
7
|
date: 2005-11-04
|
8
8
|
summary: An HTML/XML parser that handles bad markup and provides tree traversal methods.
|
9
9
|
require_paths:
|