Skip to content

Commit

Permalink
Merge branch 'hotfix-0.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskite committed May 30, 2012
2 parents 531d771 + be934f9 commit 3fbc35d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.1
0.7.2
2 changes: 1 addition & 1 deletion anemone.gemspec
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/anemone/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

module Anemone

VERSION = '0.7.1';
VERSION = '0.7.2';

#
# Convenience method to start a crawl
Expand Down
2 changes: 1 addition & 1 deletion lib/anemone/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
8 changes: 8 additions & 0 deletions spec/page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3fbc35d

Please sign in to comment.