webvtt-ruby 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86f9a1b4c8804bd7074b68d1ba4f7d494cb04af2
4
- data.tar.gz: 007ef1c78e53c80faccfe1c5a1aa2c84d6c96bc9
3
+ metadata.gz: 40171384b385639a049e962d60186917d913cc83
4
+ data.tar.gz: 161fd02081b0ecd8680d76179ede800a91cb2610
5
5
  SHA512:
6
- metadata.gz: d371d84f3946ebc16c42517b3360a660e2f44318fb2f0403e641e130d00836845b1657c0de38171ab01b9a6de4e7897c0d1832baa2a06e2e1f902af6be53832d
7
- data.tar.gz: 4a6d51ea3bb451d3841fecd958d8727cb983ff57faa666a55abdebed72449da4864c6ba9962dd53c6c71ced4679dfee0db5073cc661c2c9a68e989aa0513d783
6
+ metadata.gz: 6f833a5fc9ebe5699238b96733c116826ab85dbf391a9e82274c5733a429546af4477b6f7c07da588735ca901a448ca37b54df04f5f55545b3a81bd83981bade
7
+ data.tar.gz: e4512e0119a39645f56efde5f24286f7cae3129464c91bbfa05ca400d0f49605a755b3e4125909da46e75378c2dd199450137453f9bf68d14424b6b2f4d03d5d
@@ -73,7 +73,7 @@ module WebVTT
73
73
 
74
74
  @cues = []
75
75
  cues.each do |cue|
76
- cue_parsed = Cue.new(cue)
76
+ cue_parsed = Cue.new(cue.strip)
77
77
  if !cue_parsed.text.nil?
78
78
  @cues << cue_parsed
79
79
  end
@@ -149,4 +149,17 @@ The text should change)
149
149
  puts
150
150
  end
151
151
  end
152
+
153
+ def test_parse_cue_with_no_text
154
+ webvtt = WebVTT.read("tests/subtitles/no_text.webvtt")
155
+ assert_equal 2, webvtt.cues.size
156
+ assert_equal "265", webvtt.cues[0].identifier
157
+ assert_equal "00:08:57.409", webvtt.cues[0].start
158
+ assert_equal "00:09:00.592", webvtt.cues[0].end
159
+ assert_equal "", webvtt.cues[0].text
160
+ assert_equal "266", webvtt.cues[1].identifier
161
+ assert_equal "00:09:00.593", webvtt.cues[1].start
162
+ assert_equal "00:09:02.373", webvtt.cues[1].end
163
+ assert_equal "", webvtt.cues[1].text
164
+ end
152
165
  end
@@ -0,0 +1,8 @@
1
+ WEBVTT
2
+
3
+ 265
4
+ 00:08:57.409 --> 00:09:00.592
5
+
6
+
7
+ 266
8
+ 00:09:00.593 --> 00:09:02.373
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'webvtt-ruby'
3
- s.version = '0.2.2'
3
+ s.version = '0.2.3'
4
4
  s.summary = "WebVTT parser and segmenter in ruby"
5
5
  s.description = "WebVTT parser and segmenter in ruby for HTML5 and HTTP Live Streaming (HLS)."
6
6
  s.authors = ["Bruno Celeste"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webvtt-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Celeste
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-12 00:00:00.000000000 Z
11
+ date: 2014-03-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: WebVTT parser and segmenter in ruby for HTML5 and HTTP Live Streaming
14
14
  (HLS).
@@ -30,6 +30,7 @@ files:
30
30
  - tests/segmenter.rb
31
31
  - tests/subtitles/big_srt.srt
32
32
  - tests/subtitles/big_srt.webvtt
33
+ - tests/subtitles/no_text.webvtt
33
34
  - tests/subtitles/notvalid.webvtt
34
35
  - tests/subtitles/test.webvtt
35
36
  - tests/subtitles/test_from_srt.srt