useful_utilities 6.6.1 → 7.0.1

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
  SHA256:
3
- metadata.gz: 79f56e1455b4af4f91f9917fa6033890fd0225d8ab6dce516405ec5694a8bb79
4
- data.tar.gz: fff0b33767c7448e7dedd64c01c2f0b416cb5ee0828bd41a92bb85e5c39f97fa
3
+ metadata.gz: ca26dcec0b9792d0f1028510f771e7f5662bbbfb7261e105a3f468792ac3dceb
4
+ data.tar.gz: b02e0ea6e43c649a0a815ed4ac2239626d11870c5d6acd3487a27c91ec49a7c2
5
5
  SHA512:
6
- metadata.gz: 3a58fbb49c9e1d9220d28328d4881939d307547cec1fff060a4052f34e8feca9b1bf2c3407bab97bf6158b24019fb64012ba3666f8315ef4e403e9410f6a351b
7
- data.tar.gz: 9eae1ac006cb6ed76ee01220158104c93c2be86c8a90cc18e7fa56c6685d2d20e04d59dad3ef5c6e8082ca19c4812fb2f6c0cee6fbc98b8a73db1cc5a1e3f0b5
6
+ metadata.gz: e0d0ca043f84529767e4b0b4101e87687fdf545d428c9010910a4cefbac5ff1d8391732b9f5f7b1f70f8b6c21a33f39acf95dc33e4f2a152908610b6e110ca5d
7
+ data.tar.gz: 3300abc52d74f542e9b2d3103357f48d1e116ba21e00250a33d3525a6d0adcb3f2e85d0d8ee9e9ed972bc4642ab18322ca3feb6c6803dddb68fa927d6c4f0de3
@@ -2,23 +2,27 @@ module UsefulUtilities
2
2
  # Redhat releases utilities
3
3
  class RedhatRelease
4
4
  LEGACY_DISTRO_TEMPLATE = 'centos%{major_version}'.freeze
5
+ private_constant :LEGACY_DISTRO_TEMPLATE
5
6
 
6
7
  VERSION_SEPARATOR = '.'.freeze # this may change to "dot" and "hyphen" if we allow not only final releases(beta, custom git builds, etc)
7
8
  VERSION_SEPARATOR_REGEXP = Regexp.escape(VERSION_SEPARATOR).freeze # regexp to match single "dot" character
9
+ private_constant :VERSION_SEPARATOR, :VERSION_SEPARATOR_REGEXP
8
10
 
9
11
  VERSION_REGEXP = %r{ # /etc/redhat-release samples: "CentOS Linux release 7.1.1503 (Core)", "Red Hat Enterprise Linux Server release 7.2 (Maipo)"
10
12
  (?<=[[:space:]]) # positive lookbehind assertion: ensures that the preceding character matches single "space" character, but doesn't include this character in the matched text
11
- (?<major_version>[[:digit:]]) # :major_version named capture group; it matches single digits
13
+ (?<major>[[:digit:]]) # :major named capture group; it matches single digits
12
14
  #{VERSION_SEPARATOR_REGEXP} # regexp for separator of version parts
13
- (?<minor_version>[[:digit:]]+) # :minor_version named capture group; it matches one or more sequential digits
14
- (?: # grouping without capturing; "monthstamp" version part don't exist for versions of Centos older then 7
15
+ (?<minor>[[:digit:]]+) # :minor named capture group; it matches one or more sequential digits
16
+ (?: # grouping without capturing; patch version does not exist for versions of CentOS older then 7
15
17
  #{VERSION_SEPARATOR_REGEXP} # regexp for separator of version parts
16
- (?<monthstamp>[[:digit:]]{4}) # :monthstamp named capture group; it matches 4 sequential digits
18
+ (?<patch>[[:digit:]]+) # :patch named capture group; it matches one or more sequential digits
17
19
  )? # zero or one times quantifier(repetition metacharacter)
18
- (?=[[:space:]]) # positive lookahead assertion: ensures that the following character matches single "space" character, but doesn't include this character in the matched text
20
+ (?=[[:space:]])? # positive lookahead assertion: ensures that the following character matches single "space" character, but doesn't include this character in the matched text
19
21
  }x.freeze
22
+ private_constant :VERSION_REGEXP
20
23
 
21
24
  DEFAULT_VERSION_ARR = [6, 0].freeze
25
+ private_constant :DEFAULT_VERSION_ARR
22
26
 
23
27
  attr_reader :release_string
24
28
 
@@ -42,7 +46,7 @@ module UsefulUtilities
42
46
  version_arr[1]
43
47
  end
44
48
 
45
- def monthstamp
49
+ def patch_version
46
50
  version_arr[2]
47
51
  end
48
52
 
@@ -58,9 +62,9 @@ module UsefulUtilities
58
62
 
59
63
  def match_version_arr
60
64
  @match_version_arr ||= [
61
- version_match[:major_version],
62
- version_match[:minor_version],
63
- version_match[:monthstamp]
65
+ version_match[:major],
66
+ version_match[:minor],
67
+ version_match[:patch]
64
68
  ].compact.map(&:to_i)
65
69
  end
66
70
 
@@ -1,3 +1,3 @@
1
1
  module UsefulUtilities
2
- VERSION = '6.6.1'.freeze
2
+ VERSION = '7.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: useful_utilities
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.1
4
+ version: 7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OnApp Ltd.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.0.3
171
+ rubygems_version: 3.2.16
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Helpful methods for time, sizes, hashes etc.