kagu 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11de437c9cd5363ca290c0ca520000cfe7bc1886
4
- data.tar.gz: b14401606f398c291fcc913d320c219ce3e9a6d0
3
+ metadata.gz: 7a1a026f110e2fd415d6d19a9995ebfdefd8c9b7
4
+ data.tar.gz: a8690585a73b12e321a268693329782f33972037
5
5
  SHA512:
6
- metadata.gz: 5323f84e00b4fb489cca07373ba27cd7d8ee9453a5450d9370f7c9cc718768a458846b530d865e6c6d8d5eabb2c3329be22ccf96473814239ea383b9fb8b43e1
7
- data.tar.gz: fa27da16fbc5fb658e8b5baf1b1d626d958eeefb714dcc4150cb5821eeddf6826462838aa9bff131d6c8d5349cd52b86231ed1fa346bd738629fb32c5e37a4ef
6
+ metadata.gz: 9e5327dd17acc6485ebdc5d5fc5c8e3475aed55a554a406f274511598f9768dd9833ac026688f354f13ebd94c9d2bc0230b721d66babc202cd2dbe80a5a03520
7
+ data.tar.gz: 793de716824423596d29fe77963477c30db6c7f37ed3b8b8ff002220ae3e87d2a1c139b4b9de204332c4a04c4281e10ef8e167b8ecb10b3c9c35a9233f8647f5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
data/lib/kagu/finder.rb CHANGED
@@ -32,7 +32,7 @@ module Kagu
32
32
  tracks_digests.each_with_index do |hash, digests_index|
33
33
  digests(attributes).each_with_index do |digest, digest_index|
34
34
  tracks = hash[digest].presence || next
35
- tracks = tracks.select { |track| !matches.any? { |match| match.include?(track) } }
35
+ tracks = tracks.select { |track| !matches.any? { |match| match.try(:include?, track) } }
36
36
  next if tracks.empty?
37
37
  index = [digests_index, digest_index].max
38
38
  matches[index] ||= []
@@ -121,6 +121,13 @@ describe Kagu::Finder do
121
121
  expect(results.first.first.title).to match(/podcast 002/i)
122
122
  end
123
123
 
124
+ it 'does not fails if it does not match last replacements' do
125
+ finder.reload(replacements: [{ /subsonik (\d+)/ => "subsonik podcast \\1" }, { /\s+/ => '' }])
126
+ results = finder.find(artist: 'subsonik', title: '002')
127
+ expect(results.size).to eq(1)
128
+ expect(results.first.first.title).to match(/podcast 002/i)
129
+ end
130
+
124
131
  end
125
132
 
126
133
  describe '#ignored' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kagu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte