undertexter 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -1
- data/README.markdown +2 -2
- data/lib/.undertexter.rb.swp +0 -0
- data/lib/subtitle.rb +1 -1
- data/lib/undertexter/array.rb +2 -0
- data/spec/data/127.Hours.2010.DVDSCR.XViD-MC8 +0 -0
- data/spec/subtitle_spec.rb +1 -1
- data/spec/undertexter_spec.rb +3 -7
- data/undertexter.gemspec +1 -1
- metadata +6 -3
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
undertexter (0.1.
|
4
|
+
undertexter (0.1.2)
|
5
5
|
levenshteinish
|
6
6
|
mimer_plus
|
7
7
|
nokogiri
|
@@ -32,5 +32,9 @@ PLATFORMS
|
|
32
32
|
ruby
|
33
33
|
|
34
34
|
DEPENDENCIES
|
35
|
+
levenshteinish
|
36
|
+
mimer_plus
|
37
|
+
nokogiri
|
38
|
+
rest-client
|
35
39
|
rspec
|
36
40
|
undertexter!
|
data/README.markdown
CHANGED
@@ -60,7 +60,7 @@ This is how to use it in `irb`.
|
|
60
60
|
$ Undertexter.find("tt0840361").based_on("The Town EXTENDED 2010 480p BRRip XviD AC3 FLAWL3SS")
|
61
61
|
=> #<Subtitle:0x00000101b739d0 @cds=1, @downloads=1644, @title="The.Town.EXTENDED.2010.480p.BRRip.XviD.AC3-FLAWL3SS", @details="http://www.undertexter.se/?p=undertext&id=23752", @movie_title="The Town", @language=:swedish>
|
62
62
|
|
63
|
-
### Specify how sensitive the `based_on` method should be, from `0.0` to `1.
|
63
|
+
### Specify how sensitive the `based_on` method should be, from `0.0` to `1.0`
|
64
64
|
|
65
65
|
$ Undertexter.find("tt0840361").based_on("The Town EXTENDED 2010 480p BRRip XviD AC3 FLAWL3SS", limit: 0.0)
|
66
66
|
=> nil
|
@@ -114,4 +114,4 @@ Add `gem 'undertexter'` to your Gemfile and run `bundle`.
|
|
114
114
|
|
115
115
|
## Requirements
|
116
116
|
|
117
|
-
Undertexter is tested
|
117
|
+
Undertexter is tested on OS X 10.6.6 using Ruby 1.8.7 and 1.9.2.
|
Binary file
|
data/lib/subtitle.rb
CHANGED
@@ -9,7 +9,7 @@ class Subtitle
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def url
|
12
|
-
@language == :english ? "http://eng.undertexter.se/subtitle.php?id=#{id}" : "http://
|
12
|
+
@language == :english ? "http://eng.undertexter.se/subtitle.php?id=#{id}" : "http://undertexter.se/laddatext.php?id=#{id}"
|
13
13
|
end
|
14
14
|
|
15
15
|
# Downloading the file and saves it disk
|
data/lib/undertexter/array.rb
CHANGED
File without changes
|
data/spec/subtitle_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe Subtitle do
|
|
24
24
|
@subtitle.cds.should eq(1)
|
25
25
|
@subtitle.title.should eq("127 Hours 2010 DVDSCR XViD-MC8")
|
26
26
|
@subtitle.movie_title.should eq("127 Hours (127 Timmar)")
|
27
|
-
@subtitle.url.should eq("http://
|
27
|
+
@subtitle.url.should eq("http://undertexter.se/laddatext.php?id=23984")
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should be able to download the subtitle" do
|
data/spec/undertexter_spec.rb
CHANGED
@@ -62,7 +62,7 @@ describe Undertexter, "trying to search for a movie using a title" do
|
|
62
62
|
@use.each{|subtitle| subtitle.title.should match(/die.*hard/i)}
|
63
63
|
end
|
64
64
|
|
65
|
-
it "should contain the right
|
65
|
+
it "should contain the right details, again" do
|
66
66
|
@use.each {|subtitle| subtitle.details.should match(/^http:\/\/www\.undertexter\.se\/\?p=undertext&id=\d+$/i)}
|
67
67
|
end
|
68
68
|
|
@@ -78,10 +78,6 @@ describe Undertexter, "trying to search for a movie using a title" do
|
|
78
78
|
@use.each {|subtitle| subtitle.movie_title.should_not match(/^\s+.+\s+$/)}
|
79
79
|
end
|
80
80
|
|
81
|
-
it "should return a direct link to the subtitle" do
|
82
|
-
@use.each{|subtitle| subtitle.url.should match(/http:\/\/www\.undertexter\.se\/utext\.php\?id=\d+/i)}
|
83
|
-
end
|
84
|
-
|
85
81
|
it "should return the same id for every link" do
|
86
82
|
@use.each_with_index do |subtitle, index|
|
87
83
|
subtitle.url.match(/id=(\d+)/)[1].should eq(@use[index].details.match(/id=(\d+)/)[1])
|
@@ -103,10 +99,10 @@ describe Undertexter, "should work when trying to fetch some english subtitles"
|
|
103
99
|
end
|
104
100
|
|
105
101
|
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+/)
|
102
|
+
Undertexter.find("tt0840361", :language => :english).first.url.should match(/http:\/\/eng\.undertexter\.se\/subtitle\.php\?id=\d+/i)
|
107
103
|
end
|
108
104
|
|
109
105
|
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:\/\/
|
106
|
+
Undertexter.find("tt0840361", :language => :swedish).first.url.should match(/http:\/\/undertexter\.se\/laddatext\.php\?id=\d+/i)
|
111
107
|
end
|
112
108
|
end
|
data/undertexter.gemspec
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Linus Oleander
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-04 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -98,10 +98,12 @@ files:
|
|
98
98
|
- Gemfile.lock
|
99
99
|
- README.markdown
|
100
100
|
- Rakefile
|
101
|
+
- lib/.undertexter.rb.swp
|
101
102
|
- lib/subtitle.rb
|
102
103
|
- lib/undertexter.rb
|
103
104
|
- lib/undertexter/array.rb
|
104
105
|
- spec/array_spec.rb
|
106
|
+
- spec/data/127.Hours.2010.DVDSCR.XViD-MC8
|
105
107
|
- spec/spec_helper.rb
|
106
108
|
- spec/subtitle_spec.rb
|
107
109
|
- spec/undertexter_spec.rb
|
@@ -140,6 +142,7 @@ specification_version: 3
|
|
140
142
|
summary: A subtitle search client for undertexter.se
|
141
143
|
test_files:
|
142
144
|
- spec/array_spec.rb
|
145
|
+
- spec/data/127.Hours.2010.DVDSCR.XViD-MC8
|
143
146
|
- spec/spec_helper.rb
|
144
147
|
- spec/subtitle_spec.rb
|
145
148
|
- spec/undertexter_spec.rb
|