don't (directly) depend on libxml-ruby

nokogiri is better maintained, and java compatible (both
are based on libxml2)

Change-Id: Ia7c8edea15ec001cf4861b00494e480832bd2c63
Reviewed-on: https://gerrit.instructure.com/49467
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2015-02-25 11:22:00 -07:00
parent 58da8b2848
commit dc8f37287a
7 changed files with 5 additions and 13 deletions

View File

@ -58,8 +58,6 @@ gem 'json', '1.8.2'
gem 'oj', '2.5.5'
gem 'jwt', '1.2.1'
# native xml parsing, diigo
gem 'libxml-ruby', '2.7.0', :require => 'xml/libxml'
gem 'macaddr', '1.0.0' # macaddr 1.2.0 tries to require 'systemu' which isn't a dependency
gem 'mail', '2.5.4'
gem 'treetop', '1.4.15'

View File

@ -71,9 +71,8 @@ class BookmarkService < UserService
response = http.request(request)
case response
when Net::HTTPSuccess
require 'libxml'
document = LibXML::XML::Parser.string(response.body).parse
document.find('/posts/post').each do |post|
document = Nokogiri::XML(response.body)
document.search('/posts/post').each do |post|
bookmarks << {
:title => post['description'],
:url => post['href'],

View File

@ -173,7 +173,7 @@ module CanvasRails
Dir.glob("#{Rails.root}/lib/ext/**/*.rb").each { |file| require file }
# tell Rails to use the native XML parser instead of REXML
ActiveSupport::XmlMini.backend = 'LibXML'
ActiveSupport::XmlMini.backend = 'Nokogiri'
class NotImplemented < StandardError; end

View File

@ -16,7 +16,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "nokogiri"
spec.add_dependency "libxml-ruby", "~> 2.7"
spec.add_dependency "canvas_http"
spec.add_dependency "canvas_sort"
spec.add_dependency "multipart"

View File

@ -21,7 +21,6 @@ require 'csv'
require 'net/http'
require 'uri'
require 'nokogiri'
require 'libxml'
require 'multipart'

View File

@ -18,6 +18,5 @@ Gem::Specification.new do |s|
s.add_dependency "rails", ">= 3.2", "< 4.2"
s.add_dependency "moodle2cc", "0.2.16"
s.add_dependency "happymapper", "0.4.1"
s.add_dependency "thor", "0.18.1"
end

View File

@ -33,8 +33,7 @@ module Delicious
response = http.request(request)
case response
when Net::HTTPSuccess
require 'libxml'
updated = LibXML::XML::Parser.string(response.body).parse.child["time"]
updated = Nokogiri::XML(response.body).root["time"]
return Time.parse(updated)
else
response.error!
@ -47,8 +46,7 @@ module Delicious
response = http.request(request)
case response
when Net::HTTPSuccess
require 'libxml'
code = LibXML::XML::Parser.string(response.body).parse.child["code"]
code = Nokogiri::XML(response.body).root["code"]
return code == 'done'
else
response.error!