yt 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/yt/models/annotation.rb +1 -0
- data/lib/yt/version.rb +1 -1
- data/spec/models/annotation_spec.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d824701c27d2369e03c760e042cfe19dbd39470
|
4
|
+
data.tar.gz: 63ff1fa70040d3d8500e04505816d5ceb2bc0779
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9168b327cc1dbb9a37f14eb764c0311a2b42b21c23eac6b08b3e8deede02de23105778f1f36e9cf454b00ae3ab759963db53b8b7f47733ca28582ae838330947
|
7
|
+
data.tar.gz: 047a62222b0f27367bf2287afed2c5d69908497d03245e1fbce64705268e74161239af4ebf131640c8f587e06af8674c3eb88d1f463ddb4e949567f04ef7748f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -41,7 +41,7 @@ To install on your system, run
|
|
41
41
|
|
42
42
|
To use inside a bundled Ruby project, add this line to the Gemfile:
|
43
43
|
|
44
|
-
gem 'yt', '~> 0.8.
|
44
|
+
gem 'yt', '~> 0.8.4'
|
45
45
|
|
46
46
|
Since the gem follows [Semantic Versioning](http://semver.org),
|
47
47
|
indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
|
data/lib/yt/models/annotation.rb
CHANGED
@@ -113,6 +113,7 @@ module Yt
|
|
113
113
|
|
114
114
|
def timestamp_of(position)
|
115
115
|
regex = %r{(?:|(?<hours>\d*):)(?:|(?<min>\d*):)(?<sec>\d*)\.(?<ms>\d*)}
|
116
|
+
position['t'] = '00:00:00.000' if position['t'] == '0'
|
116
117
|
match = position['t'].match regex
|
117
118
|
hours = (match[:hours] || '0').to_i
|
118
119
|
minutes = (match[:min] || '0').to_i
|
data/lib/yt/version.rb
CHANGED
@@ -157,5 +157,17 @@ describe Yt::Annotation do
|
|
157
157
|
it { expect(annotation.starts_after? 0).to be_nil }
|
158
158
|
it { expect(annotation.starts_before? 0).to be_nil }
|
159
159
|
end
|
160
|
+
|
161
|
+
context 'given an annotation with "0" as the timestamp' do
|
162
|
+
let(:xml) { %Q{
|
163
|
+
<segment>
|
164
|
+
<movingRegion type="rect">
|
165
|
+
<rectRegion h="6.0" t="0" w="25.0" x="7.0" y="5.0"/>
|
166
|
+
</movingRegion>
|
167
|
+
</segment>
|
168
|
+
} }
|
169
|
+
it { expect(annotation.starts_after? 10).to be_falsey }
|
170
|
+
it { expect(annotation.starts_before? 10).to be true }
|
171
|
+
end
|
160
172
|
end
|
161
173
|
end
|