undertexter 0.0.4 → 0.0.5
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.
- data/Gemfile.lock +1 -1
- data/lib/subtitle.rb +1 -1
- data/lib/undertexter.rb +4 -2
- data/lib/undertexter/version.rb +1 -1
- data/spec/undertexter_spec.rb +11 -4
- metadata +6 -6
data/Gemfile.lock
CHANGED
data/lib/subtitle.rb
CHANGED
data/lib/undertexter.rb
CHANGED
@@ -10,7 +10,8 @@ class Undertexter
|
|
10
10
|
:language => {
|
11
11
|
:swedish => 'soek',
|
12
12
|
:english => 'eng_search'
|
13
|
-
}
|
13
|
+
},
|
14
|
+
:preferred_language => options[:language]
|
14
15
|
}
|
15
16
|
|
16
17
|
# If a non existing language is being used, swedish will be the default
|
@@ -79,7 +80,8 @@ class Undertexter
|
|
79
80
|
:downloads => movie[1].match(/\d+$/)[0].to_i,
|
80
81
|
:title => movie[2],
|
81
82
|
:details => movie[3],
|
82
|
-
:movie_title => movie[4]
|
83
|
+
:movie_title => movie[4],
|
84
|
+
:language => @options[:preferred_language]
|
83
85
|
})
|
84
86
|
end
|
85
87
|
end
|
data/lib/undertexter/version.rb
CHANGED
data/spec/undertexter_spec.rb
CHANGED
@@ -91,15 +91,22 @@ end
|
|
91
91
|
|
92
92
|
describe Undertexter, "should work when trying to fetch some english subtitles" do
|
93
93
|
it "should return at least 48 subtitles" do
|
94
|
-
Undertexter.should have_at_least(48).find("tt0840361",
|
94
|
+
Undertexter.should have_at_least(48).find("tt0840361", :language => :english)
|
95
95
|
end
|
96
96
|
|
97
97
|
it "should return at least 8 subtitles" do
|
98
|
-
Undertexter.should have_at_least(8).find("tt0840361",
|
98
|
+
Undertexter.should have_at_least(8).find("tt0840361", :language => :swedish)
|
99
99
|
end
|
100
100
|
|
101
101
|
it "should return at least 8 subtitles" do
|
102
|
-
Undertexter.should have_at_least(8).find("tt0840361",
|
102
|
+
Undertexter.should have_at_least(8).find("tt0840361", :language => :strange)
|
103
|
+
end
|
104
|
+
|
105
|
+
it "should return the right url when trying to fetch an english sub" do
|
106
|
+
Undertexter.find("tt0840361", :language => :english).first.url.should match(/http:\/\/eng\.undertexter\.se\/subtitle\.php\?id=\d+/)
|
107
|
+
end
|
108
|
+
|
109
|
+
it "should return the right url when trying to fetch an swedish sub" do
|
110
|
+
Undertexter.find("tt0840361", :language => :swedish).first.url.should match(/http:\/\/www\.undertexter\.se\/utext\.php\?id=\d+/)
|
103
111
|
end
|
104
|
-
# http://www.undertexter.se/www.php?www=http://engsub.net/?p=subtitle&id=92097
|
105
112
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: undertexter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 21
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Linus Oleander
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-25 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
requirements: []
|
113
113
|
|
114
114
|
rubyforge_project: undertexter
|
115
|
-
rubygems_version: 1.
|
115
|
+
rubygems_version: 1.3.7
|
116
116
|
signing_key:
|
117
117
|
specification_version: 3
|
118
118
|
summary: A subtitle search client for undertexter.se
|