movies 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/movies.rb CHANGED
@@ -109,14 +109,14 @@ class Movies
109
109
  end
110
110
 
111
111
  def self.cleaner(string)
112
- excluded.each do |clean|
113
- string = string.gsub(/#{clean}/i, ' ')
114
- end
115
-
116
- [/((19|20)\d{2})/, /\./, /\s*-\s*/, /\s{2,}/].each do |regex|
112
+ [/((19|20)\d{2}).*$/, /\./, /\s*-\s*/, /\s{2,}/].each do |regex|
117
113
  string = string.gsub(regex, ' ')
118
114
  end
119
-
115
+
116
+ excluded.each do |clean|
117
+ string = string.gsub(/#{clean}.*$/i, ' ')
118
+ end
119
+
120
120
  string.strip
121
121
  end
122
122
 
@@ -22,4 +22,5 @@ excluded:
22
22
  - LIMITED
23
23
  - (.+)?SUB
24
24
  - NTSC
25
- - PAL
25
+ - PAL
26
+ - "S\d{1,2}E\d{1,2}"
data/movies.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "movies"
6
- s.version = "0.1.3"
6
+ s.version = "0.1.4"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Linus Oleander"]
9
9
  s.email = ["linus@oleander.nu"]
data/spec/exclude_spec.rb CHANGED
@@ -114,11 +114,11 @@ describe "exclude.yaml" do
114
114
  end
115
115
 
116
116
  it "should not contain 'PAL'" do
117
- Movies.cleaner("1942 PAL VC Arcade Wii-LaKiTu").should_not match(/pal/i)
117
+ Movies.cleaner("Sex And The City 2 2010 SUB PAL DVDRip XviD AC3-Rx").should_not match(/pal/i)
118
118
  end
119
119
 
120
120
  it "should not contain a year" do
121
- Movies.cleaner("1942 PAL VC Arcade Wii-LaKiTu").should_not match(/1942/)
121
+ Movies.cleaner("VC Arcade 1942 Wii-LaKiTu").should_not match(/1942/)
122
122
  end
123
123
 
124
124
  it "should not contain dots" do
@@ -136,4 +136,8 @@ describe "exclude.yaml" do
136
136
  it "should strip ingoing params" do
137
137
  Movies.cleaner(" A B ").should eq("A B")
138
138
  end
139
+
140
+ it "should remove TV related data" do
141
+ Movies.cleaner("Bones S06E19 HDTV XviD-LOL").should_not match(/s06e19/i)
142
+ end
139
143
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: movies
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Linus Oleander