Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix-0.7.2' into next

  • Loading branch information...
commit 72b699ee11f618bdeb5a8f198b0b9aa675b4e2fa 2 parents 57a58bc + be934f9
Chris Kite authored
6 CHANGELOG.rdoc
View
@@ -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
2  VERSION
View
@@ -1 +1 @@
-0.7.1
+0.7.2
2  anemone.gemspec
View
@@ -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"
2  lib/anemone/core.rb
View
@@ -9,7 +9,7 @@
module Anemone
- VERSION = '0.7.1';
+ VERSION = '0.7.2';
#
# Convenience method to start a crawl
2  lib/anemone/page.rb
View
@@ -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!
8 spec/page_spec.rb
View
@@ -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.