timecode 0.1.9 → 0.2.0
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.
- data/History.txt +4 -0
- data/SPECS.txt +2 -1
- data/lib/timecode.rb +2 -2
- data/test/test_timecode.rb +13 -0
- metadata +2 -2
data/History.txt
CHANGED
data/SPECS.txt
CHANGED
@@ -90,6 +90,7 @@
|
|
90
90
|
* raise when trying to parse DF timecode
|
91
91
|
* raise on improper format
|
92
92
|
* raise on empty argument
|
93
|
+
* properly handle 09 and 08 as part of complete TC pattern
|
93
94
|
|
94
95
|
== Timecode.soft_parse should
|
95
96
|
* parse the timecode
|
@@ -99,4 +100,4 @@
|
|
99
100
|
* parse from a 4x4bits packed 32bit unsigned int
|
100
101
|
* properly convert itself back to 4x4 bits 32bit unsigned int
|
101
102
|
|
102
|
-
|
103
|
+
69 specifications (113 requirements), 0 failures
|
data/lib/timecode.rb
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
# :mapping => [%w(source_tc_frames total), %w(tape_fps fps)]
|
13
13
|
|
14
14
|
class Timecode
|
15
|
-
VERSION = '0.
|
15
|
+
VERSION = '0.2.0'
|
16
16
|
|
17
17
|
include Comparable
|
18
18
|
|
@@ -82,7 +82,7 @@ class Timecode
|
|
82
82
|
raise Error, "We do not support drop-frame TC"
|
83
83
|
# 00:00:00:00
|
84
84
|
elsif (input =~ COMPLETE_TC_RE)
|
85
|
-
atoms_and_fps = input.scan(COMPLETE_TC_RE).to_a.flatten.map{|e|
|
85
|
+
atoms_and_fps = input.scan(COMPLETE_TC_RE).to_a.flatten.map{|e| e.to_i} + [with_fps]
|
86
86
|
return at(*atoms_and_fps)
|
87
87
|
# 00:00:00.0
|
88
88
|
elsif input =~ FRACTIONAL_TC_RE
|
data/test/test_timecode.rb
CHANGED
@@ -156,6 +156,14 @@ context "A Timecode of zero should" do
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
+
context "Timecode.from_seconds should" do
|
160
|
+
specify "properly process this specific case for a float framerate" do
|
161
|
+
float_secs = 89.99165971643036
|
162
|
+
float_fps = 23.9898
|
163
|
+
lambda{ Timecode.from_seconds(float_secs, float_fps) }.should.not.raise
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
159
167
|
context "Timecode#to_seconds should" do
|
160
168
|
specify "return a float" do
|
161
169
|
Timecode.new(0).to_seconds.should.be.kind_of Float
|
@@ -397,6 +405,10 @@ context "Timecode.parse should" do
|
|
397
405
|
specify "raise on empty argument" do
|
398
406
|
lambda { Timecode.parse(" \n\n ", 25) }.should.raise Timecode::CannotParse
|
399
407
|
end
|
408
|
+
|
409
|
+
specify "properly handle 09 and 08 as part of complete TC pattern" do
|
410
|
+
Timecode.parse( "09:08:09:08", 25).total.should.equal 822233
|
411
|
+
end
|
400
412
|
end
|
401
413
|
|
402
414
|
context "Timecode.soft_parse should" do
|
@@ -412,6 +424,7 @@ context "Timecode.soft_parse should" do
|
|
412
424
|
end
|
413
425
|
end
|
414
426
|
|
427
|
+
|
415
428
|
context "Timecode with unsigned integer conversions should" do
|
416
429
|
|
417
430
|
specify "parse from a 4x4bits packed 32bit unsigned int" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timecode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-29 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|