Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Replace deprecated hpricot with nokogiri.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Bullock committed Apr 27, 2016
1 parent 1eedc56 commit ade91ef
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/controllers/base_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'hpricot'
require 'nokogiri'
require 'open-uri'
require 'pp'

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/clippings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def show
def load_images_from_uri
uri = URI.parse(params[:uri])
begin
doc = Hpricot( open( uri ) )
doc = Nokogiri::HTML( open( uri ) )
rescue
return
end
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/base_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def truncate_words_with_highlight(text, phrase)

def excerpt_with_jump(text, end_string = ' ...')
return if text.blank?
doc = Hpricot( text )
doc = Nokogiri::HTML( text )
paragraph = doc.at("p")
if paragraph
paragraph.to_html + end_string
Expand Down
2 changes: 1 addition & 1 deletion app/models/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def next_post
end

def first_image_in_body(size = nil, options = {})
doc = Hpricot( post )
doc = Nokogiri::HTML( post )
image = doc.at("img")
image ? image['src'] : nil
end
Expand Down
2 changes: 1 addition & 1 deletion community_engine.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |s|
s.add_dependency "dynamic_form", ">= 0"
s.add_dependency "friendly_id", "~> 5.1.0"
s.add_dependency "haml", ">= 0"
s.add_dependency "hpricot", ">= 0"
s.add_dependency "nokogiri", ">= 0"
s.add_dependency "htmlentities", ">= 0"
s.add_dependency "kaminari", ">= 0"
s.add_dependency "koala", "~> 1.6.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/community_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
require 'community_engine/engines_extensions'

require 'configatron'
require 'hpricot'
require 'nokogiri'
require 'htmlentities'
require 'haml'
require 'sass-rails'
Expand Down
4 changes: 2 additions & 2 deletions test/unit/page_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'
require 'hpricot'
require 'nokogiri'

class PageTest < ActiveSupport::TestCase
fixtures :pages

Expand Down
2 changes: 1 addition & 1 deletion test/unit/post_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'test_helper'
require 'hpricot'
require 'nokogiri'

class PostTest < ActiveSupport::TestCase
fixtures :all
Expand Down
2 changes: 1 addition & 1 deletion test/unit/user_notifier_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'test_helper'
require 'hpricot'
require 'nokogiri'

class UserNotifierTest < ActiveSupport::TestCase
FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
Expand Down

0 comments on commit ade91ef

Please sign in to comment.