vcs_ruby 1.1.14 → 1.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/time_index.rb +19 -4
  3. data/lib/version.info +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8682c5b27b8a63f89c8cb1b63ab9609dcc01107
4
- data.tar.gz: fa2a50d213d98d3f18f64f34d6639714ae8582d9
3
+ metadata.gz: e3c7366172a00829937c846cbbbf52dac223ddca
4
+ data.tar.gz: 6e893f7ebf5a395d3d833dbd779d69bd2e52463b
5
5
  SHA512:
6
- metadata.gz: eae5a53b403b4ae37d2aef0eab4e875c317059378a688cde983ece4c9a42ffd266b75402e9a7f73c6a657bbf30715e7a50a341a92f8ad6509db72fbf296076ee
7
- data.tar.gz: '096f2c11496b2a3decfd3d6294c8aafbc38a02d6f67b3ebf98fb09712a67c4e783514704573d030226b6134e1dce093ede9a61bfb8db59a9747bc59d69a7aded'
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.instance_of? Float or time_index.instance_of? Integer
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 operand.instance_of? Integer
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 operand.instance_of? Integer
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 operand.instance_of? Integer
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.14
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.14
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.10
178
+ rubygems_version: 2.6.11
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: Generates contact sheets of videos