ovirt_metrics 3.2.0 → 3.3.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: 66210bd87d0575e715ffca259400ec3cf45fdc1ca967685145a900506012a1a7
4
- data.tar.gz: 4fc22790c3389a3732ce2df091ef97743ee31f4602277f52fb4f110b4e373c24
3
+ metadata.gz: e391ddd37fb669e49664820bf19ddd99926281cf5dda6b12312407e952010a1c
4
+ data.tar.gz: fd4c03768e3d17cfe7665fa824a70df6a2b4d8e10f76780f36c41e3783a1e842
5
5
  SHA512:
6
- metadata.gz: 8c594212bcba95090f7f9ac36ee0466dfd6107012a3a44af98217afa3209c122ca2a20e0d594791c69a9842395fbd4eeda3ac9af1047adc708fa051633e6c9ab
7
- data.tar.gz: 2f1dc14c92f48f17b199a438794e92e1618c3c4182602dc24836f29d6397fe64f53a14e10eeca6fb1db519a67ebd7702a497f35bff507a37435a6d1e57062c59
6
+ metadata.gz: af60f8e7e2b1d932e73f3ea48c83560722f29039bd8b7661e443cf063258b061743a6c35204c69d25e7fe41e8fb110529057e1f5cc8562ee406e74cbdd2a81c8
7
+ data.tar.gz: 7d3fce36ea946033f604249ce3597d10bcce5d1cd74226d008f22a254a08d25d7e2f292df0a3e3a34e32ee5c2e87ac09f006bf388d70f55aa12a62fde6f79829
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/ovirt_metrics.svg)](http://badge.fury.io/rb/ovirt_metrics)
4
4
  [![CI](https://github.com/ManageIQ/ovirt_metrics/actions/workflows/ci.yaml/badge.svg)](https://github.com/ManageIQ/ovirt_metrics/actions/workflows/ci.yaml)
5
- [![Code Climate](https://codeclimate.com/github/ManageIQ/ovirt_metrics.svg)](https://codeclimate.com/github/ManageIQ/ovirt_metrics)
6
- [![Test Coverage](https://codeclimate.com/github/ManageIQ/ovirt_metrics/badges/coverage.svg)](https://codeclimate.com/github/ManageIQ/ovirt_metrics/coverage)
7
5
 
8
6
  OvirtMetrics is an ActiveRecord-based gem for reading the oVirt History database.
9
7
 
@@ -17,9 +17,19 @@ module ActiveRecord
17
17
  end
18
18
 
19
19
  module ConnectionAdapters
20
+ require 'active_record/connection_adapters/postgresql_adapter'
21
+
20
22
  class OvirtPostgreSQLAdapter < PostgreSQLAdapter
21
23
  ADAPTER_NAME = "OvirtPostgreSQL"
22
24
 
25
+ # ActiveRecord 7.2 introduced a .register method for connection adapters,
26
+ # replacing the auto-require with path based on adapter name.
27
+ # Without registering the adapter active_record won't be able to find the
28
+ # ovirt_postgresql adapter.
29
+ if ActiveRecord::VERSION::MAJOR > 7 || (ActiveRecord::VERSION::MAJOR == 7 && ActiveRecord::VERSION::MINOR >= 2)
30
+ ActiveRecord::ConnectionAdapters.register('ovirt_postgresql', name, 'active_record/connection_adapters/ovirt_postgresql_adapter')
31
+ end
32
+
23
33
  def check_version
24
34
  msg = "The version of PostgreSQL (#{postgresql_version}) is too old (9.2+ required)"
25
35
  if postgresql_version < 90200
@@ -1,3 +1,3 @@
1
1
  module OvirtMetrics
2
- VERSION = "3.2.0"
2
+ VERSION = "3.3.0"
3
3
  end
data/lib/ovirt_metrics.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require "logger" # Require logger due to active_support breaking on Rails <= 7.0. See https://github.com/rails/rails/pull/54264
1
2
  require "active_record"
2
3
  require "ovirt_metrics/version"
3
4
  require "ovirt_metrics/configurator"
data/spec/spec_helper.rb CHANGED
@@ -95,8 +95,9 @@ OvirtMetrics.config do |c|
95
95
  c.connection_specification_name = 'primary'
96
96
  end
97
97
  end
98
- ActiveRecord::Base.establish_connection :adapter => "sqlite3", :database => ":memory:"
99
98
 
100
- require "active_record"
99
+ require "active_record/connection_adapters/ovirt_postgresql_adapter"
100
+ ActiveRecord::Base.establish_connection :adapter => "ovirt_postgresql", :database => "ovirt_engine_history", :user => "root", :host => "localhost", :password => "smartvm"
101
+
101
102
  puts
102
103
  puts "\e[93mUsing ActiveRecord #{ActiveRecord.version}\e[0m"
@@ -1,3 +1,4 @@
1
+ require "logger" # Require logger due to active_support breaking on Rails <= 7.0. See https://github.com/rails/rails/pull/54264
1
2
  require 'active_record'
2
3
 
3
4
  module ActiveModel::Validations
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ovirt_metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Barenboim
8
8
  - Jason Frey
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-02-08 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activerecord
@@ -17,14 +16,14 @@ dependencies:
17
16
  requirements:
18
17
  - - ">="
19
18
  - !ruby/object:Gem::Version
20
- version: '6.0'
19
+ version: '7.0'
21
20
  type: :runtime
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
24
  - - ">="
26
25
  - !ruby/object:Gem::Version
27
- version: '6.0'
26
+ version: '7.0'
28
27
  - !ruby/object:Gem::Dependency
29
28
  name: pg
30
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,20 +108,6 @@ dependencies:
109
108
  - - ">="
110
109
  - !ruby/object:Gem::Version
111
110
  version: 0.21.2
112
- - !ruby/object:Gem::Dependency
113
- name: sqlite3
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
111
  description: OvirtMetrics is an ActiveRecord-based gem for reading the oVirt History
127
112
  database.
128
113
  email:
@@ -196,7 +181,6 @@ homepage: http://github.com/ManageIQ/ovirt_metrics
196
181
  licenses:
197
182
  - MIT
198
183
  metadata: {}
199
- post_install_message:
200
184
  rdoc_options: []
201
185
  require_paths:
202
186
  - lib
@@ -204,18 +188,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
188
  requirements:
205
189
  - - ">="
206
190
  - !ruby/object:Gem::Version
207
- version: 2.5.8
191
+ version: '2.7'
208
192
  required_rubygems_version: !ruby/object:Gem::Requirement
209
193
  requirements:
210
194
  - - ">="
211
195
  - !ruby/object:Gem::Version
212
196
  version: '0'
213
197
  requirements: []
214
- rubygems_version: 3.4.20
215
- signing_key:
198
+ rubygems_version: 3.6.7
216
199
  specification_version: 4
217
200
  summary: OvirtMetrics is an ActiveRecord-based gem for reading the oVirt History database.
218
201
  test_files:
202
+ - ".rspec"
219
203
  - spec/models/host_samples_history_spec.rb
220
204
  - spec/models/vm_disk_samples_history_spec.rb
221
205
  - spec/models/vm_samples_history_spec.rb
@@ -225,4 +209,3 @@ test_files:
225
209
  - spec/schemas/schema_rhev40.rb
226
210
  - spec/spec_helper.rb
227
211
  - spec/support/active_record.rb
228
- - ".rspec"