subtitle_it 1.9.0 → 2.0.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 +7 -0
- data/.gitignore +5 -0
- data/Gemfile +3 -0
- data/{README.rdoc → README.md} +22 -18
- data/Rakefile +13 -18
- data/bin/subtitle_it +4 -8
- data/lib/subtitle_it/bin.rb +50 -58
- data/lib/subtitle_it/fixes.rb +3 -4
- data/lib/subtitle_it/formats/ass.rb +5 -6
- data/lib/subtitle_it/formats/mpl.rb +9 -9
- data/lib/subtitle_it/formats/rsb.rb +9 -9
- data/lib/subtitle_it/formats/srt.rb +17 -14
- data/lib/subtitle_it/formats/sub.rb +7 -7
- data/lib/subtitle_it/formats/xml.rb +13 -12
- data/lib/subtitle_it/formats/yml.rb +5 -5
- data/lib/subtitle_it/generator.rb +2 -2
- data/lib/subtitle_it/languages.rb +52 -53
- data/lib/subtitle_it/movie.rb +26 -6
- data/lib/subtitle_it/platform_endl.rb +7 -5
- data/lib/subtitle_it/subdown.rb +30 -33
- data/lib/subtitle_it/subline.rb +5 -5
- data/lib/subtitle_it/substyle.rb +3 -9
- data/lib/subtitle_it/subtime.rb +19 -10
- data/lib/subtitle_it/subtitle.rb +20 -28
- data/lib/subtitle_it/version.rb +1 -7
- data/lib/subtitle_it.rb +7 -7
- data/spec/fixtures/movie.xml +2 -2
- data/spec/spec_helper.rb +6 -6
- data/spec/subtitle_it/bin_spec.rb +110 -98
- data/spec/subtitle_it/formats/ass_spec.rb +2 -3
- data/spec/subtitle_it/formats/mpl_spec.rb +26 -28
- data/spec/subtitle_it/formats/rsb_spec.rb +29 -30
- data/spec/subtitle_it/formats/srt_spec.rb +27 -30
- data/spec/subtitle_it/formats/sub_spec.rb +19 -21
- data/spec/subtitle_it/formats/xml_spec.rb +21 -21
- data/spec/subtitle_it/formats/yml_spec.rb +14 -15
- data/spec/subtitle_it/movie_spec.rb +24 -15
- data/spec/subtitle_it/subdown_spec.rb +58 -65
- data/spec/subtitle_it/subline_spec.rb +17 -18
- data/spec/subtitle_it/subtime_spec.rb +43 -44
- data/spec/subtitle_it/subtitle_spec.rb +28 -29
- data/spec/subtitle_it_spec.rb +4 -5
- data/subtitle_it.gemspec +25 -98
- metadata +121 -67
- data/.rspec +0 -2
- data/config/hoe.rb +0 -73
- data/config/requirements.rb +0 -15
- data/lib/subtitle_it/movie_hasher.rb +0 -30
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -82
- data/spec/subtitle_it/movie_hasher_spec.rb +0 -13
- data/tasks/deployment.rake +0 -34
- data/tasks/environment.rake +0 -7
- data/tasks/rspec.rake +0 -21
@@ -1,20 +1,19 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
|
3
|
-
describe Formats,
|
4
|
-
describe
|
3
|
+
describe Formats, '.yml' do
|
4
|
+
describe 'Out' do
|
5
5
|
include SubFixtures
|
6
|
-
|
7
|
-
before(:each) do
|
8
|
-
@sub = Subtitle.new(
|
9
|
-
end
|
10
|
-
|
11
|
-
it
|
12
|
-
@sub.to_yml.
|
6
|
+
|
7
|
+
before(:each) do
|
8
|
+
@sub = Subtitle.new(dump: yml_fixture, format: 'yml')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should have author' do
|
12
|
+
expect(@sub.to_yml).to match(/author: warlley, nofxx/)
|
13
13
|
end
|
14
|
-
|
15
|
-
it
|
16
|
-
@sub.to_yml.
|
14
|
+
|
15
|
+
it 'should have version' do
|
16
|
+
expect(@sub.to_yml).to match(/version: 1.1/)
|
17
17
|
end
|
18
|
-
|
19
|
-
|
20
|
-
end
|
18
|
+
end
|
19
|
+
end
|
@@ -4,22 +4,31 @@ describe Movie do
|
|
4
4
|
before(:each) do
|
5
5
|
@movie = Movie.new('pulpfiction')
|
6
6
|
end
|
7
|
-
|
8
|
-
it
|
9
|
-
@movie.info.
|
10
|
-
@movie.filename.
|
7
|
+
|
8
|
+
it 'should initialize nicely' do
|
9
|
+
expect(@movie.info).to be_instance_of(Hash)
|
10
|
+
expect(@movie.filename).to eql('pulpfiction')
|
11
11
|
end
|
12
|
-
|
13
|
-
it
|
14
|
-
File.
|
15
|
-
File.
|
16
|
-
#TODO.. how to mock this?
|
17
|
-
#MovieHasher.should_receive(:compute_hash)
|
18
|
-
@movie.haxx.
|
12
|
+
|
13
|
+
it 'should call for a hash' do
|
14
|
+
expect(File).to receive(:open).with('pulpfiction', 'rb')
|
15
|
+
expect(File).to receive(:size).with('pulpfiction').and_return(13_141)
|
16
|
+
# TODO.. how to mock this?
|
17
|
+
# MovieHasher.should_receive(:compute_hash)
|
18
|
+
expect(@movie.haxx).to eql('0000000000003355')
|
19
19
|
end
|
20
|
-
|
21
|
-
it
|
22
|
-
File.
|
20
|
+
|
21
|
+
it 'should call for size' do
|
22
|
+
expect(File).to receive(:size).with('pulpfiction')
|
23
23
|
@movie.size
|
24
|
-
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should generate a beatiful hash for us' do
|
27
|
+
expect(Movie::CHUNK_SIZE).to eql(65_536)
|
28
|
+
|
29
|
+
expect(File).to receive(:size).with('onefile').and_return(1020)
|
30
|
+
expect(File).to receive(:open).with('onefile', 'rb')
|
31
|
+
|
32
|
+
expect(Movie.new('onefile').haxx).to eql('00000000000003fc')
|
33
|
+
end
|
25
34
|
end
|
@@ -1,103 +1,96 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
2
|
|
3
3
|
module SubdownHelper
|
4
|
-
def mock_xmlrpc(stubs={})
|
5
|
-
@mock_xmlrpc ||=
|
4
|
+
def mock_xmlrpc(stubs = {})
|
5
|
+
@mock_xmlrpc ||= double(XMLRPC::Client, stubs) # , @auth=nil, @parser=nil, @user=nil, @timeout=30, @cookie=nil, @http=#<Net::HTTP www.opensubtitles.org:80 open=false>, @use_ssl=false, @http_last_response=nil, @port=80, @host="www.opensubtitles.org", @path="/xml-rpc", @http_header_extra=nil, @create=nil, @password=nil, @proxy_port=nil, @proxy_host=nil>
|
6
6
|
end
|
7
|
+
|
7
8
|
def mock_movie
|
8
|
-
@mock_movie =
|
9
|
+
@mock_movie = double(Movie, haxx: '09a2c497663259cb', size: 81_401)
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
13
|
describe Subdown do
|
14
14
|
include SubdownHelper
|
15
15
|
|
16
16
|
before(:each) do
|
17
|
-
@sub =
|
17
|
+
@sub = double(Subtitle)
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
21
|
-
XMLRPC::Client.
|
20
|
+
it 'should initialize nicely' do
|
21
|
+
expect(XMLRPC::Client).to receive(:new2)
|
22
22
|
@down = Subdown.new
|
23
23
|
end
|
24
24
|
|
25
|
-
it
|
26
|
-
XMLRPC::Client
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
"
|
31
|
-
|
25
|
+
it 'should log in!' do
|
26
|
+
expect(XMLRPC::Client)
|
27
|
+
.to receive(:new2).with('http://api.opensubtitles.org/xml-rpc')
|
28
|
+
.and_return(mock_xmlrpc)
|
29
|
+
expect(@mock_xmlrpc)
|
30
|
+
.to receive(:call).with('LogIn', '', '', '', "SubtitleIt #{SubtitleIt::VERSION}")
|
31
|
+
.and_return(
|
32
|
+
'status' => '200 OK',
|
33
|
+
'seconds' => 0.004,
|
34
|
+
'token' => 'shkuj98gcvu5gp1b5tlo8uq525')
|
32
35
|
@down = Subdown.new
|
33
|
-
@down.
|
36
|
+
expect(@down).not_to be_logged_in
|
34
37
|
@down.log_in!
|
35
|
-
@down.
|
38
|
+
expect(@down).to be_logged_in
|
36
39
|
end
|
37
40
|
|
38
|
-
it
|
39
|
-
XMLRPC::Client.
|
40
|
-
@mock_xmlrpc.
|
41
|
-
|
42
|
-
|
43
|
-
"token"=>""
|
44
|
-
})
|
41
|
+
it 'should raise if connection sux' do
|
42
|
+
expect(XMLRPC::Client).to receive(:new2).with('http://api.opensubtitles.org/xml-rpc').and_return(mock_xmlrpc)
|
43
|
+
expect(@mock_xmlrpc).to receive(:call).with('LogIn', '', '', '', "SubtitleIt #{SubtitleIt::VERSION}").and_return('status' => '404 FAIL',
|
44
|
+
'seconds' => 0.004,
|
45
|
+
'token' => '')
|
45
46
|
@down = Subdown.new
|
46
|
-
|
47
|
-
@down.
|
47
|
+
expect { @down.log_in! }.to raise_error
|
48
|
+
expect(@down).not_to be_logged_in
|
48
49
|
end
|
49
50
|
|
50
|
-
|
51
|
-
describe "Logged in" do
|
51
|
+
describe 'Logged in' do
|
52
52
|
before do
|
53
|
-
XMLRPC::Client.
|
54
|
-
with('http://api.opensubtitles.org/xml-rpc')
|
55
|
-
and_return(mock_xmlrpc)
|
56
|
-
|
57
|
-
@mock_xmlrpc.
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
"token"=>"shkuj98gcvu5gp1b5tlo8uq525"
|
62
|
-
})
|
53
|
+
expect(XMLRPC::Client).to receive(:new2)
|
54
|
+
.with('http://api.opensubtitles.org/xml-rpc')
|
55
|
+
.and_return(mock_xmlrpc)
|
56
|
+
|
57
|
+
expect(@mock_xmlrpc).to receive(:call).with('LogIn', '', '', '',
|
58
|
+
"SubtitleIt #{SubtitleIt::VERSION}").and_return('status' => '200 OK',
|
59
|
+
'seconds' => 0.004,
|
60
|
+
'token' => 'shkuj98gcvu5gp1b5tlo8uq525')
|
63
61
|
@down = Subdown.new
|
64
62
|
@down.log_in!
|
65
63
|
end
|
66
64
|
|
67
|
-
it
|
68
|
-
@mock_xmlrpc.
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
65
|
+
it 'should search for all languages' do
|
66
|
+
expect(@mock_xmlrpc).to receive(:call).with('SearchSubtitles',
|
67
|
+
'shkuj98gcvu5gp1b5tlo8uq525', [{
|
68
|
+
'sublanguageid' => '',
|
69
|
+
'moviebytesize' => 81_401,
|
70
|
+
'moviehash' => '09a2c497663259cb' }]).and_return(
|
71
|
+
result: 200
|
72
|
+
)
|
75
73
|
|
76
|
-
@down.
|
77
|
-
@down.should_receive(:puts).with("all languages.")
|
78
|
-
@down.search_subtitles(mock_movie).should eql([])
|
74
|
+
expect(@down.search_subtitles(mock_movie)).to eql([])
|
79
75
|
end
|
80
76
|
|
81
|
-
it
|
82
|
-
@mock_xmlrpc.
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
77
|
+
it 'should search for one language' do
|
78
|
+
expect(@mock_xmlrpc).to receive(:call).with('SearchSubtitles',
|
79
|
+
'shkuj98gcvu5gp1b5tlo8uq525', [{
|
80
|
+
'sublanguageid' => 'pt',
|
81
|
+
'moviebytesize' => 81_401,
|
82
|
+
'moviehash' => '09a2c497663259cb' }]).and_return(
|
83
|
+
result: 200
|
84
|
+
)
|
89
85
|
|
90
|
-
@down.
|
91
|
-
@down.should_receive(:puts).with("Portuguese...")
|
92
|
-
@down.search_subtitles(mock_movie, "pt").should eql([])
|
86
|
+
expect(@down.search_subtitles(mock_movie, 'pt')).to eql([])
|
93
87
|
end
|
94
88
|
|
95
|
-
# it "should get subtitle languages" do
|
96
|
-
# @down.subtitle_languages.should be_instance_of(Array)
|
97
|
-
# @down.subtitle_languages.length.should eql(51)
|
98
|
-
# @down.subtitle_languages[0].should be_instance_of(String)
|
99
|
-
# end
|
100
|
-
|
89
|
+
# it "should get subtitle languages" do
|
90
|
+
# @down.subtitle_languages.should be_instance_of(Array)
|
91
|
+
# @down.subtitle_languages.length.should eql(51)
|
92
|
+
# @down.subtitle_languages[0].should be_instance_of(String)
|
93
|
+
# end
|
101
94
|
end
|
102
95
|
end
|
103
96
|
|
@@ -2,29 +2,28 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
2
2
|
|
3
3
|
describe Subline do
|
4
4
|
before(:each) do
|
5
|
-
@sub = Subline.new('02:20:02','4',
|
5
|
+
@sub = Subline.new('02:20:02', '4', 'Astalavista, baby...')
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
it "should initialize #{name}" do
|
9
|
-
@sub.text.
|
9
|
+
expect(@sub.text).to eql('Astalavista, baby...')
|
10
10
|
end
|
11
|
-
|
12
|
-
it
|
13
|
-
@sub.time_on.sec.
|
14
|
-
@sub.time_on.min.
|
15
|
-
@sub.time_on.sec.
|
11
|
+
|
12
|
+
it 'should have a nice date on' do
|
13
|
+
expect(@sub.time_on.sec).to eql(2)
|
14
|
+
expect(@sub.time_on.min).to eql(20)
|
15
|
+
expect(@sub.time_on.sec).to eql(2)
|
16
16
|
end
|
17
|
-
|
18
|
-
it
|
19
|
-
@sub.time_off.sec.
|
17
|
+
|
18
|
+
it 'should have the seconds added from the first time' do
|
19
|
+
expect(@sub.time_off.sec).to eql(6)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
describe Subline,
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end.should_not raise_error
|
23
|
+
describe Subline, '.failures' do
|
24
|
+
it 'should correct a timeline beforehe on time' do
|
25
|
+
expect do
|
26
|
+
Subline.new('00:03:01', '00:02:03', 'Astalavista, baby...')
|
27
|
+
end.not_to raise_error
|
29
28
|
end
|
30
|
-
end
|
29
|
+
end
|
@@ -4,70 +4,69 @@ describe Subtime do
|
|
4
4
|
before(:each) do
|
5
5
|
@subtime = Subtime.new('01:02:03.400')
|
6
6
|
end
|
7
|
-
|
8
|
-
it
|
9
|
-
@subtime.hrs.
|
10
|
-
@subtime.min.
|
11
|
-
@subtime.sec.
|
12
|
-
@subtime.ms.
|
7
|
+
|
8
|
+
it 'should convert the hour, minutes and seconds' do
|
9
|
+
expect(@subtime.hrs).to eql(1)
|
10
|
+
expect(@subtime.min).to eql(2)
|
11
|
+
expect(@subtime.sec).to eql(3)
|
12
|
+
expect(@subtime.ms).to eql(400)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should reduce the deciseconds' do
|
16
|
+
expect(800.reduce).to eql(8)
|
13
17
|
end
|
14
|
-
|
15
|
-
it
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should print nicely as string" do
|
20
|
-
@subtime.to_s.should eql("01:02:03.400")
|
18
|
+
|
19
|
+
it 'should print nicely as string' do
|
20
|
+
expect(@subtime.to_s).to eql('01:02:03.400')
|
21
21
|
end
|
22
|
-
|
23
|
-
it
|
24
|
-
@subtime.to_i.
|
22
|
+
|
23
|
+
it 'should become a integer' do
|
24
|
+
expect(@subtime.to_i).to eql(3_723_400)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe
|
29
|
-
it
|
30
|
-
@subtime = Subtime.new(
|
31
|
-
@subtime.to_s.
|
32
|
-
end
|
28
|
+
describe 'and the other way around' do
|
29
|
+
it 'should print nicely' do
|
30
|
+
@subtime = Subtime.new(3_723_400)
|
31
|
+
expect(@subtime.to_s).to eql('01:02:03.400')
|
32
|
+
end
|
33
33
|
end
|
34
34
|
|
35
|
-
describe Subtime,
|
36
|
-
it
|
35
|
+
describe Subtime, 'Stress Test (heh)' do
|
36
|
+
it 'should convert a big time' do
|
37
37
|
@subtime = Subtime.new('11:22:33.742')
|
38
|
-
@subtime.hrs.
|
39
|
-
@subtime.min.
|
40
|
-
@subtime.sec.
|
41
|
-
@subtime.ms.
|
38
|
+
expect(@subtime.hrs).to eql(11)
|
39
|
+
expect(@subtime.min).to eql(22)
|
40
|
+
expect(@subtime.sec).to eql(33)
|
41
|
+
expect(@subtime.ms).to eql(742)
|
42
42
|
end
|
43
|
-
|
44
|
-
it
|
45
|
-
@subtime = Subtime.new('11:22:33.7')
|
46
|
-
@subtime.to_s.
|
43
|
+
|
44
|
+
it 'should print nicely' do
|
45
|
+
@subtime = Subtime.new('11:22:33.7')
|
46
|
+
expect(@subtime.to_s).to eql('11:22:33.700')
|
47
47
|
end
|
48
48
|
|
49
|
-
describe
|
50
|
-
|
51
|
-
it "should parse min:sec.ms" do
|
49
|
+
describe '.other formats' do
|
50
|
+
it 'should parse min:sec.ms' do
|
52
51
|
@subtime = Subtime.new('01:03.4')
|
53
52
|
end
|
54
53
|
|
55
|
-
it
|
54
|
+
it 'should parse min:sec,ms' do
|
56
55
|
@subtime = Subtime.new('01:03,3')
|
57
56
|
end
|
58
|
-
|
59
|
-
it
|
57
|
+
|
58
|
+
it 'should single as seconds hour should be nil' do
|
60
59
|
@subtime = Subtime.new('3')
|
61
|
-
@subtime.hrs.
|
60
|
+
expect(@subtime.hrs).to eql(0)
|
62
61
|
end
|
63
|
-
|
64
|
-
it
|
62
|
+
|
63
|
+
it 'should parse min:sec' do
|
65
64
|
@subtime = Subtime.new('01:03')
|
66
|
-
@subtime.min.
|
65
|
+
expect(@subtime.min).to eql(1)
|
67
66
|
end
|
68
|
-
|
67
|
+
|
69
68
|
after(:each) do
|
70
|
-
@subtime.sec.
|
69
|
+
expect(@subtime.sec).to eql(3)
|
71
70
|
end
|
72
71
|
end
|
73
|
-
end
|
72
|
+
end
|
@@ -1,40 +1,39 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
2
|
|
3
3
|
describe Subtitle do
|
4
|
-
def attr_valid_subtitle
|
5
|
-
{ :
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
}}
|
4
|
+
def attr_valid_subtitle
|
5
|
+
{ info: {
|
6
|
+
'SubLanguageID' => 'eng',
|
7
|
+
'MovieName' => 'Resevoir Dogs',
|
8
|
+
'MovieYear' => '1992',
|
9
|
+
'SubFileName' => 'Cool sub',
|
10
|
+
'MovieImdbRating' => '10.0',
|
11
|
+
'SubDownloadsCnt' => '310',
|
12
|
+
'SubRating' => '9.5',
|
13
|
+
'SubFormat' => 'srt',
|
14
|
+
'SubSumCD' => '2',
|
15
|
+
'SubAuthorComment' => 'Nice nice...'
|
16
|
+
} }
|
17
17
|
end
|
18
|
-
|
19
|
-
it
|
18
|
+
|
19
|
+
it 'should instantiate' do
|
20
20
|
@sub = Subtitle.new(attr_valid_subtitle)
|
21
|
-
@sub.rating.
|
21
|
+
expect(@sub.rating).to eql(9.5)
|
22
22
|
end
|
23
|
-
|
24
|
-
it
|
25
|
-
@sub = Subtitle.new(attr_valid_subtitle.with(
|
26
|
-
@sub.lines[0].text.
|
23
|
+
|
24
|
+
it 'should fill lines' do
|
25
|
+
@sub = Subtitle.new(attr_valid_subtitle.with(dump: '{10}{20} Hello', format: 'sub'))
|
26
|
+
expect(@sub.lines[0].text).to eql(' Hello')
|
27
27
|
end
|
28
|
-
|
29
|
-
|
30
|
-
describe "Compare" do
|
28
|
+
|
29
|
+
describe 'Compare' do
|
31
30
|
before(:each) do
|
32
31
|
@sub = Subtitle.new(attr_valid_subtitle)
|
33
|
-
end
|
34
|
-
|
35
|
-
it
|
36
|
-
@another_sub = Subtitle.new(attr_valid_subtitle.with(:
|
37
|
-
(@sub > @another_sub).
|
38
|
-
end
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should compare to another using rating' do
|
35
|
+
@another_sub = Subtitle.new(attr_valid_subtitle.with(info: { 'SubRating' => 4.0 }))
|
36
|
+
expect(@sub > @another_sub).to eq(true)
|
37
|
+
end
|
39
38
|
end
|
40
39
|
end
|
data/spec/subtitle_it_spec.rb
CHANGED
@@ -3,9 +3,8 @@ require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
3
3
|
# Time to add your specs!
|
4
4
|
# http://rspec.info/
|
5
5
|
describe SubtitleIt do
|
6
|
-
|
7
|
-
|
8
|
-
@sub
|
9
|
-
@sub.should be_instance_of(Subtitle)
|
6
|
+
it 'should instantiate ' do
|
7
|
+
@sub = Subtitle.new(dump: '{12}{30}hey hey heypending', format: 'sub')
|
8
|
+
expect(@sub).to be_instance_of(Subtitle)
|
10
9
|
end
|
11
|
-
end
|
10
|
+
end
|
data/subtitle_it.gemspec
CHANGED
@@ -1,105 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
1
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'subtitle_it/version'
|
5
3
|
|
6
4
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version
|
5
|
+
s.name = 'subtitle_it'
|
6
|
+
s.version = SubtitleIt::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
9
8
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
9
|
s.authors = ["Marcos Piccinini"]
|
12
|
-
s.
|
13
|
-
s.default_executable = %q{subtitle_it}
|
14
|
-
s.description = %q{Download, edit and create subtitles. Supports various formats.}
|
15
|
-
s.email = %q{x@nofxx.com}
|
16
|
-
s.executables = ["subtitle_it"]
|
17
|
-
s.extra_rdoc_files = [
|
18
|
-
"README.rdoc"
|
19
|
-
]
|
20
|
-
s.files = [
|
21
|
-
".rspec",
|
22
|
-
"History.txt",
|
23
|
-
"License.txt",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"bin/subtitle_it",
|
28
|
-
"config/hoe.rb",
|
29
|
-
"config/requirements.rb",
|
30
|
-
"lib/subtitle_it.rb",
|
31
|
-
"lib/subtitle_it/bin.rb",
|
32
|
-
"lib/subtitle_it/fixes.rb",
|
33
|
-
"lib/subtitle_it/formats/ass.rb",
|
34
|
-
"lib/subtitle_it/formats/mpl.rb",
|
35
|
-
"lib/subtitle_it/formats/rsb.rb",
|
36
|
-
"lib/subtitle_it/formats/srt.rb",
|
37
|
-
"lib/subtitle_it/formats/sub.rb",
|
38
|
-
"lib/subtitle_it/formats/xml.rb",
|
39
|
-
"lib/subtitle_it/formats/yml.rb",
|
40
|
-
"lib/subtitle_it/generator.rb",
|
41
|
-
"lib/subtitle_it/languages.rb",
|
42
|
-
"lib/subtitle_it/movie.rb",
|
43
|
-
"lib/subtitle_it/movie_hasher.rb",
|
44
|
-
"lib/subtitle_it/platform_endl.rb",
|
45
|
-
"lib/subtitle_it/subdown.rb",
|
46
|
-
"lib/subtitle_it/subline.rb",
|
47
|
-
"lib/subtitle_it/substyle.rb",
|
48
|
-
"lib/subtitle_it/subtime.rb",
|
49
|
-
"lib/subtitle_it/subtitle.rb",
|
50
|
-
"lib/subtitle_it/version.rb",
|
51
|
-
"script/console",
|
52
|
-
"script/destroy",
|
53
|
-
"script/generate",
|
54
|
-
"script/txt2html",
|
55
|
-
"spec/fixtures/godfather.srt",
|
56
|
-
"spec/fixtures/huge.ass",
|
57
|
-
"spec/fixtures/movie.xml",
|
58
|
-
"spec/fixtures/movie.yml",
|
59
|
-
"spec/fixtures/pseudo.rsb",
|
60
|
-
"spec/fixtures/pulpfiction.sub",
|
61
|
-
"spec/fixtures/puplfiction.mpl",
|
62
|
-
"spec/fixtures/sincity.yml",
|
63
|
-
"spec/spec_helper.rb",
|
64
|
-
"spec/subtitle_it/bin_spec.rb",
|
65
|
-
"spec/subtitle_it/fixes_spec.rb",
|
66
|
-
"spec/subtitle_it/formats/ass_spec.rb",
|
67
|
-
"spec/subtitle_it/formats/mpl_spec.rb",
|
68
|
-
"spec/subtitle_it/formats/rsb_spec.rb",
|
69
|
-
"spec/subtitle_it/formats/srt_spec.rb",
|
70
|
-
"spec/subtitle_it/formats/sub_spec.rb",
|
71
|
-
"spec/subtitle_it/formats/xml_spec.rb",
|
72
|
-
"spec/subtitle_it/formats/yml_spec.rb",
|
73
|
-
"spec/subtitle_it/generator_spec.rb",
|
74
|
-
"spec/subtitle_it/movie_hasher_spec.rb",
|
75
|
-
"spec/subtitle_it/movie_spec.rb",
|
76
|
-
"spec/subtitle_it/subdown_spec.rb",
|
77
|
-
"spec/subtitle_it/subline_spec.rb",
|
78
|
-
"spec/subtitle_it/substyle_spec.rb",
|
79
|
-
"spec/subtitle_it/subtime_spec.rb",
|
80
|
-
"spec/subtitle_it/subtitle_spec.rb",
|
81
|
-
"spec/subtitle_it_spec.rb",
|
82
|
-
"subtitle_it.gemspec",
|
83
|
-
"tasks/deployment.rake",
|
84
|
-
"tasks/environment.rake",
|
85
|
-
"tasks/rspec.rake"
|
86
|
-
]
|
87
|
-
s.homepage = %q{http://github.com/nofxx/subtitle_it}
|
88
|
-
s.require_paths = ["lib"]
|
89
|
-
s.rubygems_version = %q{1.3.7}
|
90
|
-
s.summary = %q{Download, edit and create subtitles.}
|
10
|
+
s.email = 'x@nofxx.com'
|
91
11
|
|
92
|
-
|
93
|
-
|
94
|
-
s.specification_version = 3
|
12
|
+
s.date = Time.now.strftime("%Y-%m-%d")
|
13
|
+
s.default_executable = 'subtitle_it'
|
95
14
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
end
|
15
|
+
s.homepage = 'http://github.com/nofxx/subtitle_it'
|
16
|
+
s.description = 'Download, edit and create subtitles. Supports various formats.'
|
17
|
+
s.summary = 'Download, edit and create subtitles.'
|
18
|
+
s.license = 'MIT'
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
|
+
s.require_paths = ['lib']
|
105
23
|
|
24
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
25
|
+
# s.extra_rdoc_files = s.files.grep(%r{^(rdoc)/})
|
26
|
+
|
27
|
+
s.add_dependency 'colorize'
|
28
|
+
s.add_dependency 'nokogiri'
|
29
|
+
s.add_development_dependency 'rake', '~> 10.0'
|
30
|
+
s.add_development_dependency 'rspec', '~> 3.0'
|
31
|
+
s.add_development_dependency 'rspec-mocks', '~> 3.0'
|
32
|
+
end
|