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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b24177e7add6e8ab1894461fd2ed8244da6b91c13ade087c2dee1379525d84f2
4
- data.tar.gz: 419ad51fb287e9d4f65f9addfbf7be5bdcf7295a0286f7349acd45a21887ec41
3
+ metadata.gz: dc4910a1f5cea30a6abb8a4327b82587249209a8cce6830aa9e1df7e2bdf32ff
4
+ data.tar.gz: 41d80a9716fff1a2dd1ff12ec4eb1e03496bbdc709c757a54f80c767c7c61eb7
5
5
  SHA512:
6
- metadata.gz: 168d9e41ddfdc88ac69d1f9735f6251bdadd479576b62f79b47d7e1158437899338fd659984c931b2318c38e31fbf97a816b10ff2ee503a8626157e4342e22fd
7
- data.tar.gz: 538232d0ff48587472d34406c373b91491b8467f83ba5e93dc743b76f6ab79342169ea3b5cdd1b80a860cf89e35c071b200257246c954691b4dcf8178b5844a7
6
+ metadata.gz: 4bc935dac9779c3d705228b289fb4c3c114ca9b52c1bb7d6713c4950380b3158cc4c4c9b09b96c0c86e59dc476aa91a30b0e5503acd71fd66051f9198db5fc49
7
+ data.tar.gz: fee94264c22adc4bf922c6fbef169e816c83ae72433e8f90ae060e05c5f52715054b23ffbb79d1bd29959084cf17e8e4afc9ab63bb8e8031b2fd91472feae6b3
@@ -1,6 +1,6 @@
1
1
  module Antrapol
2
2
  module ToolRack
3
- VERSION = "0.15.0"
3
+ VERSION = "0.16.0"
4
4
  end
5
5
  end
6
6
 
@@ -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.15.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-20 00:00:00.000000000 Z
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