addic7ed 0.5.1 → 0.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8370604454a95beeb31c6323d411fe22287288f
4
- data.tar.gz: 10677f536df8c566c459fc2c13d4794aa4bf17ce
3
+ metadata.gz: 5ebc7f9074008da1133b498fd7298f73bbcbe831
4
+ data.tar.gz: 4bb383de643b01367f692df1c95ae9279ea9a724
5
5
  SHA512:
6
- metadata.gz: d93dd9659dddf3395f8c57cf848243975ace2d87a94f4b1672dd4a4cf051c6d7d51e6094ff52676f5b416c5e797963249853b3e4ffd995b4421981da326fe0bc
7
- data.tar.gz: 16e4468dc8f6af49d893b9c07bcd32c66ad97d2a61e92b323a976b84fb7fd05ffdd56eefd91c13898ec3e5af37be7327bdefbf78030db9fb3249e7d27a812506
6
+ metadata.gz: 17d850861b9c8d358614b8d1f3f9d010c5affa2064a10a1bc61af1df54dd7089eb987d022d1b24ec0de2be92c5f6bc4350d4784c086eee5863530684ea7f606a
7
+ data.tar.gz: e8f3d3595de26c98da217eb685a8c4bed7cfd7dd038178b25fccd706964d6d063222ab9139f4af80a018ac39a1c95463eede23b22eeec5c0c303a7a7617a693a
@@ -42,14 +42,8 @@ module Addic7ed
42
42
 
43
43
  def normalize_version(version)
44
44
  (version || "").
45
- gsub(/^Version */i, '').
46
- gsub(/720p/i, '').
47
- gsub(/hdtv/i, '').
48
- gsub(/proper/i, '').
49
- gsub(/rerip/i, '').
50
- gsub(/x\.?264/i, '').
51
- gsub(/^[- \.]*/, '').
52
- gsub(/[- \.]*$/, '').
45
+ gsub(/(^Version *|720p|1080p|hdtv|proper|rerip|x\.?264)/i, '').
46
+ gsub(/^[- \.]*/, '').gsub(/[- \.]*$/, '').
53
47
  upcase
54
48
  end
55
49
 
@@ -1,3 +1,3 @@
1
1
  module Addic7ed
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -26,6 +26,10 @@ describe Addic7ed::Subtitle, "#normalize_version!" do
26
26
  expect(normalized_version("720P DIMENSION")).to eq 'DIMENSION'
27
27
  end
28
28
 
29
+ it "removes '1080p' tag" do
30
+ expect(normalized_version("1080P DIMENSION")).to eq 'DIMENSION'
31
+ end
32
+
29
33
  it "removes 'HDTV' tag" do
30
34
  expect(normalized_version("HDTV DIMENSION")).to eq 'DIMENSION'
31
35
  end
@@ -46,6 +50,10 @@ describe Addic7ed::Subtitle, "#normalize_version!" do
46
50
  it "removes the 'Version' prefix" do
47
51
  expect(normalized_version("Version DIMENSION")).to eq 'DIMENSION'
48
52
  end
53
+
54
+ it "removes combined tags" do
55
+ expect(normalized_version("Version 720P PROPER X264 HDTV DIMENSION")).to eq "DIMENSION"
56
+ end
49
57
  end
50
58
 
51
59
  describe Addic7ed::Subtitle, "#to_s" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: addic7ed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Baudino