addic7ed 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/addic7ed/filename.rb +2 -3
- data/lib/addic7ed/subtitle.rb +1 -0
- data/lib/addic7ed/version.rb +1 -1
- data/spec/addic7ed-subtitle_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbf867829f89e180c8a9ea1ecaba686e5955f364
|
4
|
+
data.tar.gz: d6584fb960b5ac97fb12f9b7997c542bc74334dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97bbcc17a3723d49f2cd9b42e7212018c41181aa8f1024dc73540576d0d98f64f3f8b2216e1d0ae3808e10839e1b46af2283da692db041faeeac5c6bd6c9b986
|
7
|
+
data.tar.gz: d008f13a53e310a43fdc0bc3af5fe3643dfc424d660b587ddb18f911b7a581781c7bbedcff73d133e72ea9057bb5606ced8fdfd2fec9d26e2bf06515ab5f65b2
|
data/lib/addic7ed/filename.rb
CHANGED
@@ -7,8 +7,7 @@ module Addic7ed
|
|
7
7
|
|
8
8
|
def initialize(filename)
|
9
9
|
@filename = filename
|
10
|
-
match = TVSHOW_REGEX.match
|
11
|
-
if match
|
10
|
+
if match = TVSHOW_REGEX.match(basename)
|
12
11
|
@showname = match[:showname].gsub('.', ' ')
|
13
12
|
@season = match[:season].to_i
|
14
13
|
@episode = match[:episode].to_i
|
@@ -20,7 +19,7 @@ module Addic7ed
|
|
20
19
|
end
|
21
20
|
|
22
21
|
def encoded_showname
|
23
|
-
@showname.
|
22
|
+
@encoded_showname ||= showname.
|
24
23
|
gsub(/ /, '_').
|
25
24
|
gsub(/_(US)$/i, '_(\1)').
|
26
25
|
gsub(/_(US)_/i, '_(\1)_').
|
data/lib/addic7ed/subtitle.rb
CHANGED
data/lib/addic7ed/version.rb
CHANGED
@@ -57,6 +57,13 @@ describe Addic7ed::Subtitle do
|
|
57
57
|
expect(Addic7ed::Subtitle.new('DIMENSION Proper', '', '', '', '', '0').version).to eq 'DIMENSION'
|
58
58
|
end
|
59
59
|
|
60
|
+
it 'automatically removes "RERIP" in version string' do
|
61
|
+
expect(Addic7ed::Subtitle.new('RERIP DIMENSION', '', '', '', '', '0').version).to eq 'DIMENSION'
|
62
|
+
expect(Addic7ed::Subtitle.new('Rerip DIMENSION', '', '', '', '', '0').version).to eq 'DIMENSION'
|
63
|
+
expect(Addic7ed::Subtitle.new('DIMENSION RERIP', '', '', '', '', '0').version).to eq 'DIMENSION'
|
64
|
+
expect(Addic7ed::Subtitle.new('DIMENSION Rerip', '', '', '', '', '0').version).to eq 'DIMENSION'
|
65
|
+
end
|
66
|
+
|
60
67
|
it 'automatically removes "Version" prefix in version string' do
|
61
68
|
expect(Addic7ed::Subtitle.new('Version DIMENSION', '', '', '', '', '0').version).to eq 'DIMENSION'
|
62
69
|
end
|