Skip to content

Commit

Permalink
Use builtin RSS::Parser instead of Nokogiri
Browse files Browse the repository at this point in the history
  • Loading branch information
tomohiro committed May 9, 2014
1 parent d2df339 commit 5491122
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ PATH
airplay (~> 1.0.2)
http (~> 0.5.0)
mime-types (= 2.0)
nokogiri
rack
reel (~> 0.4.0)
reel-rack (~> 0.1.0)
Expand Down Expand Up @@ -69,16 +68,13 @@ GEM
method_source (0.8.2)
micromachine (1.0.4)
mime-types (2.0)
mini_portile (0.5.3)
multi_json (1.10.0)
net-http-digest_auth (1.2.1)
net-ptth (0.0.17)
celluloid-io (>= 0.15.0)
http_parser.rb (>= 0.6.0.beta.2)
rack (>= 1.4.5)
nio4r (1.0.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
Expand Down
1 change: 0 additions & 1 deletion airplayer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'reel-rack', '~> 0.1.0'
spec.add_runtime_dependency 'airplay', '~> 1.0.2'
spec.add_runtime_dependency 'mime-types', '= 2.0'
spec.add_runtime_dependency 'nokogiri'

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
Expand Down
7 changes: 3 additions & 4 deletions lib/airplayer/playlist.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# encoding: utf-8

require 'rss'
require 'nokogiri'

module AirPlayer
class Playlist < Array
Expand Down Expand Up @@ -36,7 +35,7 @@ def type(item)
:local_dir
elsif Media.playable? item
:url
elsif RSS::Parser.parse(open(item))
elsif item.match(/.+(xml|rss)$/)
:podcast
end
end
Expand All @@ -48,8 +47,8 @@ def media_in_local(path)
end

def media_in_podcast(path)
Nokogiri::XML(open(path)).search('enclosure').map do |node|
Media.new(node.attributes['url'].text)
RSS::Parser.parse(path).items.map do |node|
Media.new(node.link)
end
end
end
Expand Down

0 comments on commit 5491122

Please sign in to comment.