subtitle_it 1.9.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/Gemfile +3 -0
  4. data/{README.rdoc → README.md} +22 -18
  5. data/Rakefile +13 -18
  6. data/bin/subtitle_it +4 -8
  7. data/lib/subtitle_it/bin.rb +50 -58
  8. data/lib/subtitle_it/fixes.rb +3 -4
  9. data/lib/subtitle_it/formats/ass.rb +5 -6
  10. data/lib/subtitle_it/formats/mpl.rb +9 -9
  11. data/lib/subtitle_it/formats/rsb.rb +9 -9
  12. data/lib/subtitle_it/formats/srt.rb +17 -14
  13. data/lib/subtitle_it/formats/sub.rb +7 -7
  14. data/lib/subtitle_it/formats/xml.rb +13 -12
  15. data/lib/subtitle_it/formats/yml.rb +5 -5
  16. data/lib/subtitle_it/generator.rb +2 -2
  17. data/lib/subtitle_it/languages.rb +52 -53
  18. data/lib/subtitle_it/movie.rb +26 -6
  19. data/lib/subtitle_it/platform_endl.rb +7 -5
  20. data/lib/subtitle_it/subdown.rb +30 -33
  21. data/lib/subtitle_it/subline.rb +5 -5
  22. data/lib/subtitle_it/substyle.rb +3 -9
  23. data/lib/subtitle_it/subtime.rb +19 -10
  24. data/lib/subtitle_it/subtitle.rb +20 -28
  25. data/lib/subtitle_it/version.rb +1 -7
  26. data/lib/subtitle_it.rb +7 -7
  27. data/spec/fixtures/movie.xml +2 -2
  28. data/spec/spec_helper.rb +6 -6
  29. data/spec/subtitle_it/bin_spec.rb +110 -98
  30. data/spec/subtitle_it/formats/ass_spec.rb +2 -3
  31. data/spec/subtitle_it/formats/mpl_spec.rb +26 -28
  32. data/spec/subtitle_it/formats/rsb_spec.rb +29 -30
  33. data/spec/subtitle_it/formats/srt_spec.rb +27 -30
  34. data/spec/subtitle_it/formats/sub_spec.rb +19 -21
  35. data/spec/subtitle_it/formats/xml_spec.rb +21 -21
  36. data/spec/subtitle_it/formats/yml_spec.rb +14 -15
  37. data/spec/subtitle_it/movie_spec.rb +24 -15
  38. data/spec/subtitle_it/subdown_spec.rb +58 -65
  39. data/spec/subtitle_it/subline_spec.rb +17 -18
  40. data/spec/subtitle_it/subtime_spec.rb +43 -44
  41. data/spec/subtitle_it/subtitle_spec.rb +28 -29
  42. data/spec/subtitle_it_spec.rb +4 -5
  43. data/subtitle_it.gemspec +25 -98
  44. metadata +121 -67
  45. data/.rspec +0 -2
  46. data/config/hoe.rb +0 -73
  47. data/config/requirements.rb +0 -15
  48. data/lib/subtitle_it/movie_hasher.rb +0 -30
  49. data/script/console +0 -10
  50. data/script/destroy +0 -14
  51. data/script/generate +0 -14
  52. data/script/txt2html +0 -82
  53. data/spec/subtitle_it/movie_hasher_spec.rb +0 -13
  54. data/tasks/deployment.rake +0 -34
  55. data/tasks/environment.rake +0 -7
  56. 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, ".yml" do
4
- describe "Out" do
3
+ describe Formats, '.yml' do
4
+ describe 'Out' do
5
5
  include SubFixtures
6
-
7
- before(:each) do
8
- @sub = Subtitle.new({:dump => yml_fixture, :format => 'yml'})
9
- end
10
-
11
- it "should have author" do
12
- @sub.to_yml.should match(/author: warlley, nofxx/)
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 "should have version" do
16
- @sub.to_yml.should match(/version: 1.1/)
14
+
15
+ it 'should have version' do
16
+ expect(@sub.to_yml).to match(/version: 1.1/)
17
17
  end
18
-
19
- end
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 "should initialize nicely" do
9
- @movie.info.should be_instance_of(Hash)
10
- @movie.filename.should eql("pulpfiction")
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 "should call for a hash" do
14
- File.should_receive(:open).with("pulpfiction", "rb")
15
- File.should_receive(:size).with('pulpfiction').and_return(13141)
16
- #TODO.. how to mock this?
17
- #MovieHasher.should_receive(:compute_hash)
18
- @movie.haxx.should eql('0000000000003355')
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 "should call for size" do
22
- File.should_receive(:size).with('pulpfiction')
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 ||= mock(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>
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 = mock(Movie, :haxx => '09a2c497663259cb', :size => 81401)
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 = mock(Subtitle)
17
+ @sub = double(Subtitle)
18
18
  end
19
19
 
20
- it "should initialize nicely" do
21
- XMLRPC::Client.should_receive(:new2)
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 "should log in!" do
26
- XMLRPC::Client.should_receive(:new2).with('http://api.opensubtitles.org/xml-rpc').and_return(mock_xmlrpc)
27
- @mock_xmlrpc.should_receive(:call).with("LogIn", "", "", "", "SubtitleIt #{SubtitleIt::VERSION::STRING}").and_return({
28
- "status"=>"200 OK",
29
- "seconds"=>0.004,
30
- "token"=>"shkuj98gcvu5gp1b5tlo8uq525"
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.should_not be_logged_in
36
+ expect(@down).not_to be_logged_in
34
37
  @down.log_in!
35
- @down.should be_logged_in
38
+ expect(@down).to be_logged_in
36
39
  end
37
40
 
38
- it "should raise if connection sux" do
39
- XMLRPC::Client.should_receive(:new2).with('http://api.opensubtitles.org/xml-rpc').and_return(mock_xmlrpc)
40
- @mock_xmlrpc.should_receive(:call).with("LogIn", "", "", "", "SubtitleIt #{SubtitleIt::VERSION::STRING}").and_return({
41
- "status"=>"404 FAIL",
42
- "seconds"=>0.004,
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
- lambda { @down.log_in! }.should raise_error
47
- @down.should_not be_logged_in
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.should_receive(:new2).
54
- with('http://api.opensubtitles.org/xml-rpc').
55
- and_return(mock_xmlrpc)
56
-
57
- @mock_xmlrpc.should_receive(:call).with("LogIn", "", "", "",
58
- "SubtitleIt #{SubtitleIt::VERSION::STRING}").and_return({
59
- "status"=>"200 OK",
60
- "seconds"=>0.004,
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 "should search for all languages" do
68
- @mock_xmlrpc.should_receive(:call).with("SearchSubtitles",
69
- "shkuj98gcvu5gp1b5tlo8uq525", [{
70
- "sublanguageid"=>nil,
71
- "moviebytesize"=>81401,
72
- "moviehash"=>"09a2c497663259cb"}]).and_return(
73
- { :result => 200 }
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.should_receive(:print).with("Searching for ")
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 "should search for one language" do
82
- @mock_xmlrpc.should_receive(:call).with("SearchSubtitles",
83
- "shkuj98gcvu5gp1b5tlo8uq525", [{
84
- "sublanguageid"=>"Portuguese",
85
- "moviebytesize"=>81401,
86
- "moviehash"=>"09a2c497663259cb"}]).and_return(
87
- { :result => 200 }
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.should_receive(:print).with("Searching for ")
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',"Astalavista, baby...")
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.should eql("Astalavista, baby...")
9
+ expect(@sub.text).to eql('Astalavista, baby...')
10
10
  end
11
-
12
- it "should have a nice date on" do
13
- @sub.time_on.sec.should eql(2)
14
- @sub.time_on.min.should eql(20)
15
- @sub.time_on.sec.should eql(2)
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 "should have the seconds added from the first time" do
19
- @sub.time_off.sec.should eql(6)
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, ".failures" do
24
-
25
- it "should correct a timeline beforehe on time" do
26
- lambda do
27
- Subline.new('00:03:01','00:02:03',"Astalavista, baby...")
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 "should convert the hour, minutes and seconds" do
9
- @subtime.hrs.should eql(1)
10
- @subtime.min.should eql(2)
11
- @subtime.sec.should eql(3)
12
- @subtime.ms.should eql(400)
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 "should reduce the deciseconds" do
16
- 800.reduce.should eql(8)
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 "should become a integer" do
24
- @subtime.to_i.should eql(3723400)
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 "and the other way around" do
29
- it "should print nicely" do
30
- @subtime = Subtime.new(3723400)
31
- @subtime.to_s.should eql('01:02:03.400')
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,"Stress Test (heh)" do
36
- it "should convert a big time" do
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.should eql(11)
39
- @subtime.min.should eql(22)
40
- @subtime.sec.should eql(33)
41
- @subtime.ms.should eql(742)
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 "should print nicely" do
45
- @subtime = Subtime.new('11:22:33.7')
46
- @subtime.to_s.should eql("11:22:33.700")
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 ".other formats" do
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 "should parse min:sec,ms" do
54
+ it 'should parse min:sec,ms' do
56
55
  @subtime = Subtime.new('01:03,3')
57
56
  end
58
-
59
- it "should single as seconds hour should be nil" do
57
+
58
+ it 'should single as seconds hour should be nil' do
60
59
  @subtime = Subtime.new('3')
61
- @subtime.hrs.should eql(0)
60
+ expect(@subtime.hrs).to eql(0)
62
61
  end
63
-
64
- it "should parse min:sec" do
62
+
63
+ it 'should parse min:sec' do
65
64
  @subtime = Subtime.new('01:03')
66
- @subtime.min.should eql(1)
65
+ expect(@subtime.min).to eql(1)
67
66
  end
68
-
67
+
69
68
  after(:each) do
70
- @subtime.sec.should eql(3)
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
- { :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
- }}
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 "should instantiate" do
18
+
19
+ it 'should instantiate' do
20
20
  @sub = Subtitle.new(attr_valid_subtitle)
21
- @sub.rating.should eql(9.5)
21
+ expect(@sub.rating).to eql(9.5)
22
22
  end
23
-
24
- it "should fill lines" do
25
- @sub = Subtitle.new(attr_valid_subtitle.with({:dump => "{10}{20} Hello", :format => "sub"}))
26
- @sub.lines[0].text.should eql(' Hello')
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 "should compare to another using rating" do
36
- @another_sub = Subtitle.new(attr_valid_subtitle.with(:info => { "SubRating" => 4.0} ))
37
- (@sub > @another_sub).should be_true
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
@@ -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
- it "should instantiate " do
8
- @sub = Subtitle.new({:dump => "{12}{30}hey hey heypending", :format => "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
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
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 = %q{subtitle_it}
8
- s.version = "1.9.0"
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.date = %q{2011-05-30}
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
- if s.respond_to? :specification_version then
93
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
94
- s.specification_version = 3
12
+ s.date = Time.now.strftime("%Y-%m-%d")
13
+ s.default_executable = 'subtitle_it'
95
14
 
96
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
97
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
98
- else
99
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
100
- end
101
- else
102
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
103
- end
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