useful_utilities 6.2.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/useful_utilities/ar.rb +1 -1
- data/lib/useful_utilities/redhat_release.rb +12 -8
- data/lib/useful_utilities/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c90246d59d157abd2fbe447256485af3ae42e99411317dfe6a3d5f747b28b85f
|
4
|
+
data.tar.gz: e318b3af652c6a02a4a38f7ea9627b6ecba84fd8ca548e6046fd52c5e4c1a036
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46d7025f5ace0cb07ca5d4b7055b9dcb76edf26b194d84c9273208b0df2b895f1750198850a61772224f8ecf3d79ad09b1a99923ce539c80542539a3960d436c
|
7
|
+
data.tar.gz: c81c68a4470af3764d1000cbe691097619e78b8b1f5113546722763a0df39ca1da8e21600e4608def8b1b5d08c578e3e86396543d843fb0e8daa45ae6768db97
|
data/lib/useful_utilities/ar.rb
CHANGED
@@ -80,7 +80,7 @@ module UsefulUtilities
|
|
80
80
|
association_records.each do |nested_record|
|
81
81
|
next unless nested_record.changed?
|
82
82
|
nested_associations_validation(nested_record, :nested)
|
83
|
-
nested_record.errors.full_messages.each { |message| record.errors
|
83
|
+
nested_record.errors.full_messages.each { |message| record.errors.add(error_key, message) }
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
@@ -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
|
-
(?<
|
13
|
+
(?<major>[[:digit:]]) # :major named capture group; it matches single digits
|
12
14
|
#{VERSION_SEPARATOR_REGEXP} # regexp for separator of version parts
|
13
|
-
(?<
|
14
|
-
(?: # grouping without capturing;
|
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
|
-
(?<
|
18
|
+
(?<patch>[[:digit:]]+) # :patch named capture group; it matches one or more sequential digits
|
17
19
|
)? # zero or one times quantifier(repetition metacharacter)
|
18
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
|
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[:
|
62
|
-
version_match[:
|
63
|
-
version_match[:
|
65
|
+
version_match[:major],
|
66
|
+
version_match[:minor],
|
67
|
+
version_match[:patch]
|
64
68
|
].compact.map(&:to_i)
|
65
69
|
end
|
66
70
|
|
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:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OnApp Ltd.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '6.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '6.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '6.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: factory_bot_rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -153,7 +153,7 @@ homepage: https://github.com/OnApp/useful_utilities
|
|
153
153
|
licenses:
|
154
154
|
- Apache 2.0
|
155
155
|
metadata: {}
|
156
|
-
post_install_message:
|
156
|
+
post_install_message:
|
157
157
|
rdoc_options: []
|
158
158
|
require_paths:
|
159
159
|
- lib
|
@@ -161,15 +161,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
161
161
|
requirements:
|
162
162
|
- - ">="
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: 2.
|
164
|
+
version: 2.6.6
|
165
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
|
-
rubygems_version: 3.
|
172
|
-
signing_key:
|
171
|
+
rubygems_version: 3.3.20
|
172
|
+
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Helpful methods for time, sizes, hashes etc.
|
175
175
|
test_files: []
|