From: Ben Beltran Date: Thu, 13 Nov 2014 23:39:04 +0000 (-0700) Subject: Fixes extraneous characters from lyrics results X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/commitdiff_plain/b434f05e58de158e651fbc83cead322f6a864d36 Fixes extraneous characters from lyrics results --- diff --git a/lib/lyricli/lyrics_engine.rb b/lib/lyricli/lyrics_engine.rb index 72ee402..1291d41 100644 --- a/lib/lyricli/lyrics_engine.rb +++ b/lib/lyricli/lyrics_engine.rb @@ -31,11 +31,15 @@ module Lyricli n.remove end + node.search("script").each do |n| + n.remove + end + node.search("br").each do |br| br.replace "\n" end - node.inner_text + node.inner_text.gsub(/\s+$/, "") end end end diff --git a/lyricli-0.0.1.gem b/lyricli-0.0.1.gem deleted file mode 100644 index 278c000..0000000 Binary files a/lyricli-0.0.1.gem and /dev/null differ diff --git a/lyricli.gemspec b/lyricli.gemspec index 584f808..0192b8e 100644 --- a/lyricli.gemspec +++ b/lyricli.gemspec @@ -1,11 +1,12 @@ Gem::Specification.new do |s| s.name = 'lyricli' - s.version = '0.0.1' + s.version = '0.0.2' s.summary = 'Lyricli is an awesome lyric client for your Command Line' s.description = 'Lyricli is an awesome CLI tool to read the lyrics of your currently playing song right in the command line' s.authors = ['Ben Beltran'] s.email = 'ben@nsovocal.com' s.homepage = 'http://nsovocal.com/lyricli' + s.licenses = ['BSD-3-Clause'] s.files = Dir['lib/**/*.rb'] + Dir['bin/*'] s.files += Dir['[A-Z]*'] + Dir['spec/**/*'] @@ -14,14 +15,14 @@ Gem::Specification.new do |s| s.executables << 'lrc' # Runtime Dependencies - s.add_runtime_dependency 'nokogiri', '~> 1.5.5' - s.add_runtime_dependency 'multi_json', '~> 1.3.6' - s.add_runtime_dependency 'rdio', '~> 0.1.0' - s.add_runtime_dependency 'launchy', '~> 2.1.2' + s.add_runtime_dependency 'nokogiri', '~> 1.5' + s.add_runtime_dependency 'multi_json', '~> 1.3' + s.add_runtime_dependency 'rdio', '~> 0.1' + s.add_runtime_dependency 'launchy', '~> 2.1' # Development Dependencies - s.add_development_dependency 'ruby-debug19', '~> 0.11.6' - s.add_development_dependency 'yard', '~> 0.8.2.1' - s.add_development_dependency 'thin', '~> 1.5.0' - s.add_development_dependency 'rspec', '~> 2.11.0' + s.add_development_dependency 'ruby-debug19', '~> 0.11' + s.add_development_dependency 'yard', '~> 0.8' + s.add_development_dependency 'thin', '~> 1.5' + s.add_development_dependency 'rspec', '~> 2.11' end