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 +4 -4
 - data/.github/workflows/release.yml +1 -1
 - data/.github/workflows/test.yml +1 -1
 - data/.rubocop.yml +1 -1
 - data/Appraisals +5 -0
 - data/CHANGELOG.md +6 -0
 - data/Gemfile +1 -1
 - data/gemfiles/rails_7.1.gemfile +1 -1
 - data/gemfiles/rails_7.2.gemfile +1 -1
 - data/gemfiles/rails_8.0.gemfile +1 -1
 - data/gemfiles/rails_8.1.gemfile +26 -0
 - data/lib/price_hubble/configuration.rb +40 -2
 - data/lib/price_hubble/version.rb +1 -1
 - data/lib/price_hubble.rb +2 -1
 - data/pricehubble.gemspec +1 -1
 - metadata +6 -5
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f9efa889dd5ba50585f840c63123cca87ae54fdf1730d730d1e63406c6272250
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7290470461e267bbbc0d427b0cbbb79daf87e3b8e12746e0fd05a97289b252ee
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7512e734fc788465d8f61cd36d71fe50686f4f855e8de0be3ea996c0866668fd9594162c09d75bbc3155542d879378f74d1d37fb797a6dfebb1c8a2f4c02d870
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b8a638e5ac5f70ceeb56b25ba2a63a77a41880990a6503553e37eebf32f69e13467307114a57e2bd082e41d78c0c6e4488d3d3b2115bf01362a20f797c321387
         
     | 
    
        data/.github/workflows/test.yml
    CHANGED
    
    
    
        data/.rubocop.yml
    CHANGED
    
    
    
        data/Appraisals
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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'
         
     | 
    
        data/gemfiles/rails_7.1.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_7.2.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_8.0.gemfile
    CHANGED
    
    
| 
         @@ -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 
     | 
    
         
            -
                 
     | 
| 
      
 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) }
         
     | 
    
        data/lib/price_hubble/version.rb
    CHANGED
    
    
    
        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/ 
     | 
| 
      
 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', ' 
     | 
| 
      
 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. 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 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
         
     |