movies 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/movies/exclude.yml +28 -26
- data/lib/movies/filter.rb +2 -3
- data/movies.gemspec +3 -3
- data/spec/filter_spec.rb +11 -1
- metadata +5 -7
data/lib/movies/exclude.yml
CHANGED
@@ -1,27 +1,29 @@
|
|
1
1
|
excluded:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
2
|
+
plain:
|
3
|
+
- "((xvid(-[a-z]+)?))"
|
4
|
+
- "(720|480|1080)p"
|
5
|
+
- B(R|D)Rip
|
6
|
+
- cam
|
7
|
+
- telesync|([^a-z])ts([^a-z]?)
|
8
|
+
- telecine|([^a-z])tc([^a-z]?)
|
9
|
+
- "([^a-z])rx([^a-z]?)"
|
10
|
+
- dvdscr
|
11
|
+
- screener
|
12
|
+
- hdtv
|
13
|
+
- dvdrip
|
14
|
+
- workprint
|
15
|
+
- brrip|bluray|blu(-?)ray
|
16
|
+
- dvd(-?)r
|
17
|
+
- (.+-)?x264(-.+)?
|
18
|
+
- UNRATED
|
19
|
+
- SCR
|
20
|
+
- "((ac3(-[a-z]+)?))"
|
21
|
+
- LIMITED
|
22
|
+
- (\w+)?SUB
|
23
|
+
- NTSC
|
24
|
+
- PAL
|
25
|
+
- "S\d{1,2}E\d{1,2}"
|
26
|
+
- "R[4|5|6]"
|
27
|
+
groups:
|
28
|
+
- EXTENDED
|
29
|
+
- IMAGiNE
|
data/lib/movies/filter.rb
CHANGED
@@ -27,9 +27,8 @@ class MovieFilter
|
|
27
27
|
string = string.gsub(regex, ' ')
|
28
28
|
end
|
29
29
|
|
30
|
-
excluded.each
|
31
|
-
|
32
|
-
end
|
30
|
+
excluded["plain"].each { |clean| string.gsub!(/#{clean}.*$/i, ' ') }
|
31
|
+
excluded["groups"].each { |clean| string.gsub!(/#{clean}.*$/, ' ') }
|
33
32
|
|
34
33
|
string.strip
|
35
34
|
end
|
data/movies.gemspec
CHANGED
@@ -3,13 +3,13 @@ $:.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.
|
6
|
+
s.version = "0.1.9"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Linus Oleander"]
|
9
9
|
s.email = ["linus@oleander.nu"]
|
10
10
|
s.homepage = "https://github.com/oleander/Movies"
|
11
|
-
s.summary = %q{
|
12
|
-
s.description = %q{
|
11
|
+
s.summary = %q{Ruby bindings for IMDb using imdbapi.com as source}
|
12
|
+
s.description = %q{Ruby bindings for IMDb using imdbapi.com as source}
|
13
13
|
|
14
14
|
s.rubyforge_project = "movies"
|
15
15
|
|
data/spec/filter_spec.rb
CHANGED
@@ -163,11 +163,21 @@ describe MovieFilter do
|
|
163
163
|
it "should not contain 'R6'" do
|
164
164
|
MovieFilter.new(title: "Just Go With It R6 LiNE XviD-Rx").title.should_not match(/r6/i)
|
165
165
|
end
|
166
|
-
|
166
|
+
|
167
167
|
it "should be able to parse the year" do
|
168
168
|
MovieFilter.new(title: "Sex.And.The.City.2.2010.SUB.DVDRip.XviD.AC3-Rx").year.should eq(2010)
|
169
169
|
MovieFilter.new(title: "VC Arcade 1942 Wii-LaKiTu").year.should eq(1942)
|
170
170
|
MovieFilter.new(title: "VC Arcade 1942 Wii-LaKiTu", year: 1920).year.should eq(1920)
|
171
171
|
end
|
172
|
+
|
173
|
+
describe "bugs" do
|
174
|
+
it "should not remove the hole string - 1" do
|
175
|
+
MovieFilter.new(title: "The Walking Dead S02E05 SWESUB HDTV XviD-SD.avi").title.should eq("The Walking Dead")
|
176
|
+
end
|
177
|
+
|
178
|
+
it "should not remove the hole string - 2" do
|
179
|
+
MovieFilter.new(title: "Imagine.UK.S20E04.HDTV.XviD-BARGE").title.should eq("Imagine UK")
|
180
|
+
end
|
181
|
+
end
|
172
182
|
end
|
173
183
|
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.
|
5
|
+
version: 0.1.9
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Linus Oleander
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-11-23 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: rest-client
|
@@ -68,7 +67,7 @@ dependencies:
|
|
68
67
|
version: "0"
|
69
68
|
type: :development
|
70
69
|
version_requirements: *id005
|
71
|
-
description:
|
70
|
+
description: Ruby bindings for IMDb using imdbapi.com as source
|
72
71
|
email:
|
73
72
|
- linus@oleander.nu
|
74
73
|
executables: []
|
@@ -100,7 +99,6 @@ files:
|
|
100
99
|
- spec/fixtures/vcr_cassettes/tt1285016.yml
|
101
100
|
- spec/movies_spec.rb
|
102
101
|
- spec/spec_helper.rb
|
103
|
-
has_rdoc: true
|
104
102
|
homepage: https://github.com/oleander/Movies
|
105
103
|
licenses: []
|
106
104
|
|
@@ -124,10 +122,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
122
|
requirements: []
|
125
123
|
|
126
124
|
rubyforge_project: movies
|
127
|
-
rubygems_version: 1.
|
125
|
+
rubygems_version: 1.8.8
|
128
126
|
signing_key:
|
129
127
|
specification_version: 3
|
130
|
-
summary:
|
128
|
+
summary: Ruby bindings for IMDb using imdbapi.com as source
|
131
129
|
test_files:
|
132
130
|
- spec/filter_spec.rb
|
133
131
|
- spec/fixtures/vcr_cassettes/bug1.yml
|