moving_words 0.0.2 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 646ed7d8017ca3b438ce1daf0d35a9239a5689ee
4
- data.tar.gz: aa0f60a76a77dfce5e2a52f875ad89988e94690d
3
+ metadata.gz: 6cfc5c2f48a12b042dfc837c801f6622cce22c15
4
+ data.tar.gz: 282b744e77155dd15ff403a81a241fad29117ccf
5
5
  SHA512:
6
- metadata.gz: d17d2f99adbd873bde04491bda6ae8c10768fc77825128ae68790f83c3bcb80ce4b1c5162e4867766864e82d42a1afce537fe112bae9b9659da3d4632d07b77e
7
- data.tar.gz: 517d77254de3d08e0f1c51ede0d9e03d7d0e2a952722e17bad53efc4b325eee96be7f7ab5ebf616c83a6c699bbf167723e85527f4300377e373835ac87f3904b
6
+ metadata.gz: b573d3989cabcb943cbc696805548df4598a9388c2b435e54286d477ed9aa4c8267e2b538ebdde23cb9e315b796092848dc9054c15fe8ab4a26269e5d7984c9a
7
+ data.tar.gz: 5e27c76c9a3e240fe4dd9d2ef35bbb524190adb451fdf4a46112c1166d80e6fd9fd489e9b9728ca740f6c546e677d11cad78736e16ca88a6ef866c81b9a000e4
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.3 - 2014-04-14
4
+
5
+ * Fixed `CaptionBlock.human_offset` minute wraparound issue.
6
+
3
7
  ## 0.0.2 - 2014-02-10
4
8
 
5
9
  * Added `CaptionBlock.human_offset` method for outputting human readable offsets.
@@ -37,7 +37,7 @@ module MovingWords
37
37
  # => "3:04:35"
38
38
  def self.human_offset(offset_in_milliseconds, options = {})
39
39
  hours = offset_in_milliseconds / 3600000
40
- minutes = (offset_in_milliseconds % 360000) / 60000
40
+ minutes = (offset_in_milliseconds % 3600000) / 60000
41
41
  seconds = (offset_in_milliseconds % 60000) / 1000
42
42
  milliseconds = offset_in_milliseconds % 1000
43
43
 
@@ -1,3 +1,3 @@
1
1
  module MovingWords
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -2,11 +2,15 @@ require 'spec_helper'
2
2
 
3
3
  module MovingWords
4
4
  describe CaptionBlock do
5
- describe ".readable_offset" do
5
+ describe ".human_offset" do
6
6
  it "handles times with minutes without showing hours" do
7
7
  expect(CaptionBlock.human_offset(132212)).to eq("2:12")
8
8
  end
9
9
 
10
+ it "handles times over 6 minutes without wrapping" do
11
+ expect(CaptionBlock.human_offset(728419)).to eq("12:08")
12
+ end
13
+
10
14
  it "shows milliseconds when requested" do
11
15
  expect(CaptionBlock.human_offset(132212, milliseconds: true)).to eq("2:12.212")
12
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moving_words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Johnson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-10 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler