toolrack 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toolrack/version.rb +1 -1
- data/lib/toolrack/version_utils.rb +47 -0
- data/lib/toolrack.rb +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc4910a1f5cea30a6abb8a4327b82587249209a8cce6830aa9e1df7e2bdf32ff
|
4
|
+
data.tar.gz: 41d80a9716fff1a2dd1ff12ec4eb1e03496bbdc709c757a54f80c767c7c61eb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc935dac9779c3d705228b289fb4c3c114ca9b52c1bb7d6713c4950380b3158cc4c4c9b09b96c0c86e59dc476aa91a30b0e5503acd71fd66051f9198db5fc49
|
7
|
+
data.tar.gz: fee94264c22adc4bf922c6fbef169e816c83ae72433e8f90ae060e05c5f52715054b23ffbb79d1bd29959084cf17e8e4afc9ab63bb8e8031b2fd91472feae6b3
|
data/lib/toolrack/version.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
|
2
|
+
require_relative 'condition_utils'
|
3
|
+
|
4
|
+
module Antrapol
|
5
|
+
module ToolRack
|
6
|
+
module VersionUtils
|
7
|
+
include Antrapol::ToolRack::ConditionUtils
|
8
|
+
|
9
|
+
class VersionUtilsError < StandardError; end
|
10
|
+
|
11
|
+
def is_version_equal?(*args)
|
12
|
+
res = true
|
13
|
+
target = Gem::Version.new(args.first)
|
14
|
+
args.each do |a|
|
15
|
+
subj = Gem::Version.new(a)
|
16
|
+
res = (subj == target)
|
17
|
+
break if not res
|
18
|
+
target = subj
|
19
|
+
end
|
20
|
+
|
21
|
+
res
|
22
|
+
end
|
23
|
+
|
24
|
+
def possible_versions(ver)
|
25
|
+
raise VersionUtilsError, "Given version to extrapolate is empty" if is_empty?(ver)
|
26
|
+
vv = ver.to_s.split('.')
|
27
|
+
tv = vv.clone
|
28
|
+
res = []
|
29
|
+
cnt = 0
|
30
|
+
(0...vv.length).each do |i|
|
31
|
+
tv = vv.clone
|
32
|
+
tv[i] = tv[i].to_i+1
|
33
|
+
|
34
|
+
j = i
|
35
|
+
loop do
|
36
|
+
break if j >= (vv.length-1)
|
37
|
+
j += 1
|
38
|
+
tv[j] = 0
|
39
|
+
end
|
40
|
+
res << tv.join(".")
|
41
|
+
end
|
42
|
+
res
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/toolrack.rb
CHANGED
@@ -15,6 +15,7 @@ require_relative 'toolrack/password_utils'
|
|
15
15
|
require_relative 'toolrack/hash_config'
|
16
16
|
require_relative 'toolrack/cli_utils'
|
17
17
|
require_relative 'toolrack/null_output'
|
18
|
+
require_relative 'toolrack/version_utils'
|
18
19
|
|
19
20
|
module Antrapol
|
20
21
|
module ToolRack
|
@@ -38,6 +39,8 @@ TR::DataConvUtils = ToolRack::DataConvUtils
|
|
38
39
|
ToolRack::CondUtils = ToolRack::ConditionUtils
|
39
40
|
TR::CondUtils = ToolRack::ConditionUtils
|
40
41
|
|
42
|
+
TR::ProcessUtils = ToolRack::ProcessUtils
|
43
|
+
|
41
44
|
ToolRack::PassUtils = ToolRack::PasswordUtils
|
42
45
|
TR::PassUtils = ToolRack::PasswordUtils
|
43
46
|
|
@@ -53,3 +56,6 @@ TR::CliUtils = ToolRack::CliUtils
|
|
53
56
|
|
54
57
|
TR::NullOut = ToolRack::NullOutput
|
55
58
|
|
59
|
+
TR::VerUtils = ToolRack::VersionUtils
|
60
|
+
TR::VUtils = TR::VerUtils
|
61
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toolrack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tlogger
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- lib/toolrack/runtime_utils.rb
|
96
96
|
- lib/toolrack/utils.rb
|
97
97
|
- lib/toolrack/version.rb
|
98
|
+
- lib/toolrack/version_utils.rb
|
98
99
|
- process_test/backtick_test.rb
|
99
100
|
- process_test/pty_test.rb
|
100
101
|
- process_test/shell_test.rb
|