subtitle_converter 0.0.3

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.
@@ -0,0 +1,180 @@
1
+ 1
2
+ 00:00:04,825 --> 00:00:09,528
3
+ 我有困难,我不能持续稳定使用误差数据库
4
+
5
+ 2
6
+ 00:00:09,561 --> 00:00:10,825
7
+ 哦,那不是什么障碍
8
+
9
+ 3
10
+ 00:00:10,858 --> 00:00:17,792
11
+ 在今天的回顾会上我希望你们下个Sprint中从事我提供的十个改进工作
12
+
13
+ 4
14
+ 00:00:17,825 --> 00:00:23,792
15
+ 卡拉,我希望你们开展更多项的工作,你们做得还不错但是你们可以做得比这个要多
16
+
17
+ 5
18
+ 00:00:23,825 --> 00:00:23,891
19
+
20
+
21
+ 6
22
+ 00:00:23,924 --> 00:00:26,000
23
+ 好的,谢谢
24
+
25
+ 7
26
+ 00:00:26,033 --> 00:00:29,594
27
+ 太棒了!这是我们最快的一次站立会,只有40分钟
28
+
29
+ 8
30
+ 00:00:29,627 --> 00:00:30,066
31
+ 是啊
32
+
33
+ 9
34
+ 00:00:30,099 --> 00:00:30,957
35
+ 关键不是……
36
+
37
+ 10
38
+ 00:00:31,825 --> 00:00:36,198
39
+ 我刚读完这本书,上面说Scrum会让工作加速,为什么你们还是那么慢?
40
+
41
+ 11
42
+ 00:00:36,231 --> 00:00:38,264
43
+ 继续工作……
44
+
45
+ 12
46
+ 00:00:38,297 --> 00:00:40,924
47
+ 这个用户故事用13个点不太可能,这更像是两个点的工作
48
+
49
+ 13
50
+ 00:00:40,957 --> 00:00:45,660
51
+ 好,我们就以5分钟的默写来开始回顾会议
52
+
53
+ 14
54
+ 00:00:49,891 --> 00:00:50,693
55
+ 默写,不要出声
56
+
57
+ 15
58
+ 00:00:50,825 --> 00:00:51,825
59
+ 那个并不是障碍
60
+
61
+ 16
62
+ 00:00:51,858 --> 00:00:55,726
63
+ 作为你们的ScrumMaster和产品负责人,这些是我希望你们在这个Sprint中承诺的用户故事
64
+
65
+ 17
66
+ 00:00:59,066 --> 00:01:03,231
67
+ 我的电脑昨晚被偷了,在得到新电脑前我没法工作
68
+
69
+ 18
70
+ 00:01:03,264 --> 00:01:04,726
71
+ 你知道可以用纸吗?
72
+
73
+ 19
74
+ 00:01:04,759 --> 00:01:08,495
75
+ 亚当,今天下午我要这个特征的演示,你可以做完吧?
76
+
77
+ 20
78
+ 00:01:08,528 --> 00:01:09,528
79
+ 好,没问题
80
+
81
+ 21
82
+ 00:01:09,528 --> 00:01:09,660
83
+ 很好
84
+
85
+ 22
86
+ 00:01:09,693 --> 00:01:10,594
87
+ 我把这个加入到你们的在进行工作中
88
+
89
+ 23
90
+ 00:01:10,627 --> 00:01:14,825
91
+ 持续集成就没发挥过作用,我们就省了吧
92
+
93
+ 24
94
+ 00:01:14,858 --> 00:01:19,792
95
+ 哦不是这样克里斯,我们现在用Scrum,所以就不用向管理层汇报这种事情
96
+
97
+ 25
98
+ 00:01:19,825 --> 00:01:25,132
99
+ 三个月时间,管理层以为我们下个Sprint就可以完成工作,我不明白……
100
+
101
+ 26
102
+ 00:01:25,165 --> 00:01:32,396
103
+ 大伙注意了,我们的CEO来参加今天的回顾会议,会议照常进行……
104
+
105
+ 27
106
+ 00:01:32,429 --> 00:01:36,891
107
+ 你们的工作太不理想了,所以我决定把这个Sprint减掉几天
108
+
109
+ 28
110
+ 00:01:36,924 --> 00:01:38,726
111
+ 你要去哪儿?
112
+
113
+ 29
114
+ 00:01:38,759 --> 00:01:39,924
115
+ 上厕所
116
+
117
+ 30
118
+ 00:01:39,957 --> 00:01:41,792
119
+ 你有那些任务吗?
120
+
121
+ 31
122
+ 00:01:41,825 --> 00:01:42,099
123
+ 没有
124
+
125
+ 32
126
+ 00:01:43,495 --> 00:01:47,363
127
+ 这个Sprint你们让公司失望了
128
+
129
+ 33
130
+ 00:01:47,396 --> 00:01:53,099
131
+ 我只是想这个Sprint你们有好多的工作,那我们就把两周的Sprint改成三周吧,就这么办吧
132
+
133
+ 34
134
+ 00:01:53,099 --> 00:01:53,165
135
+ 好吧
136
+
137
+ 35
138
+ 00:01:57,000 --> 00:01:57,726
139
+ 不同意还是承诺?
140
+
141
+ 36
142
+ 00:01:57,759 --> 00:01:58,660
143
+ 那不是障碍
144
+
145
+ 37
146
+ 00:01:58,693 --> 00:02:00,660
147
+ 我们可以把这个用户故事当作完成了?
148
+
149
+ 38
150
+ 00:02:04,000 --> 00:02:05,264
151
+ 够好了,那我们就完成了
152
+
153
+ 39
154
+ 00:02:05,297 --> 00:02:10,495
155
+ 这个Sprint大家表现都不错,但是另一个团队的速率要稍稍比我们的高,你们可不可以提高一点点?
156
+
157
+ 40
158
+ 00:02:10,528 --> 00:02:11,759
159
+ 5分钟默写
160
+
161
+ 41
162
+ 00:02:18,891 --> 00:02:28,825
163
+ 好,没事儿,我只是在开回顾会议,有谷歌工作机会?好的
164
+
165
+ 42
166
+ 00:02:28,858 --> 00:02:35,924
167
+ 我明天不在,你们可以通过邮件随便找个时间开每日例会,就发发邮件
168
+
169
+ 43
170
+ 00:02:36,000 --> 00:02:37,429
171
+ 那不是障碍
172
+
173
+ 44
174
+ 00:02:37,462 --> 00:02:42,726
175
+ 很好,但是另一个团队的速率比你们的要好很多,今天你们是不是要加班?
176
+
177
+ 45
178
+ 00:02:49,495 --> 00:02:55,330
179
+ 来看看,猫儿们在吃芝士汉堡,很不健康
180
+
@@ -0,0 +1,64 @@
1
+ $FontName = Simsun
2
+ $FontSize = 30
3
+ $HorzAlign = Center // Left or Right
4
+ $VertAlign = Bottom // Top or Center
5
+ $Bold = TRUE
6
+ $UnderLined = FALSE
7
+ $Italic = FALSE
8
+ $XOffset = 0 // Pixel offset (can be negative)
9
+ $YOffset = 0 // Pixel offset (can be negative)
10
+ $TextContrast = 10
11
+ $Outline1Contrast = 15
12
+ $Outline2Contrast = 7
13
+ $BackgroundContrast = 0
14
+ $ForceDisplay = TRUE // DVD Force Display Flag
15
+ $FadeIn = 0 // In number of Frames
16
+ $Fadeout = 0 // In number of Frames
17
+
18
+ $TapeOffset = TRUE
19
+
20
+ 00:00:04:25 , 00:00:09:16 , 我有困难,我不能持续稳定使用误差数据库
21
+ 00:00:09:17 , 00:00:10:25 , 哦,那不是什么障碍
22
+ 00:00:10:26 , 00:00:17:24 , 在今天的回顾会上我希望你们下个Sprint中从事我提供的十个改进工作
23
+ 00:00:17:25 , 00:00:23:24 , 卡拉,我希望你们开展更多项的工作,你们做得还不错但是你们可以做得比这个要多
24
+ 00:00:23:25 , 00:00:23:27 , 好
25
+ 00:00:23:28 , 00:00:26:00 , 好的,谢谢
26
+ 00:00:26:01 , 00:00:29:18 , 太棒了!这是我们最快的一次站立会,只有40分钟
27
+ 00:00:29:19 , 00:00:30:02 , 是啊
28
+ 00:00:30:03 , 00:00:30:29 , 关键不是……
29
+ 00:00:31:25 , 00:00:36:06 , 我刚读完这本书,上面说Scrum会让工作加速,为什么你们还是那么慢?
30
+ 00:00:36:07 , 00:00:38:08 , 继续工作……
31
+ 00:00:38:09 , 00:00:40:28 , 这个用户故事用13个点不太可能,这更像是两个点的工作
32
+ 00:00:40:29 , 00:00:45:20 , 好,我们就以5分钟的默写来开始回顾会议
33
+ 00:00:49:27 , 00:00:50:21 , 默写,不要出声
34
+ 00:00:50:25 , 00:00:51:25 , 那个并不是障碍
35
+ 00:00:51:26 , 00:00:55:22 , 作为你们的ScrumMaster和产品负责人,这些是我希望你们在这个Sprint中承诺的用户故事
36
+ 00:00:59:02 , 00:01:03:07 , 我的电脑昨晚被偷了,在得到新电脑前我没法工作
37
+ 00:01:03:08 , 00:01:04:22 , 你知道可以用纸吗?
38
+ 00:01:04:23 , 00:01:08:15 , 亚当,今天下午我要这个特征的演示,你可以做完吧?
39
+ 00:01:08:16 , 00:01:09:16 , 好,没问题
40
+ 00:01:09:16 , 00:01:09:20 , 很好
41
+ 00:01:09:21 , 00:01:10:18 , 我把这个加入到你们的在进行工作中
42
+ 00:01:10:19 , 00:01:14:25 , 持续集成就没发挥过作用,我们就省了吧
43
+ 00:01:14:26 , 00:01:19:24 , 哦不是这样克里斯,我们现在用Scrum,所以就不用向管理层汇报这种事情
44
+ 00:01:19:25 , 00:01:25:04 , 三个月时间,管理层以为我们下个Sprint就可以完成工作,我不明白……
45
+ 00:01:25:05 , 00:01:32:12 , 大伙注意了,我们的CEO来参加今天的回顾会议,会议照常进行……
46
+ 00:01:32:13 , 00:01:36:27 , 你们的工作太不理想了,所以我决定把这个Sprint减掉几天
47
+ 00:01:36:28 , 00:01:38:22 , 你要去哪儿?
48
+ 00:01:38:23 , 00:01:39:28 , 上厕所
49
+ 00:01:39:29 , 00:01:41:24 , 你有那些任务吗?
50
+ 00:01:41:25 , 00:01:42:03 , 没有
51
+ 00:01:43:15 , 00:01:47:11 , 这个Sprint你们让公司失望了
52
+ 00:01:47:12 , 00:01:53:03 , 我只是想这个Sprint你们有好多的工作,那我们就把两周的Sprint改成三周吧,就这么办吧
53
+ 00:01:53:03 , 00:01:53:05 , 好吧
54
+ 00:01:57:00 , 00:01:57:22 , 不同意还是承诺?
55
+ 00:01:57:23 , 00:01:58:20 , 那不是障碍
56
+ 00:01:58:21 , 00:02:00:20 , 我们可以把这个用户故事当作完成了?
57
+ 00:02:04:00 , 00:02:05:08 , 够好了,那我们就完成了
58
+ 00:02:05:09 , 00:02:10:15 , 这个Sprint大家表现都不错,但是另一个团队的速率要稍稍比我们的高,你们可不可以提高一点点?
59
+ 00:02:10:16 , 00:02:11:23 , 5分钟默写
60
+ 00:02:18:27 , 00:02:28:25 , 好,没事儿,我只是在开回顾会议,有谷歌工作机会?好的
61
+ 00:02:28:26 , 00:02:35:28 , 我明天不在,你们可以通过邮件随便找个时间开每日例会,就发发邮件
62
+ 00:02:36:00 , 00:02:37:13 , 那不是障碍
63
+ 00:02:37:14 , 00:02:42:22 , 很好,但是另一个团队的速率比你们的要好很多,今天你们是不是要加班?
64
+ 00:02:49:15 , 00:02:55:10 , 来看看,猫儿们在吃芝士汉堡,很不健康
@@ -0,0 +1,180 @@
1
+ 1
2
+ 00:00:04,825 --> 00:00:09,528
3
+ I have a problem, I can't get access to the error database at a consistent rate
4
+
5
+ 2
6
+ 00:00:09,561 --> 00:00:10,825
7
+ Oh, that is not an impediment
8
+
9
+ 3
10
+ 00:00:10,858 --> 00:00:17,792
11
+ In this retrospective today, I've got list of 10 improvements I'd like you guys to address for the next sprints
12
+
13
+ 4
14
+ 00:00:17,825 --> 00:00:23,792
15
+ Hey Khara, I'm gonna need you guys to get more work in progress, it's pretty good but you gonna need more stuff than that
16
+
17
+ 5
18
+ 00:00:23,825 --> 00:00:23,891
19
+ Ok
20
+
21
+ 6
22
+ 00:00:23,924 --> 00:00:26,000
23
+ Cool, thanks!
24
+
25
+ 7
26
+ 00:00:26,033 --> 00:00:29,594
27
+ Awesome, guys! That's our fastest standing up yet, it was only 40 minutes
28
+
29
+ 8
30
+ 00:00:29,627 --> 00:00:30,066
31
+ Yeah
32
+
33
+ 9
34
+ 00:00:30,099 --> 00:00:30,957
35
+ The point is not getting...
36
+
37
+ 10
38
+ 00:00:31,825 --> 00:00:36,198
39
+ I was just reading this and it says Scrum is all that going faster, what's taking you so long?
40
+
41
+ 11
42
+ 00:00:36,231 --> 00:00:38,264
43
+ Get back to work...
44
+
45
+ 12
46
+ 00:00:38,297 --> 00:00:40,924
47
+ There is no way this story is a 13, this is more like a 2.
48
+
49
+ 13
50
+ 00:00:40,957 --> 00:00:45,660
51
+ Alright, so we'll kick off this retrospective with 5 minutes silent writing
52
+
53
+ 14
54
+ 00:00:49,891 --> 00:00:50,693
55
+ Silent writing
56
+
57
+ 15
58
+ 00:00:50,825 --> 00:00:51,825
59
+ That's not an impediment
60
+
61
+ 16
62
+ 00:00:51,858 --> 00:00:55,726
63
+ As your ScrumMaster and product owner, these are the stories I need you to commit this sprint
64
+
65
+ 17
66
+ 00:00:59,066 --> 00:01:03,231
67
+ My computer was stolen during a break in last night, I can't get any work done until I get a new one
68
+
69
+ 18
70
+ 00:01:03,264 --> 00:01:04,726
71
+ Have you heard of paper?
72
+
73
+ 19
74
+ 00:01:04,759 --> 00:01:08,495
75
+ Adam, I'm gonna need this feature demo this afternoon, you can get it done right?
76
+
77
+ 20
78
+ 00:01:08,528 --> 00:01:09,528
79
+ Yeah, no problem
80
+
81
+ 21
82
+ 00:01:09,528 --> 00:01:09,660
83
+ Great
84
+
85
+ 22
86
+ 00:01:09,693 --> 00:01:10,594
87
+ I'm just gonna add this to your work in progress
88
+
89
+ 23
90
+ 00:01:10,627 --> 00:01:14,825
91
+ Continuous integrations never helps anybody,let's skip that
92
+
93
+ 24
94
+ 00:01:14,858 --> 00:01:19,792
95
+ Oh no Chris, listen, we're doing Scrum now, so we don't have to share that sort of stuff to the management
96
+
97
+ 25
98
+ 00:01:19,825 --> 00:01:25,132
99
+ 3 months and management think we can get it done in another sprint, and I just don't understand...
100
+
101
+ 26
102
+ 00:01:25,165 --> 00:01:32,396
103
+ Hey guys, surprise! our CEO is joining us for today's retrospective, but just do everything normally...
104
+
105
+ 27
106
+ 00:01:32,429 --> 00:01:36,891
107
+ Hey guys, you are totally failing, so I am gonna cut this sprint a couple of days short
108
+
109
+ 28
110
+ 00:01:36,924 --> 00:01:38,726
111
+ Where are you going?
112
+
113
+ 29
114
+ 00:01:38,759 --> 00:01:39,924
115
+ Bio?
116
+
117
+ 30
118
+ 00:01:39,957 --> 00:01:41,792
119
+ Do you have a task for that?
120
+
121
+ 31
122
+ 00:01:41,825 --> 00:01:42,099
123
+ No
124
+
125
+ 32
126
+ 00:01:43,495 --> 00:01:47,363
127
+ Alright guys, you guys are letting our company down this sprint
128
+
129
+ 33
130
+ 00:01:47,396 --> 00:01:53,099
131
+ I was just thinking you guys have a lot to do this sprint so let's make this sprint 3 weeks instead of 2, let's just change that
132
+
133
+ 34
134
+ 00:01:53,099 --> 00:01:53,165
135
+ Cool
136
+
137
+ 35
138
+ 00:01:57,000 --> 00:01:57,726
139
+ Disagree or commit?
140
+
141
+ 36
142
+ 00:01:57,759 --> 00:01:58,660
143
+ That's not an impediment
144
+
145
+ 37
146
+ 00:01:58,693 --> 00:02:00,660
147
+ So we call this story done?
148
+
149
+ 38
150
+ 00:02:04,000 --> 00:02:05,264
151
+ That's close enough, you guys have it
152
+
153
+ 39
154
+ 00:02:05,297 --> 00:02:10,495
155
+ You guys are doing great this sprint but the other team's velocity is a little bit higher, could you pick it up just a little bit?
156
+
157
+ 40
158
+ 00:02:10,528 --> 00:02:11,759
159
+ 5 minutes of silent writing
160
+
161
+ 41
162
+ 00:02:18,891 --> 00:02:28,825
163
+ Hey, no it is a fine time, I'm just doing a retrospective, a job at Google? Yeah
164
+
165
+ 42
166
+ 00:02:28,858 --> 00:02:35,924
167
+ I'm not gonna be here tomorrow, so if you guys can just do your daily Scrum by email just at whatever time you like, just shoot out email
168
+
169
+ 43
170
+ 00:02:36,000 --> 00:02:37,429
171
+ That's not an impediment
172
+
173
+ 44
174
+ 00:02:37,462 --> 00:02:42,726
175
+ It's great, the other team's velocity is much better than yours, I mean could you guys work late tonight?
176
+
177
+ 45
178
+ 00:02:49,495 --> 00:02:55,330
179
+ Check it out, the cats are eating a cheeseburger, it can't be healthy at all
180
+
@@ -0,0 +1,64 @@
1
+ $FontName = Arial
2
+ $FontSize = 30
3
+ $HorzAlign = Center // Left or Right
4
+ $VertAlign = Bottom // Top or Center
5
+ $Bold = TRUE
6
+ $UnderLined = FALSE
7
+ $Italic = FALSE
8
+ $XOffset = 0 // Pixel offset (can be negative)
9
+ $YOffset = 0 // Pixel offset (can be negative)
10
+ $TextContrast = 10
11
+ $Outline1Contrast = 15
12
+ $Outline2Contrast = 7
13
+ $BackgroundContrast = 0
14
+ $ForceDisplay = TRUE // DVD Force Display Flag
15
+ $FadeIn = 0 // In number of Frames
16
+ $Fadeout = 0 // In number of Frames
17
+
18
+ $TapeOffset = TRUE
19
+
20
+ 00:00:04:25 , 00:00:09:16 , I have a problem, I can't get access to the error database at a consistent rate
21
+ 00:00:09:17 , 00:00:10:25 , Oh, that is not an impediment
22
+ 00:00:10:26 , 00:00:17:24 , In this retrospective today, I've got list of 10 improvements I'd like you guys to address for the next sprints
23
+ 00:00:17:25 , 00:00:23:24 , Hey Khara, I'm gonna need you guys to get more work in progress, it's pretty good but you gonna need more stuff than that
24
+ 00:00:23:25 , 00:00:23:27 , Ok
25
+ 00:00:23:28 , 00:00:26:00 , Cool, thanks!
26
+ 00:00:26:01 , 00:00:29:18 , Awesome, guys! That's our fastest standing up yet, it was only 40 minutes
27
+ 00:00:29:19 , 00:00:30:02 , Yeah
28
+ 00:00:30:03 , 00:00:30:29 , The point is not getting...
29
+ 00:00:31:25 , 00:00:36:06 , I was just reading this and it says Scrum is all that going faster, what's taking you so long?
30
+ 00:00:36:07 , 00:00:38:08 , Get back to work...
31
+ 00:00:38:09 , 00:00:40:28 , There is no way this story is a 13, this is more like a 2.
32
+ 00:00:40:29 , 00:00:45:20 , Alright, so we'll kick off this retrospective with 5 minutes silent writing
33
+ 00:00:49:27 , 00:00:50:21 , Silent writing
34
+ 00:00:50:25 , 00:00:51:25 , That's not an impediment
35
+ 00:00:51:26 , 00:00:55:22 , As your ScrumMaster and product owner, these are the stories I need you to commit this sprint
36
+ 00:00:59:02 , 00:01:03:07 , My computer was stolen during a break in last night, I can't get any work done until I get a new one
37
+ 00:01:03:08 , 00:01:04:22 , Have you heard of paper?
38
+ 00:01:04:23 , 00:01:08:15 , Adam, I'm gonna need this feature demo this afternoon, you can get it done right?
39
+ 00:01:08:16 , 00:01:09:16 , Yeah, no problem
40
+ 00:01:09:16 , 00:01:09:20 , Great
41
+ 00:01:09:21 , 00:01:10:18 , I'm just gonna add this to your work in progress
42
+ 00:01:10:19 , 00:01:14:25 , Continuous integrations never helps anybody,let's skip that
43
+ 00:01:14:26 , 00:01:19:24 , Oh no Chris, listen, we're doing Scrum now, so we don't have to share that sort of stuff to the management
44
+ 00:01:19:25 , 00:01:25:04 , 3 months and management think we can get it done in another sprint, and I just don't understand...
45
+ 00:01:25:05 , 00:01:32:12 , Hey guys, surprise! our CEO is joining us for today's retrospective, but just do everything normally...
46
+ 00:01:32:13 , 00:01:36:27 , Hey guys, you are totally failing, so I am gonna cut this sprint a couple of days short
47
+ 00:01:36:28 , 00:01:38:22 , Where are you going?
48
+ 00:01:38:23 , 00:01:39:28 , Bio?
49
+ 00:01:39:29 , 00:01:41:24 , Do you have a task for that?
50
+ 00:01:41:25 , 00:01:42:03 , No
51
+ 00:01:43:15 , 00:01:47:11 , Alright guys, you guys are letting our company down this sprint
52
+ 00:01:47:12 , 00:01:53:03 , I was just thinking you guys have a lot to do this sprint so let's make this sprint 3 weeks instead of 2, let's just change that
53
+ 00:01:53:03 , 00:01:53:05 , Cool
54
+ 00:01:57:00 , 00:01:57:22 , Disagree or commit?
55
+ 00:01:57:23 , 00:01:58:20 , That's not an impediment
56
+ 00:01:58:21 , 00:02:00:20 , So we call this story done?
57
+ 00:02:04:00 , 00:02:05:08 , That's close enough, you guys have it
58
+ 00:02:05:09 , 00:02:10:15 , You guys are doing great this sprint but the other team's velocity is a little bit higher, could you pick it up just a little bit?
59
+ 00:02:10:16 , 00:02:11:23 , 5 minutes of silent writing
60
+ 00:02:18:27 , 00:02:28:25 , Hey, no it is a fine time, I'm just doing a retrospective, a job at Google? Yeah
61
+ 00:02:28:26 , 00:02:35:28 , I'm not gonna be here tomorrow, so if you guys can just do your daily Scrum by email just at whatever time you like, just shoot out email
62
+ 00:02:36:00 , 00:02:37:13 , That's not an impediment
63
+ 00:02:37:14 , 00:02:42:22 , It's great, the other team's velocity is much better than yours, I mean could you guys work late tonight?
64
+ 00:02:49:15 , 00:02:55:10 , Check it out, the cats are eating a cheeseburger, it can't be healthy at all
@@ -0,0 +1,41 @@
1
+
2
+ require 'subtitle_converter'
3
+ require 'tmpdir'
4
+
5
+ describe "Trying out different files and output to see if the integration works" do
6
+
7
+ before (:each) {
8
+ @tempdir = Dir.mktmpdir
9
+ }
10
+
11
+ after (:each) {
12
+ FileUtils.remove_entry_secure @tempdir
13
+ }
14
+
15
+ def asset_file(filename)
16
+ File.join(File.dirname(__FILE__), "assets", filename)
17
+ end
18
+
19
+ def output_file(filename)
20
+ File.join(@tempdir, filename)
21
+ end
22
+
23
+
24
+ subject { SubtitleConvertor.new }
25
+
26
+ it "Can convert the IDEO shopping cart video subtitles from STL to SRT" do
27
+ subject.from(asset_file("IDEO_subtitles_en.txt")).to(output_file("IDEO_subtitles_en.srt")).convert
28
+ File.read(output_file("IDEO_subtitles_en.srt")).should== File.read(asset_file("IDEO_subtitles_en.srt"))
29
+ end
30
+
31
+ it "Can convert the Shit ScrumMasters say in English" do
32
+ subject.from(asset_file("bad scrummaster_subtitles_en.txt")).to(output_file("bad scrummaster_subtitles_en.srt")).convert
33
+ File.read(output_file("bad scrummaster_subtitles_en.srt")).should== File.read(asset_file("bad scrummaster_subtitles_en.srt"))
34
+ end
35
+
36
+ it "Can convert the Shit ScrumMasters say in Chinese" do
37
+ subject.from(asset_file("bad scrummaster_subtitles_cn.txt")).to(output_file("bad scrummaster_subtitles_cn.srt")).convert
38
+ File.read(output_file("bad scrummaster_subtitles_cn.srt")).should== File.read(asset_file("bad scrummaster_subtitles_cn.srt"))
39
+ end
40
+
41
+ end
@@ -0,0 +1,27 @@
1
+
2
+ require 'subtitle_converter'
3
+
4
+ describe STLReader do
5
+ describe "read stl file and read it content into memory" do
6
+ let(:stl_reader) { STLReader.new }
7
+ let(:data) {
8
+ "00:00:03:15\t,\t00:00:05:26\t,\tTonight, The Deep Dive.\r
9
+ 00:00:05:27\t,\t00:00:10:01\t,\tOne company's secret weapon for innovation"
10
+ }
11
+
12
+ let(:result) { [
13
+ "00:00:03:15#00:00:05:26#Tonight, The Deep Dive.","00:00:05:27#00:00:10:01#One company's secret weapon for innovation"
14
+ ]}
15
+
16
+ it "should open STL file and import content to 'srt_sub_title_lines'" do
17
+ File.stub(:open).with("file_name","r") { StringIO.new(data) }
18
+ stl_reader.import_stl_content("file_name")
19
+ stl_reader.stl_sub_title_lines.should eq(result)
20
+ end
21
+
22
+ it "should inform 'file not found' in case target file doesn't exist" do
23
+ stl_reader.should_receive(:puts).with("File not found")
24
+ stl_reader.import_stl_content("not_existing_file")
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,54 @@
1
+ require 'subtitle_converter'
2
+
3
+ describe SubRibWriter do
4
+ let(:subrib_writer) { SubRibWriter.new }
5
+ let(:stl_sub_title_lines) { [
6
+ "00:00:03:15#00:00:05:26#Tonight, The Deep Dive.","00:00:05:27#00:00:10:01#One company's secret weapon for innovation"
7
+ ]}
8
+
9
+ let(:result) { [
10
+ "1\n00:00:03,495 --> 00:00:05,858\nTonight, The Deep Dive.\n\n",
11
+ "2\n00:00:05,891 --> 00:00:10,033\nOne company's secret weapon for innovation\n\n"
12
+ ]}
13
+
14
+ let(:expect_file_content) {
15
+ "1\n00:00:03,495 --> 00:00:05,858\nTonight, The Deep Dive.\n\n"+
16
+ "2\n00:00:05,891 --> 00:00:10,033\nOne company's secret weapon for innovation\n\n"
17
+ }
18
+ describe "convert_fps_to_millisecond" do
19
+ it "should convert fps to millisec" do
20
+ subrib_writer.convert_fps_to_millisec("15").should eq("495")
21
+ end
22
+ context "when result has 2 digits" do
23
+ it "should prepend 0" do
24
+ subrib_writer.convert_fps_to_millisec("1").should eq("033")
25
+ end
26
+ end
27
+ end
28
+
29
+ describe "re_format(hh_mm_ss_fps)" do
30
+ it "should be able to convert hh:mm:ss:fps to hh:mm:ss,millisecond" do
31
+ subrib_writer.re_format("00:00:03:15").should eq("00:00:03,495")
32
+ #subrib_writer.re_format("00:00:05:26").should eq("00:00:05,858")
33
+ end
34
+ end
35
+
36
+ describe "convert_fps_to_millisec(frames_per_sec)" do
37
+ it "should parse stl lines into 'subrib_sub_title_line'" do
38
+ subrib_writer.parse_stl_lines(stl_sub_title_lines)
39
+ subrib_writer.subrib_sub_title_lines.should eq(result)
40
+ end
41
+ end
42
+
43
+ describe "write_to_file" do
44
+ it "should create file 'subrib_subtitle.srt' all data in subrib_sub_title_lines in" do
45
+ file = double("filename")
46
+ File.should_receive(:open).with("filename", "w").and_yield(file)
47
+ file.should_receive(:puts).at_least(:twice)
48
+
49
+ subrib_writer.parse_stl_lines(stl_sub_title_lines)
50
+ subrib_writer.to_file("filename")
51
+ end
52
+ end
53
+
54
+ end
@@ -0,0 +1,43 @@
1
+
2
+ require 'subtitle_converter'
3
+
4
+
5
+ describe "command line interface for the subtitle convertor" do
6
+
7
+ it "Should give a help text when not passing any parameters" do
8
+ SubtitleConvertorCommandLine.should_receive(:puts).with("convert_subtitle: missing arguments!\n")
9
+ SubtitleConvertorCommandLine.should_receive(:puts).with("usage: convert source [destination]")
10
+ SubtitleConvertorCommandLine.process([])
11
+ end
12
+
13
+ it "Should complain about too much parameters" do
14
+ SubtitleConvertorCommandLine.should_receive(:puts).with("convert_subtitle: too much arguments!\n")
15
+ SubtitleConvertorCommandLine.should_receive(:puts).with("usage: convert source [destination]")
16
+ SubtitleConvertorCommandLine.process(["1", "2", "3"])
17
+ end
18
+
19
+ it "Should pass both the parameters to the convertor class and print success" do
20
+ SubtitleConvertorCommandLine.should_receive(:puts).with("Finished converting subtitle")
21
+
22
+ convertor = double
23
+ SubtitleConvertor.should_receive(:new).and_return(convertor)
24
+ convertor.should_receive(:from).with("file.txt").and_return(convertor)
25
+ convertor.should_receive(:to).with("output.srt").and_return(convertor)
26
+ convertor.should_receive(:convert)
27
+
28
+ SubtitleConvertorCommandLine.process(["file.txt", "output.srt"])
29
+ end
30
+
31
+ it "Should be able to guess the output file based on the input file" do
32
+ SubtitleConvertorCommandLine.should_receive(:puts).with("Finished converting subtitle")
33
+
34
+ convertor = double.as_null_object
35
+ SubtitleConvertor.should_receive(:new).and_return(convertor)
36
+ convertor.should_receive(:from).and_return(convertor)
37
+ convertor.should_receive(:to).with("file.srt").and_return(convertor)
38
+
39
+ SubtitleConvertorCommandLine.process(["file.txt"])
40
+
41
+ end
42
+
43
+ end