vcs_ruby 1.1.14 → 1.1.15
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 +4 -4
- data/lib/time_index.rb +19 -4
- data/lib/version.info +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3c7366172a00829937c846cbbbf52dac223ddca
|
4
|
+
data.tar.gz: 6e893f7ebf5a395d3d833dbd779d69bd2e52463b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b3562534251390ce98660bd6516739d4dbc896552b9e33768b73312411cfdc7ef79d147d997b16a3dabba1e417202ab5bcde748633761ffdf7d1662671522a4
|
7
|
+
data.tar.gz: e33e0ac6ae513194ef8a57637ce32ff50a66f13abf167859104265e6fd2649808fd7c9f5fb1310be2ad124c961466c409963ec93835995fa83d664276b7f1c6f
|
data/lib/time_index.rb
CHANGED
@@ -7,8 +7,23 @@ module VCSRuby
|
|
7
7
|
include Comparable
|
8
8
|
attr_reader :total_seconds
|
9
9
|
|
10
|
+
def has_unified_integer?
|
11
|
+
version = RUBY_VERSION.split('.').collect(&:to_i)
|
12
|
+
|
13
|
+
return (version[0] == 2 && version[1] >= 4) || version[0] > 2
|
14
|
+
end
|
15
|
+
|
16
|
+
# compatibilty fix
|
17
|
+
def is_integer? variable
|
18
|
+
if has_unified_integer?
|
19
|
+
return variable.instance_of?(Integer)
|
20
|
+
else
|
21
|
+
return variable.instance_of?(Fixnum) || variable.instance_of?(Bignum)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
10
25
|
def initialize time_index = ''
|
11
|
-
if time_index
|
26
|
+
if is_integer?(time_index) || time_index.instance_of?(Float)
|
12
27
|
@total_seconds = time_index
|
13
28
|
else
|
14
29
|
@total_seconds = 0.0
|
@@ -66,7 +81,7 @@ module VCSRuby
|
|
66
81
|
end
|
67
82
|
|
68
83
|
def + operand
|
69
|
-
if
|
84
|
+
if is_integer? operand
|
70
85
|
TimeIndex.new @total_seconds + operand
|
71
86
|
else
|
72
87
|
TimeIndex.new @total_seconds + operand.total_seconds
|
@@ -74,7 +89,7 @@ module VCSRuby
|
|
74
89
|
end
|
75
90
|
|
76
91
|
def - operand
|
77
|
-
if
|
92
|
+
if is_integer? operand
|
78
93
|
TimeIndex.new @total_seconds - operand
|
79
94
|
else
|
80
95
|
TimeIndex.new @total_seconds - operand.total_seconds
|
@@ -86,7 +101,7 @@ module VCSRuby
|
|
86
101
|
end
|
87
102
|
|
88
103
|
def / operand
|
89
|
-
if
|
104
|
+
if is_integer? operand
|
90
105
|
TimeIndex.new @total_seconds / operand
|
91
106
|
else
|
92
107
|
@total_seconds / operand.total_seconds
|
data/lib/version.info
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.15
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcs_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Bruderer
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
requirements:
|
176
176
|
- libav or ffmpeg or mplayer
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.6.
|
178
|
+
rubygems_version: 2.6.11
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Generates contact sheets of videos
|