Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'hotfix-0.7.2'

  • Loading branch information...
commit 3fbc35d2bea630100e0f47a0f79de93d5f220cbd 2 parents 531d771 + be934f9
@chriskite authored
View
6 CHANGELOG.rdoc
@@ -1,3 +1,9 @@
+== 0.7.2 / 2012-05-30
+
+* Bug fixes
+
+ * Fix bug causing anchor links to have '#' converted to '%23'
+
== 0.7.1 / 2012-01-20
* Minor enhancements
View
2  VERSION
@@ -1 +1 @@
-0.7.1
+0.7.2
View
2  anemone.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = "anemone"
- s.version = "0.7.1"
+ s.version = "0.7.2"
s.author = "Chris Kite"
s.homepage = "http://anemone.rubyforge.org"
s.rubyforge_project = "anemone"
View
2  lib/anemone/core.rb
@@ -9,7 +9,7 @@
module Anemone
- VERSION = '0.7.1';
+ VERSION = '0.7.2';
#
# Convenience method to start a crawl
View
2  lib/anemone/page.rb
@@ -62,7 +62,7 @@ def links
doc.search("//a[@href]").each do |a|
u = a['href']
next if u.nil? or u.empty?
- abs = to_absolute(URI(URI.escape(u))) rescue next
+ abs = to_absolute(u) rescue next
@links << abs if in_domain?(abs)
end
@links.uniq!
View
8 spec/page_spec.rb
@@ -126,6 +126,14 @@ module Anemone
end
end
+ describe "#links" do
+ it "should not convert anchors to %23" do
+ page = @http.fetch_page(FakePage.new('', :body => '<a href="#top">Top</a>').url)
+ page.links.should have(1).link
+ page.links.first.to_s.should == SPEC_DOMAIN
+ end
+ end
+
it "should detect, store and expose the base url for the page head" do
base = "#{SPEC_DOMAIN}path/to/base_url/"
page = @http.fetch_page(FakePage.new('body_test', {:base => base}).url)
Please sign in to comment.
Something went wrong with that request. Please try again.