From 5f4fb5b35b54c7ef518d41b585eb3c5453ded8b6 Mon Sep 17 00:00:00 2001 From: RemoteCTO <768254+RemoteCTO@users.noreply.github.com> Date: Sun, 10 Nov 2024 15:41:38 +0000 Subject: [PATCH] Explicitly add ostruct gem dependency Force root namespace for OpenStruct Explicit requires of openstruct --- Gemfile.lock | 4 +++- Gemfile.scenic.lock | 8 +++++--- lib/timescaledb/connection.rb | 1 + lib/timescaledb/hypertable.rb | 2 ++ lib/timescaledb/version.rb | 2 +- spec/timescaledb/connection_spec.rb | 2 ++ timescaledb.gemspec | 1 + 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 41de332..22cac8e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,10 @@ PATH remote: . specs: - timescaledb (0.3.0) + timescaledb (0.3.1) activerecord activesupport + ostruct pg (~> 1.2) GEM @@ -32,6 +33,7 @@ GEM concurrent-ruby (~> 1.0) method_source (1.0.0) minitest (5.18.0) + ostruct (0.6.1) pg (1.5.8) pry (0.14.2) coderay (~> 1.1) diff --git a/Gemfile.scenic.lock b/Gemfile.scenic.lock index 443b68c..3760260 100644 --- a/Gemfile.scenic.lock +++ b/Gemfile.scenic.lock @@ -1,9 +1,10 @@ PATH remote: . specs: - timescaledb (0.2.8) + timescaledb (0.3.1) activerecord activesupport + ostruct pg (~> 1.2) GEM @@ -56,7 +57,8 @@ GEM nokogiri (1.12.5) mini_portile2 (~> 2.6.1) racc (~> 1.4) - pg (1.5.6) + ostruct (0.6.1) + pg (1.5.9) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) @@ -116,4 +118,4 @@ DEPENDENCIES timescaledb! BUNDLED WITH - 2.2.33 + 2.3.7 diff --git a/lib/timescaledb/connection.rb b/lib/timescaledb/connection.rb index 6a23cef..575383b 100644 --- a/lib/timescaledb/connection.rb +++ b/lib/timescaledb/connection.rb @@ -1,4 +1,5 @@ require 'singleton' +require 'ostruct' module Timescaledb # Minimal connection setup for Timescaledb directly with the PG. diff --git a/lib/timescaledb/hypertable.rb b/lib/timescaledb/hypertable.rb index ad540b5..48a84d1 100644 --- a/lib/timescaledb/hypertable.rb +++ b/lib/timescaledb/hypertable.rb @@ -1,3 +1,5 @@ +require 'ostruct' + module Timescaledb class Hypertable < ::Timescaledb::ApplicationRecord self.table_name = "timescaledb_information.hypertables" diff --git a/lib/timescaledb/version.rb b/lib/timescaledb/version.rb index 526085c..157ca5d 100644 --- a/lib/timescaledb/version.rb +++ b/lib/timescaledb/version.rb @@ -1,3 +1,3 @@ module Timescaledb - VERSION = '0.3.0' + VERSION = '0.3.1' end diff --git a/spec/timescaledb/connection_spec.rb b/spec/timescaledb/connection_spec.rb index 333e32c..82a5a66 100644 --- a/spec/timescaledb/connection_spec.rb +++ b/spec/timescaledb/connection_spec.rb @@ -1,3 +1,5 @@ +require 'ostruct' + RSpec.describe Timescaledb do describe '.establish_connection' do it 'returns a PG::Connection object' do diff --git a/timescaledb.gemspec b/timescaledb.gemspec index 645c1f4..c6956c3 100644 --- a/timescaledb.gemspec +++ b/timescaledb.gemspec @@ -28,6 +28,7 @@ Gem::Specification.new do |spec| spec.add_dependency "pg", "~> 1.2" spec.add_dependency "activerecord" spec.add_dependency "activesupport" + spec.add_dependency "ostruct" spec.add_development_dependency "pry" spec.add_development_dependency "rspec-its"