useful_utilities 6.2.0 → 7.0.0

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: d3fd017eb017a3f0b234806495c724f7cf3c1fdf2e0995f0f448f87e47511cee
4
- data.tar.gz: f10930dce396a905c21d1be354be1f91624e26e3fdbd7558c0399c2d4c4f51ec
3
+ metadata.gz: c90246d59d157abd2fbe447256485af3ae42e99411317dfe6a3d5f747b28b85f
4
+ data.tar.gz: e318b3af652c6a02a4a38f7ea9627b6ecba84fd8ca548e6046fd52c5e4c1a036
5
5
  SHA512:
6
- metadata.gz: 0e063dc31293b1480a21069ac1a5db670c8f8597eb48c00b02737572bbebf02641dfb8e26490220cb81bb65c7ca51e846d5d6eaaeadec521952b4023ef3c2a7c
7
- data.tar.gz: 0c6f7f226513c1ccb28f4a1d721d3f64dcae65da05eb71e8a3a96998355a29b02cfa62aedafb116ed64ff50d79a13e50bc9377c5daa8bbd7f23d46fe827dd4bc
6
+ metadata.gz: 46d7025f5ace0cb07ca5d4b7055b9dcb76edf26b194d84c9273208b0df2b895f1750198850a61772224f8ecf3d79ad09b1a99923ce539c80542539a3960d436c
7
+ data.tar.gz: c81c68a4470af3764d1000cbe691097619e78b8b1f5113546722763a0df39ca1da8e21600e4608def8b1b5d08c578e3e86396543d843fb0e8daa45ae6768db97
@@ -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[error_key] << message }
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
- (?<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
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.2.0'.freeze
2
+ VERSION = '7.0.0'.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.2.0
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: 2019-12-19 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
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.1
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: 5.0.1
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: 5.0.1
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: 5.0.1
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: factory_girl_rails
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.3.4
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.0.6
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: []