titlekit 1.2.2 → 1.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
- SHA1:
3
- metadata.gz: 7b9b35e1b03b4b9643a8c75982aec3d425fb5b84
4
- data.tar.gz: 40794f1843dd4cfbc18895dd5bffbd0a8bde6546
2
+ SHA256:
3
+ metadata.gz: cef9e09e7354eaede06fe3d337e7d2204d0e74452a24a0ce9c5926876c827822
4
+ data.tar.gz: 214d47cf6102c6529aa37f7cbdd22d4c41cb9fb24cc79b5907f3ab218eede9c7
5
5
  SHA512:
6
- metadata.gz: 325f6862335038d5a8ecc03454ec35559b28aa113cdbef9b2183d5d84723e4b83cb6d15abcbee9cfa4541f1e35ab545b3a0a64fb4ef3640dee764d006ea53480
7
- data.tar.gz: d300e60449e00888d1799d2e1e3c127bb4975f32c9f502869d609e1b62f5b9e98935800bcbdbfef1f6e9debb3a32edfc047457a627c9070d5a0f0ec3298f9c89
6
+ metadata.gz: e72816bc7ec5098f03917edddbdbfb38ffa8a1dac35f31f5e77b0ded1b47890afe9d60b2cb909cd7d4de279cba189f8fd48e35c5edb85a348a07ee0b9a77317b
7
+ data.tar.gz: a9c5bda2b3611c92201e9e2bd1827fbe892d4d49709e49429cb7530f3c0285bb5add0d55572fd2449f1cf6bd4ea749104ac48fa5043d8ff4cd3d49d107c09131
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
3
+ - 2.7.0
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ This project follows semantic versioning.
4
+
5
+ ## 1.2.3
6
+
7
+ - Fix inequalities caused by float addition (William T. Nelson) `8c84718`
8
+
9
+ ## <= 1.2.2
10
+
11
+ *See commit history*
File without changes
@@ -188,7 +188,7 @@ module Titlekit
188
188
  # @param [Float] an amount of seconds
189
189
  def self.parse_timecode(timecode)
190
190
  m = timecode.match(/(?<h>\d):(?<m>\d{2}):(?<s>\d{2})[:|\.](?<ms>\d+)/)
191
- m['h'].to_i * 3600 + m['m'].to_i * 60 + m['s'].to_i + "0.#{m['ms']}".to_f
191
+ "#{m['h'].to_i * 3600 + m['m'].to_i * 60 + m['s'].to_i}.#{m['ms']}".to_f
192
192
  end
193
193
  end
194
194
  end
@@ -29,8 +29,7 @@ module Titlekit
29
29
  value += hours.text_value.to_i * 3600
30
30
  value += minutes.text_value.to_i * 60
31
31
  value += seconds.text_value.to_i
32
- value += "0.#{fractions.text_value}".to_f
33
- value
32
+ "#{value}.#{fractions.text_value}".to_f
34
33
  end
35
34
  end
36
35
 
@@ -192,7 +192,7 @@ module Titlekit
192
192
  # @param [Float] an amount of seconds
193
193
  def self.parse_timecode(timecode)
194
194
  m = timecode.match(/(?<h>\d):(?<m>\d{2}):(?<s>\d{2})[:|\.](?<ms>\d+)/)
195
- m['h'].to_i * 3600 + m['m'].to_i * 60 + m['s'].to_i + "0.#{m['ms']}".to_f
195
+ "#{m['h'].to_i * 3600 + m['m'].to_i * 60 + m['s'].to_i}.#{m['ms']}".to_f
196
196
  end
197
197
  end
198
198
  end
@@ -1,4 +1,4 @@
1
1
  module Titlekit
2
2
  # Versioning follows the semantic versioning scheme: http://semver.org/
3
- VERSION = '1.2.2'
3
+ VERSION = '1.2.3'
4
4
  end
data/spec/ass_spec.rb CHANGED
@@ -131,6 +131,7 @@ Dialogue: 0,0:00:01.50,0:00:03.70,Default,,0000,0000,0000,,Oh yeah ... 寧為太
131
131
  describe '.parse_timecode' do
132
132
  it 'obtains a float timecode value from an ASS timecode' do
133
133
  expect(Titlekit::ASS.parse_timecode('0:00:35.96')).to eq(35.96)
134
+ expect(Titlekit::ASS.parse_timecode('0:00:04.56')).to eq(4.56)
134
135
  end
135
136
  end
136
137
  end
Binary file
@@ -36,9 +36,9 @@ Dialogue: 0,0:00:10.00,0:00:10.35,EDF393,,0000,0000,0000,,Wir verwenden zu viele
36
36
  Dialogue: 0,0:00:10.35,0:00:10.38,89BABE,,0000,0000,0000,,We are using way too many here
37
37
  Dialogue: 0,0:00:10.35,0:00:10.38,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
38
38
  Dialogue: 0,0:00:10.38,0:00:11.00,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
39
- Dialogue: 0,0:00:11.95,0:00:11.97,FFA891,,0000,0000,0000,,¡Dios mio!
40
- Dialogue: 0,0:00:11.97,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
- Dialogue: 0,0:00:11.97,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
39
+ Dialogue: 0,0:00:11.95,0:00:11.98,FFA891,,0000,0000,0000,,¡Dios mio!
40
+ Dialogue: 0,0:00:11.98,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
+ Dialogue: 0,0:00:11.98,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
42
42
  Dialogue: 0,0:00:11.99,0:00:12.04,EDF393,,0000,0000,0000,,That is correct
43
43
  Dialogue: 0,0:00:11.99,0:00:12.04,F5E665,,0000,0000,0000,,Esto es correcto
44
44
  Dialogue: 0,0:00:11.99,0:00:12.04,FFA891,,0000,0000,0000,,¡Dios mio!
@@ -36,9 +36,9 @@ Dialogue: 0,0:00:10.00,0:00:10.35,EDF393,,0000,0000,0000,,Wir verwenden zu viele
36
36
  Dialogue: 0,0:00:10.35,0:00:10.38,89BABE,,0000,0000,0000,,We are using way too many here
37
37
  Dialogue: 0,0:00:10.35,0:00:10.38,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
38
38
  Dialogue: 0,0:00:10.38,0:00:11.00,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
39
- Dialogue: 0,0:00:11.95,0:00:11.97,FFA891,,0000,0000,0000,,¡Dios mio!
40
- Dialogue: 0,0:00:11.97,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
- Dialogue: 0,0:00:11.97,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
39
+ Dialogue: 0,0:00:11.95,0:00:11.98,FFA891,,0000,0000,0000,,¡Dios mio!
40
+ Dialogue: 0,0:00:11.98,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
+ Dialogue: 0,0:00:11.98,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
42
42
  Dialogue: 0,0:00:11.99,0:00:12.04,EDF393,,0000,0000,0000,,That is correct
43
43
  Dialogue: 0,0:00:11.99,0:00:12.04,F5E665,,0000,0000,0000,,Esto es correcto
44
44
  Dialogue: 0,0:00:11.99,0:00:12.04,FFA891,,0000,0000,0000,,¡Dios mio!
@@ -36,9 +36,9 @@ Dialogue: 0,0:00:10.00,0:00:10.35,EDF393,,0000,0000,0000,,Wir verwenden zu viele
36
36
  Dialogue: 0,0:00:10.35,0:00:10.38,89BABE,,0000,0000,0000,,We are using way too many here
37
37
  Dialogue: 0,0:00:10.35,0:00:10.38,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
38
38
  Dialogue: 0,0:00:10.38,0:00:11.00,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
39
- Dialogue: 0,0:00:11.95,0:00:11.97,FFA891,,0000,0000,0000,,¡Dios mio!
40
- Dialogue: 0,0:00:11.97,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
- Dialogue: 0,0:00:11.97,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
39
+ Dialogue: 0,0:00:11.95,0:00:11.98,FFA891,,0000,0000,0000,,¡Dios mio!
40
+ Dialogue: 0,0:00:11.98,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
+ Dialogue: 0,0:00:11.98,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
42
42
  Dialogue: 0,0:00:11.99,0:00:12.04,EDF393,,0000,0000,0000,,That is correct
43
43
  Dialogue: 0,0:00:11.99,0:00:12.04,F5E665,,0000,0000,0000,,Esto es correcto
44
44
  Dialogue: 0,0:00:11.99,0:00:12.04,FFA891,,0000,0000,0000,,¡Dios mio!
@@ -36,9 +36,9 @@ Dialogue: 0,0:00:10.00,0:00:10.35,EDF393,,0000,0000,0000,,Wir verwenden zu viele
36
36
  Dialogue: 0,0:00:10.35,0:00:10.38,89BABE,,0000,0000,0000,,We are using way too many here
37
37
  Dialogue: 0,0:00:10.35,0:00:10.38,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
38
38
  Dialogue: 0,0:00:10.38,0:00:11.00,EDF393,,0000,0000,0000,,Wir verwenden zu viele Untertitel zur gleichen Zeit
39
- Dialogue: 0,0:00:11.95,0:00:11.97,FFA891,,0000,0000,0000,,¡Dios mio!
40
- Dialogue: 0,0:00:11.97,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
- Dialogue: 0,0:00:11.97,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
39
+ Dialogue: 0,0:00:11.95,0:00:11.98,FFA891,,0000,0000,0000,,¡Dios mio!
40
+ Dialogue: 0,0:00:11.98,0:00:11.99,EDF393,,0000,0000,0000,,That is correct
41
+ Dialogue: 0,0:00:11.98,0:00:11.99,FFA891,,0000,0000,0000,,¡Dios mio!
42
42
  Dialogue: 0,0:00:11.99,0:00:12.04,EDF393,,0000,0000,0000,,That is correct
43
43
  Dialogue: 0,0:00:11.99,0:00:12.04,F5E665,,0000,0000,0000,,Esto es correcto
44
44
  Dialogue: 0,0:00:11.99,0:00:12.04,FFA891,,0000,0000,0000,,¡Dios mio!
data/spec/srt_spec.rb CHANGED
@@ -41,6 +41,7 @@ describe Titlekit::SRT do
41
41
  end
42
42
 
43
43
  it 'parses and builds correct timecodes' do
44
+ expect(subtitles[7][:end]).to eq(22.952)
44
45
  expect(subtitles[299][:start]).to eq(1426.564)
45
46
  expect(subtitles[299][:end]).to eq(1428.759)
46
47
  end
data/spec/ssa_spec.rb CHANGED
@@ -85,6 +85,7 @@ Dialogue: 0,0:00:01.50,0:00:03.70,Default,,0000,0000,0000,,Oh yeah ... 寧為太
85
85
  describe '.parse_timecode' do
86
86
  it 'obtains a float timecode value from an SSA timecode' do
87
87
  expect(Titlekit::SSA.parse_timecode('0:00:35.96')).to eq(35.96)
88
+ expect(Titlekit::SSA.parse_timecode('0:00:04.56')).to eq(4.56)
88
89
  end
89
90
  end
90
91
  end
data/titlekit.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.homepage = 'https://github.com/simonrepp/titlekit'
9
9
 
10
10
  spec.author = 'Simon Repp'
11
- spec.email = 'simon@fdpl.foundation'
11
+ spec.email = 'simon@fdpl.io'
12
12
 
13
13
  spec.license = 'MIT'
14
14
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.add_development_dependency('rspec')
20
20
 
21
21
  spec.platform = Gem::Platform::RUBY
22
- spec.required_ruby_version = '>= 2.0.0'
22
+ spec.required_ruby_version = '>= 2.4.0'
23
23
  spec.files = `git ls-files`.split($\)
24
24
  spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
25
25
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: titlekit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Repp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-05 00:00:00.000000000 Z
11
+ date: 2020-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rchardet19
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Featureful Ruby library for SRT / ASS / SSA subtitles
70
- email: simon@fdpl.foundation
70
+ email: simon@fdpl.io
71
71
  executables:
72
72
  - titlekit
73
73
  extensions: []
@@ -75,8 +75,9 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".travis.yml"
78
+ - CHANGELOG.md
78
79
  - Gemfile
79
- - LICENSE
80
+ - LICENSE.txt
80
81
  - README.md
81
82
  - Rakefile
82
83
  - bin/titlekit
@@ -204,15 +205,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
205
  requirements:
205
206
  - - ">="
206
207
  - !ruby/object:Gem::Version
207
- version: 2.0.0
208
+ version: 2.4.0
208
209
  required_rubygems_version: !ruby/object:Gem::Requirement
209
210
  requirements:
210
211
  - - ">="
211
212
  - !ruby/object:Gem::Version
212
213
  version: '0'
213
214
  requirements: []
214
- rubyforge_project:
215
- rubygems_version: 2.4.8
215
+ rubygems_version: 3.1.2
216
216
  signing_key:
217
217
  specification_version: 4
218
218
  summary: Featureful Ruby library for SRT / ASS / SSA subtitles