sindex 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sindex/series_index.rb +4 -3
- data/lib/sindex/version.rb +1 -1
- data/test/test_series_index.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc43040a3a6eebb9f7d7e82d35f31692b8cd800
|
4
|
+
data.tar.gz: 6fd7ee91bfcecbd424b8a847d21583762d3e759d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2320984dfc8e448c07c75bdb59100de737899bfd979939dac4fc88f32d65601763e304beddb2c83721a44e74dfd48398d725d3a439a8abfcd84565719b9a4583
|
7
|
+
data.tar.gz: 291d7c433a459d9ac88fdd59ac4b36c15a75e641169bc3c3201169480dba17074d534bb48710f8ad1faac7270cd800420a087ebe46bcf74504844d530c960c60
|
data/lib/sindex/series_index.rb
CHANGED
@@ -296,11 +296,13 @@ module Sindex
|
|
296
296
|
# Returns the seriesname in index or nil if it does not exist
|
297
297
|
def series_name_in_index(name)
|
298
298
|
|
299
|
-
|
299
|
+
escaped = Regexp.escape(name)
|
300
|
+
|
301
|
+
matching_series = @series_data.keys.grep(/^#{ escaped }$/i).first
|
300
302
|
return matching_series if matching_series
|
301
303
|
|
302
304
|
@series_aliases.each do |key, val|
|
303
|
-
if key.match(/^#{
|
305
|
+
if key.match(/^#{ escaped }$/i)
|
304
306
|
return val
|
305
307
|
end
|
306
308
|
end
|
@@ -391,5 +393,4 @@ module Sindex
|
|
391
393
|
end
|
392
394
|
|
393
395
|
end
|
394
|
-
|
395
396
|
end
|
data/lib/sindex/version.rb
CHANGED
data/test/test_series_index.rb
CHANGED
@@ -77,6 +77,13 @@ class TestIndex < Test::Unit::TestCase
|
|
77
77
|
"Community.S01E31.Bankgeheimnis.DL.German.HDTV.XviD-GDR")
|
78
78
|
end
|
79
79
|
|
80
|
+
def test_that_invalid_series_data_does_not_crash_sindex
|
81
|
+
assert_nothing_raised {
|
82
|
+
@series_index.is_series_in_index?(
|
83
|
+
"Family.Guy.Presents.Its.a.Trap.2010.1080p.BluRay.DTS.DL.x264-HDC.(S09E18)")
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
80
87
|
def test_that_an_index_can_be_dumped_right
|
81
88
|
filename = Tempfile.new('dumped_index').path
|
82
89
|
@series_index.dump_index_to_file(filename)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sindex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philipp Böhm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|