Skip to content

Commit

Permalink
Merge branch 'master' of http://github.com/aspiers/capybara into aspi…
Browse files Browse the repository at this point in the history
…ers-master
  • Loading branch information
jnicklas committed Nov 9, 2010
2 parents 5c6b569 + 721d6ef commit f7b6fb0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/capybara/util/save_and_open_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ def open_in_browser(path) # :nodoc

def rewrite_css_and_image_references(response_html) # :nodoc:
return response_html unless Capybara.asset_root
directories = Dir.new(Capybara.asset_root).entries.inject([]) do |list, name|
list << name if File.directory?(name) and not name.to_s =~ /^\./
list
end
response_html.gsub(/("|')\/(#{directories.join('|')})/, '\1' + Capybara.asset_root.to_s + '/\2')
directories = Dir.new(Capybara.asset_root).entries.select { |name|
File.directory?(name) and not name.to_s =~ /^\./
}
response_html.gsub(/=("|')\/(#{directories.join('|')})/, '=\1' + Capybara.asset_root.to_s + '/\2')
end
end
end

0 comments on commit f7b6fb0

Please sign in to comment.