pricehubble 2.0.0 → 2.1.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: e12e3ce1637a743dce1c0db1b9a0c13c3faaa19eefb4c0369118367a99997e1c
4
- data.tar.gz: c1009963ea544928d0092ff4caa3ff54d95c2e09bdc267b230828d6f695f490e
3
+ metadata.gz: f9efa889dd5ba50585f840c63123cca87ae54fdf1730d730d1e63406c6272250
4
+ data.tar.gz: 7290470461e267bbbc0d427b0cbbb79daf87e3b8e12746e0fd05a97289b252ee
5
5
  SHA512:
6
- metadata.gz: b825555adae6693476690e54b0dc6294658b7cd6131e7f693590e00cadae7ac2762cc5efe5278613d64633ef3c1a76d2b4d0a5b5088a11752624d62f0da78e9f
7
- data.tar.gz: '0718a3de09245165dba6672ba13135dcc720dfde401b96eaaf5cd000bf5033600143c30464ec86933c4f50e7db20cfaa00defef91fbe1664fba7741c514ce6c5'
6
+ metadata.gz: 7512e734fc788465d8f61cd36d71fe50686f4f855e8de0be3ea996c0866668fd9594162c09d75bbc3155542d879378f74d1d37fb797a6dfebb1c8a2f4c02d870
7
+ data.tar.gz: b8a638e5ac5f70ceeb56b25ba2a63a77a41880990a6503553e37eebf32f69e13467307114a57e2bd082e41d78c0c6e4488d3d3b2115bf01362a20f797c321387
@@ -16,7 +16,7 @@ jobs:
16
16
  docs:
17
17
  name: Release the gem
18
18
  runs-on: ubuntu-22.04
19
- timeout-minutes: 5
19
+ timeout-minutes: 10
20
20
  steps:
21
21
  - uses: actions/checkout@v4
22
22
 
@@ -19,7 +19,7 @@ jobs:
19
19
  fail-fast: false
20
20
  matrix:
21
21
  ruby: ['3.2', '3.3', '3.4']
22
- rails: ['7.1', '7.2', '8.0']
22
+ rails: ['7.1', '7.2', '8.0', '8.1']
23
23
  env:
24
24
  BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
25
25
  steps:
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ AllCops:
13
13
  SuggestExtensions: false
14
14
  DisplayCopNames: true
15
15
  TargetRubyVersion: 3.2
16
- TargetRailsVersion: 6.1
16
+ TargetRailsVersion: 7.1
17
17
  Exclude:
18
18
  - bin/**/*
19
19
  - vendor/**/*
data/Appraisals CHANGED
@@ -14,3 +14,8 @@ appraise 'rails-8.0' do
14
14
  gem 'activemodel', '~> 8.0.0'
15
15
  gem 'activesupport', '~> 8.0.0'
16
16
  end
17
+
18
+ appraise 'rails-8.1' do
19
+ gem 'activemodel', '~> 8.1.0'
20
+ gem 'activesupport', '~> 8.1.0'
21
+ end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 2.1.0 (23 October 2025)
6
+
7
+ * Added support for Rails 8.1 ([#19](https://github.com/hausgold/pricehubble/pull/19))
8
+ * Switched from `ActiveSupport::Configurable` to a custom implementation based
9
+ on `ActiveSupport::OrderedOptions` ([#20](https://github.com/hausgold/pricehubble/pull/20))
10
+
5
11
  ### 2.0.0 (28 June 2025)
6
12
 
7
13
  * Corrected some RuboCop glitches ([#17](https://github.com/hausgold/pricehubble/pull/17))
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ gemspec
10
10
  # Development dependencies
11
11
  gem 'appraisal', '~> 2.4'
12
12
  gem 'bundler', '~> 2.6'
13
- gem 'countless', '~> 2.0'
13
+ gem 'countless', '~> 2.2'
14
14
  # TODO: Remove the upper lock when
15
15
  # https://github.com/thoughtbot/factory_bot/issues/1614 is solved.
16
16
  gem 'factory_bot', '~> 6.2', '< 6.4.5'
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot", "~> 6.2", "< 6.4.5"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "rake", "~> 13.0"
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot", "~> 6.2", "< 6.4.5"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "rake", "~> 13.0"
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot", "~> 6.2", "< 6.4.5"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "rake", "~> 13.0"
@@ -0,0 +1,26 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.4"
6
+ gem "bundler", "~> 2.6"
7
+ gem "countless", "~> 2.2"
8
+ gem "factory_bot", "~> 6.2", "< 6.4.5"
9
+ gem "guard-rspec", "~> 4.7"
10
+ gem "rake", "~> 13.0"
11
+ gem "redcarpet", "~> 3.5"
12
+ gem "rspec", "~> 3.12"
13
+ gem "rubocop"
14
+ gem "rubocop-rails"
15
+ gem "rubocop-rspec"
16
+ gem "simplecov", ">= 0.22"
17
+ gem "terminal-table", "~> 3.0"
18
+ gem "timecop", ">= 0.9.6"
19
+ gem "vcr", "~> 6.0"
20
+ gem "webmock", "~> 3.18"
21
+ gem "yard", ">= 0.9.28"
22
+ gem "yard-activesupport-concern", ">= 0.0.1"
23
+ gem "activemodel", "~> 8.1.0"
24
+ gem "activesupport", "~> 8.1.0"
25
+
26
+ gemspec path: "../"
@@ -2,8 +2,46 @@
2
2
 
3
3
  module PriceHubble
4
4
  # The configuration for the pricehubble gem.
5
- class Configuration
6
- include ActiveSupport::Configurable
5
+ class Configuration < ActiveSupport::OrderedOptions
6
+ # Track our configurations settings (+Symbol+ keys) and their defaults as
7
+ # lazy-loaded +Proc+'s values
8
+ class_attribute :defaults,
9
+ instance_reader: true,
10
+ instance_writer: false,
11
+ instance_predicate: false,
12
+ default: {}
13
+
14
+ # Create a new +Configuration+ instance with all settings populated with
15
+ # their respective defaults.
16
+ #
17
+ # @param args [Hash{Symbol => Mixed}] additional settings which
18
+ # overwrite the defaults
19
+ # @return [Configuration] the new configuration instance
20
+ def initialize(**args)
21
+ super()
22
+ defaults.each { |key, default| self[key] = instance_exec(&default) }
23
+ merge!(**args)
24
+ end
25
+
26
+ # A simple DSL method to define new configuration accessors/settings with
27
+ # their defaults. The defaults can be retrieved with
28
+ # +Configuration.defaults+ or +Configuration.new.defaults+.
29
+ #
30
+ # @param name [Symbol, String] the name of the configuration
31
+ # accessor/setting
32
+ # @param default [Mixed, nil] a non-lazy-loaded static value, serving as a
33
+ # default value for the setting
34
+ # @param block [Proc] when given, the default value will be lazy-loaded
35
+ # (result of the Proc)
36
+ def self.config_accessor(name, default = nil, &block)
37
+ # Save the given configuration accessor default value
38
+ defaults[name.to_sym] = block || -> { default }
39
+
40
+ # Compile reader/writer methods so we don't have to go through
41
+ # +ActiveSupport::OrderedOptions#method_missing+.
42
+ define_method(name) { self[name] }
43
+ define_method("#{name}=") { |value| self[name] = value }
44
+ end
7
45
 
8
46
  # Configure the API authentication credentials
9
47
  config_accessor(:username) { ENV.fetch('PRICEHUBBLE_USERNAME', nil) }
@@ -3,7 +3,7 @@
3
3
  # The gem version details.
4
4
  module PriceHubble
5
5
  # The version of the +price-hubble+ gem
6
- VERSION = '2.0.0'
6
+ VERSION = '2.1.0'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
data/lib/price_hubble.rb CHANGED
@@ -4,9 +4,10 @@ require 'zeitwerk'
4
4
  require 'logger'
5
5
  require 'active_support'
6
6
  require 'active_support/concern'
7
- require 'active_support/configurable'
7
+ require 'active_support/ordered_options'
8
8
  require 'active_support/time'
9
9
  require 'active_support/time_with_zone'
10
+ require 'active_support/core_ext/class/attribute'
10
11
  require 'active_support/core_ext/object'
11
12
  require 'active_support/core_ext/module'
12
13
  require 'active_support/core_ext/hash'
data/pricehubble.gemspec CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_dependency 'activesupport', '>= 7.1'
38
38
  spec.add_dependency 'faraday', '~> 1.0'
39
39
  spec.add_dependency 'faraday_middleware', '~> 1.0'
40
- spec.add_dependency 'mutex_m', '~> 0.3.0'
40
+ spec.add_dependency 'mutex_m', '>= 0.3'
41
41
  spec.add_dependency 'recursive-open-struct', '~> 2.0'
42
42
  spec.add_dependency 'zeitwerk', '~> 2.6'
43
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pricehubble
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
@@ -69,16 +69,16 @@ dependencies:
69
69
  name: mutex_m
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 0.3.0
74
+ version: '0.3'
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: 0.3.0
81
+ version: '0.3'
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: recursive-open-struct
84
84
  requirement: !ruby/object:Gem::Requirement
@@ -151,6 +151,7 @@ files:
151
151
  - gemfiles/rails_7.1.gemfile
152
152
  - gemfiles/rails_7.2.gemfile
153
153
  - gemfiles/rails_8.0.gemfile
154
+ - gemfiles/rails_8.1.gemfile
154
155
  - lib/price_hubble.rb
155
156
  - lib/price_hubble/base_entity.rb
156
157
  - lib/price_hubble/client.rb