srtshifter 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/srtshifter/options.rb +1 -1
- data/lib/srtshifter/subtitle.rb +1 -1
- data/lib/srtshifter/version.rb +1 -1
- data/test/lib/srtshifter/options_test.rb +3 -2
- data/test/samples/non-utf8.srt +99 -0
- metadata +3 -1
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# SRT Shifter
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/thiagokimo/srt-shifter.png)](https://travis-ci.org/thiagokimo/srt-shifter)
|
4
|
+
[![Gem Version](https://fury-badge.herokuapp.com/rb/srtshifter.png)](http://badge.fury.io/rb/srtshifter)
|
5
|
+
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/thiagokimo/srt-shifter)
|
4
6
|
|
5
7
|
How many times you downloaded a movie that you couldn't find a perfect synchronized subtitle to watch it?
|
6
8
|
|
data/lib/srtshifter/options.rb
CHANGED
@@ -22,7 +22,7 @@ module SrtShifter
|
|
22
22
|
opts.separator "Common Options:"
|
23
23
|
|
24
24
|
opts.on("-o","--operation (ADD|SUB)", String, "Type ADD to increase time or SUB to decrease time.") do |o|
|
25
|
-
@options[:operation] = o
|
25
|
+
@options[:operation] = o.upcase
|
26
26
|
end
|
27
27
|
|
28
28
|
opts.on("-t","--time (VALUE)", Float, "Time in milliseconds.") do |n|
|
data/lib/srtshifter/subtitle.rb
CHANGED
data/lib/srtshifter/version.rb
CHANGED
@@ -7,7 +7,7 @@ describe SrtShifter do
|
|
7
7
|
describe "validate_args" do
|
8
8
|
|
9
9
|
before(:each) do
|
10
|
-
@args = {:operation => "
|
10
|
+
@args = {:operation => "ADD", :time => 10.0, :input => "test/samples/test_srt.srt", :output => "test_output.srt"}
|
11
11
|
end
|
12
12
|
|
13
13
|
after(:each) do
|
@@ -34,8 +34,9 @@ describe SrtShifter do
|
|
34
34
|
it "must accept lowercase existing operations" do
|
35
35
|
|
36
36
|
opts = SrtShifter::Options.new "test/samples/test_srt.srt test_output.srt"
|
37
|
-
@args[:operation] = "add"
|
38
37
|
opts.options = @args
|
38
|
+
opts.options[:operation] = "sub"
|
39
|
+
|
39
40
|
|
40
41
|
lambda { opts.validate_args }.must_be_silent
|
41
42
|
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
1
|
2
|
+
00:00:01,491 --> 00:00:03,827
|
3
|
+
уууОуЇуЎ "уЙуууЗуЅ" уЇуЏтІ
|
4
|
+
|
5
|
+
2
|
6
|
+
00:00:03,828 --> 00:00:04,995
|
7
|
+
ууу ууЊуЊуГ
|
8
|
+
|
9
|
+
3
|
10
|
+
00:00:04,996 --> 00:00:06,663
|
11
|
+
шЏуууЅуМуИуЋуЋухКцЅу
|
12
|
+
|
13
|
+
4
|
14
|
+
00:00:06,664 --> 00:00:08,048
|
15
|
+
"уЂуГууМ уЄуГ ууЅуМуИуЋуЋ" у?
|
16
|
+
|
17
|
+
5
|
18
|
+
00:00:08,049 --> 00:00:09,205
|
19
|
+
уЁууЃуЈхО
уІ
|
20
|
+
|
21
|
+
6
|
22
|
+
00:00:09,208 --> 00:00:11,418
|
23
|
+
щЄхчИчЕуЎцчЖууууІуцфИу
|
24
|
+
|
25
|
+
7
|
26
|
+
00:00:11,919 --> 00:00:14,379
|
27
|
+
уЊуМууЃуЗуЇуГхуЎчЈНхЄуууІуІ
|
28
|
+
|
29
|
+
8
|
30
|
+
00:00:14,380 --> 00:00:16,440
|
31
|
+
хуЎх
ЈуІушІуЊуууА
|
32
|
+
|
33
|
+
9
|
34
|
+
00:00:16,841 --> 00:00:19,573
|
35
|
+
шГчЃуЏчДуЁуЋчЎЁшВЁфККуЋ
|
36
|
+
|
37
|
+
10
|
38
|
+
00:00:19,574 --> 00:00:21,386
|
39
|
+
цГхЛЗуЇфМууОуууу
|
40
|
+
|
41
|
+
11
|
42
|
+
00:00:21,787 --> 00:00:23,930
|
43
|
+
цЌЁуЏуЂуЄууМ уЊуГуу
|
44
|
+
|
45
|
+
12
|
46
|
+
00:00:23,931 --> 00:00:25,265
|
47
|
+
ууЌуЏ уІуЃуЊуЙуфНПуу
|
48
|
+
|
49
|
+
13
|
50
|
+
00:00:25,266 --> 00:00:27,408
|
51
|
+
хНМуЏфККуЈууІуЏцфНу
|
52
|
+
|
53
|
+
14
|
54
|
+
00:00:27,625 --> 00:00:28,894
|
55
|
+
ууЊуЊуГуЎхНЙу
|
56
|
+
|
57
|
+
15
|
58
|
+
00:00:28,895 --> 00:00:31,787
|
59
|
+
"цЅуІцЌВуу" уЃуІ
|
60
|
+
|
61
|
+
16
|
62
|
+
00:00:32,188 --> 00:00:34,388
|
63
|
+
"уГуМуЋуууЏ"
|
64
|
+
|
65
|
+
17
|
66
|
+
00:00:35,441 --> 00:00:38,907
|
67
|
+
"чЇушВДцЙшВуЋцууІ"
|
68
|
+
|
69
|
+
18
|
70
|
+
00:00:38,908 --> 00:00:42,310
|
71
|
+
"шВДцЙуЎуЏуЋууЎшВуЋ"
|
72
|
+
|
73
|
+
19
|
74
|
+
00:00:42,311 --> 00:00:45,647
|
75
|
+
"чЇушВДцЙшВуЋцууІ"
|
76
|
+
|
77
|
+
20
|
78
|
+
00:00:45,648 --> 00:00:49,117
|
79
|
+
"шВДцЙуууЃуЈшІуІу"
|
80
|
+
|
81
|
+
21
|
82
|
+
00:00:49,118 --> 00:00:52,654
|
83
|
+
"хЅНууЊшВуЋчЇуцууІ"
|
84
|
+
|
85
|
+
22
|
86
|
+
00:00:52,655 --> 00:00:55,723
|
87
|
+
"шВДцЙуууЃуЈшІуІууу"
|
88
|
+
|
89
|
+
23
|
90
|
+
00:00:55,724 --> 00:00:58,593
|
91
|
+
"у уущЛшЉБущ цД"
|
92
|
+
|
93
|
+
24
|
94
|
+
00:00:58,594 --> 00:01:02,329
|
95
|
+
"фНцуЇушЏууу"
|
96
|
+
|
97
|
+
25
|
98
|
+
00:01:02,330 --> 00:01:03,782
|
99
|
+
"у уучЇушЊуЃуІ"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: srtshifter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- test/lib/srtshifter/options_test.rb
|
51
51
|
- test/lib/srtshifter/subtitle_test.rb
|
52
52
|
- test/lib/srtshifter/version_test.rb
|
53
|
+
- test/samples/non-utf8.srt
|
53
54
|
- test/samples/test_srt.srt
|
54
55
|
- test/test_helper.rb
|
55
56
|
homepage: http://thiagokimo.github.com/srt-shifter
|
@@ -81,5 +82,6 @@ test_files:
|
|
81
82
|
- test/lib/srtshifter/options_test.rb
|
82
83
|
- test/lib/srtshifter/subtitle_test.rb
|
83
84
|
- test/lib/srtshifter/version_test.rb
|
85
|
+
- test/samples/non-utf8.srt
|
84
86
|
- test/samples/test_srt.srt
|
85
87
|
- test/test_helper.rb
|