addic7ed 0.3.1 → 0.3.2
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 +4 -4
- data/lib/addic7ed/version.rb +1 -1
- data/spec/addic7ed-filename_spec.rb +5 -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: 01387dc94bdca35f99fb2b23d6758dabf22aa10d
|
|
4
|
+
data.tar.gz: 9a4dbff972a206ba5c62e18ec407d0da1cf52179
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e169d4ce3aeb73c28647f808f01208fe17d2f5b9e8bef402cb3bc49c4990b58bf8891728e6ebc5590faac50b8749dc20b27132e540fbd131468abd0b7c3e5b5f
|
|
7
|
+
data.tar.gz: 0c4c6d47c3743c7465f5bab7e6da9a1d258067710a887ec1e95e2d20ee8119bb5f760aa6d36a78a554428997b16c6b18ee4a792ba8405252cc01c95a1e325358
|
data/lib/addic7ed/filename.rb
CHANGED
|
@@ -22,10 +22,10 @@ module Addic7ed
|
|
|
22
22
|
def encoded_showname
|
|
23
23
|
@showname.
|
|
24
24
|
gsub(/ /, '_').
|
|
25
|
-
gsub(/
|
|
26
|
-
gsub(/
|
|
27
|
-
gsub(/_UK
|
|
28
|
-
gsub(/_UK_
|
|
25
|
+
gsub(/_(US)$/i, '_(\1)').
|
|
26
|
+
gsub(/_(US)_/i, '_(\1)_').
|
|
27
|
+
gsub(/_UK$/i, '').
|
|
28
|
+
gsub(/_UK_/i, '_').
|
|
29
29
|
gsub(/_\d{4}$/, '').
|
|
30
30
|
gsub(/_\d{4}_/, '_')
|
|
31
31
|
end
|
data/lib/addic7ed/version.rb
CHANGED
|
@@ -32,6 +32,7 @@ describe Addic7ed::Filename do
|
|
|
32
32
|
# Filename with special tags
|
|
33
33
|
@filename_showname_US = 'Shameless.US.S03E06.720p.HDTV.x264-IMMERSE.mkv'
|
|
34
34
|
@filename_showname_UK = 'Shameless.UK.S09E11.720p.HDTV.x264-TLA.mkv'
|
|
35
|
+
@filename_showname_US_lowercase = 'shameless.us.s04e01.720p.hdtv.x264-2hd.mkv'
|
|
35
36
|
@filename_showname_UK_year = 'The.Hour.UK.2011.S01E03.REPACK.HDTV.XviD-FoV.avi'
|
|
36
37
|
@filename_showname_year_UK = 'The.Hour.2011.UK.S01E03.REPACK.HDTV.XviD-FoV.avi'
|
|
37
38
|
@filename_showname_US_year = 'The.Hour.US.2011.S01E03.REPACK.HDTV.XviD-FoV.avi'
|
|
@@ -276,6 +277,10 @@ describe Addic7ed::Filename do
|
|
|
276
277
|
Addic7ed::Filename.new(@filename_showname_US).encoded_showname.should == 'Shameless_(US)'
|
|
277
278
|
end
|
|
278
279
|
|
|
280
|
+
it 'should detect country code even in lowercase' do
|
|
281
|
+
Addic7ed::Filename.new(@filename_showname_US_lowercase).encoded_showname.should == 'shameless_(us)'
|
|
282
|
+
end
|
|
283
|
+
|
|
279
284
|
it 'should remove country code for the original show (usually UK)' do
|
|
280
285
|
Addic7ed::Filename.new(@filename_showname_UK).encoded_showname.should == 'Shameless'
|
|
281
286
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: addic7ed
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Baudino
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-02-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|