pricehubble 1.3.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -2
- data/.rubocop.yml +1 -1
- data/Appraisals +0 -5
- data/CHANGELOG.md +8 -0
- data/lib/price_hubble/{entity/base_entity.rb → base_entity.rb} +5 -5
- data/lib/price_hubble/entity/concern/associations.rb +1 -1
- data/lib/price_hubble/entity/concern/attributes/date_array.rb +1 -1
- data/lib/price_hubble/entity/concern/attributes/enum.rb +1 -1
- data/lib/price_hubble/entity/concern/attributes/range.rb +1 -1
- data/lib/price_hubble/entity/concern/attributes/string_inquirer.rb +1 -1
- data/lib/price_hubble/entity/concern/attributes.rb +1 -1
- data/lib/price_hubble/entity/concern/callbacks.rb +1 -1
- data/lib/price_hubble/entity/concern/client.rb +1 -1
- data/lib/price_hubble/entity/concern/persistence.rb +1 -1
- data/lib/price_hubble/utils/bangers.rb +6 -9
- data/lib/price_hubble/version.rb +1 -1
- data/lib/price_hubble.rb +25 -80
- data/pricehubble.gemspec +3 -2
- metadata +23 -10
- data/gemfiles/rails_5.2.gemfile +0 -26
- /data/lib/price_hubble/{errors.rb → initializers/errors.rb} +0 -0
- /data/lib/price_hubble/{faraday.rb → initializers/faraday.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9721bb7bde0466664e06c6669668eb4bfe18afbcd922b3e9780cbccf7fab38c4
|
4
|
+
data.tar.gz: 96cbc3748db0776ad37c56d0cae090d4c7f181ba5357dc94fdcc05cd138f7fd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed6ada92ef2cb5a3ff5a1d715fe1aad5bc68adc9482cf5b383b6497d253552f02c42b908c48e326337886227dc616dcd3210a59e70da3591d5bbb18242a7174c
|
7
|
+
data.tar.gz: 17461520b2a3631e0706da2c6b5355ee5fe6c9f0d2228eee4497f6ac068780431f9c5da0585f1862227c4cd86e6b562f19a7e4a1bbcd3a4d9db9c14d878e23c1
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
* TODO: Replace this bullet point with an actual description of a change.
|
4
4
|
|
5
|
+
### 1.5.0 (12 January 2025)
|
6
|
+
|
7
|
+
* Switched to Zeitwerk as autoloader (#12)
|
8
|
+
|
9
|
+
### 1.4.0 (3 January 2025)
|
10
|
+
|
11
|
+
* Raised minimum supported Ruby/Rails version to 2.7/6.1 (#11)
|
12
|
+
|
5
13
|
### 1.3.0 (4 October 2024)
|
6
14
|
|
7
15
|
* Upgraded the `recursive-open-struct` gem to `~> 2.0` (#10)
|
@@ -13,11 +13,11 @@ module PriceHubble
|
|
13
13
|
include PriceHubble::Utils::Bangers
|
14
14
|
end
|
15
15
|
|
16
|
-
include
|
17
|
-
include
|
18
|
-
include
|
19
|
-
include
|
20
|
-
include
|
16
|
+
include Concern::Callbacks
|
17
|
+
include Concern::Attributes
|
18
|
+
include Concern::Associations
|
19
|
+
include Concern::Client
|
20
|
+
include Concern::Persistence
|
21
21
|
|
22
22
|
# We collect all unknown attributes instead of raising while creating a new
|
23
23
|
# instance. The unknown attributes are wrapped inside a
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module PriceHubble
|
4
|
-
module
|
4
|
+
module Concern
|
5
5
|
# An ActiveRecord-like attribute management feature, with the exception
|
6
6
|
# that the attributes are not generated through a schema file, but are
|
7
7
|
# defined inline the entity class.
|
@@ -22,17 +22,14 @@ module PriceHubble
|
|
22
22
|
raise NoMethodError, "#{self}##{meth} does not exit" \
|
23
23
|
unless instance_methods(false).include? meth
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
if instance_method(meth).arity.zero?
|
26
|
+
raise ArgumentError,
|
27
|
+
"#{self}##{meth} does not accept arguments"
|
28
|
+
end
|
27
29
|
|
28
30
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
29
|
-
def #{meth}!(*args)
|
30
|
-
|
31
|
-
args.last.merge!(bang: true)
|
32
|
-
else
|
33
|
-
args.push({ bang: true })
|
34
|
-
end
|
35
|
-
#{meth}(*args)
|
31
|
+
def #{meth}!(*args, **kwargs, &block)
|
32
|
+
#{meth}(*args, **kwargs, bang: true, &block)
|
36
33
|
end
|
37
34
|
RUBY
|
38
35
|
end
|
data/lib/price_hubble/version.rb
CHANGED
data/lib/price_hubble.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'zeitwerk'
|
3
4
|
require 'active_support'
|
4
5
|
require 'active_support/concern'
|
5
6
|
require 'active_support/configurable'
|
@@ -14,100 +15,44 @@ require 'recursive-open-struct'
|
|
14
15
|
require 'faraday'
|
15
16
|
require 'faraday_middleware'
|
16
17
|
|
17
|
-
# Load polyfills if needed
|
18
|
-
require 'price_hubble/core_ext/hash'
|
19
|
-
|
20
18
|
# The top level namespace for the PriceHubble gem.
|
21
19
|
module PriceHubble
|
22
|
-
#
|
23
|
-
|
24
|
-
autoload :ConfigurationHandling, 'price_hubble/configuration_handling'
|
25
|
-
autoload :Client, 'price_hubble/client'
|
26
|
-
autoload :Identity, 'price_hubble/identity'
|
27
|
-
autoload :Instrumentation, 'price_hubble/instrumentation'
|
28
|
-
|
29
|
-
# Entities
|
30
|
-
autoload :BaseEntity, 'price_hubble/entity/base_entity'
|
31
|
-
autoload :Authentication, 'price_hubble/entity/authentication'
|
32
|
-
autoload :Valuation, 'price_hubble/entity/valuation'
|
33
|
-
autoload :ValuationScores, 'price_hubble/entity/valuation_scores'
|
34
|
-
autoload :ValuationRequest, 'price_hubble/entity/valuation_request'
|
35
|
-
autoload :Property, 'price_hubble/entity/property'
|
36
|
-
autoload :PropertyConditions, 'price_hubble/entity/property_conditions'
|
37
|
-
autoload :PropertyQualities, 'price_hubble/entity/property_qualities'
|
38
|
-
autoload :PropertyType, 'price_hubble/entity/property_type'
|
39
|
-
autoload :Location, 'price_hubble/entity/location'
|
40
|
-
autoload :Address, 'price_hubble/entity/address'
|
41
|
-
autoload :Coordinates, 'price_hubble/entity/coordinates'
|
42
|
-
autoload :Dossier, 'price_hubble/entity/dossier'
|
43
|
-
|
44
|
-
# Some general purpose utilities
|
45
|
-
module Utils
|
46
|
-
autoload :Decision, 'price_hubble/utils/decision'
|
47
|
-
autoload :Bangers, 'price_hubble/utils/bangers'
|
48
|
-
end
|
49
|
-
|
50
|
-
# Instrumentation
|
51
|
-
module Instrumentation
|
52
|
-
autoload :LogSubscriber, 'price_hubble/instrumentation/log_subscriber'
|
53
|
-
end
|
54
|
-
|
55
|
-
# Dedicated application HTTP (low level) client
|
56
|
-
module Client
|
57
|
-
# All our utilities used for the low level client
|
58
|
-
module Utils
|
59
|
-
autoload :Request, 'price_hubble/client/utils/request'
|
60
|
-
autoload :Response, 'price_hubble/client/utils/response'
|
61
|
-
end
|
20
|
+
# Configure the relative gem code base location
|
21
|
+
root_path = Pathname.new("#{__dir__}/price_hubble")
|
62
22
|
|
63
|
-
|
64
|
-
|
65
|
-
autoload :DataSanitization,
|
66
|
-
'price_hubble/client/request/data_sanitization'
|
67
|
-
autoload :DefaultHeaders, 'price_hubble/client/request/default_headers'
|
68
|
-
end
|
23
|
+
# Setup a Zeitwerk autoloader instance and configure it
|
24
|
+
loader = Zeitwerk::Loader.for_gem
|
69
25
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
'price_hubble/client/response/recursive_open_struct'
|
76
|
-
end
|
26
|
+
# Do not auto load some parts of the gem
|
27
|
+
loader.ignore("#{__dir__}/pricehubble*")
|
28
|
+
loader.ignore(root_path.join('core_ext'))
|
29
|
+
loader.ignore(root_path.join('initializers*'))
|
30
|
+
loader.ignore(root_path.join('railtie.rb'))
|
77
31
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
end
|
32
|
+
# Entity definitions, based on core functionalities,
|
33
|
+
# all entities are directly located at the namespace root,
|
34
|
+
# together with their shared concerns
|
35
|
+
loader.push_dir(root_path.join('entity'), namespace: PriceHubble)
|
83
36
|
|
84
|
-
#
|
85
|
-
|
86
|
-
autoload :Callbacks, 'price_hubble/entity/concern/callbacks'
|
87
|
-
autoload :Attributes, 'price_hubble/entity/concern/attributes'
|
88
|
-
autoload :Associations, 'price_hubble/entity/concern/associations'
|
89
|
-
autoload :Client, 'price_hubble/entity/concern/client'
|
90
|
-
autoload :Persistence, 'price_hubble/entity/concern/persistence'
|
91
|
-
|
92
|
-
# Some custom typed attribute helpers
|
93
|
-
module Attributes
|
94
|
-
base = 'price_hubble/entity/concern/attributes'
|
95
|
-
autoload :DateArray, "#{base}/date_array"
|
96
|
-
autoload :Enum, "#{base}/enum"
|
97
|
-
autoload :Range, "#{base}/range"
|
98
|
-
autoload :StringInquirer, "#{base}/string_inquirer"
|
99
|
-
end
|
100
|
-
end
|
37
|
+
# Finish the auto loader configuration
|
38
|
+
loader.setup
|
101
39
|
|
102
40
|
# Load standalone code
|
103
41
|
require 'price_hubble/version'
|
104
|
-
require 'price_hubble/errors'
|
105
|
-
require 'price_hubble/faraday'
|
106
42
|
require 'price_hubble/railtie' if defined? Rails
|
107
43
|
|
44
|
+
# Load all core extension of the gem
|
45
|
+
Dir[root_path.join('core_ext/**/*.rb')].sort.each { |path| require path }
|
46
|
+
|
47
|
+
# Load all initializers of the gem
|
48
|
+
Dir[root_path.join('initializers/**/*.rb')].sort.each { |path| require path }
|
49
|
+
|
108
50
|
# Include top-level features
|
109
51
|
include PriceHubble::ConfigurationHandling
|
110
52
|
include PriceHubble::Client
|
111
53
|
include PriceHubble::Identity
|
112
54
|
include PriceHubble::Instrumentation
|
55
|
+
|
56
|
+
# Make sure to eager load all constants
|
57
|
+
loader.eager_load
|
113
58
|
end
|
data/pricehubble.gemspec
CHANGED
@@ -33,9 +33,10 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
spec.required_ruby_version = '>= 2.7'
|
35
35
|
|
36
|
-
spec.add_dependency 'activemodel', '>=
|
37
|
-
spec.add_dependency 'activesupport', '>=
|
36
|
+
spec.add_dependency 'activemodel', '>= 6.1'
|
37
|
+
spec.add_dependency 'activesupport', '>= 6.1'
|
38
38
|
spec.add_dependency 'faraday', '~> 1.0'
|
39
39
|
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
40
40
|
spec.add_dependency 'recursive-open-struct', '~> 2.0'
|
41
|
+
spec.add_dependency 'zeitwerk', '~> 2.6'
|
41
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pricehubble
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hermann Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
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: '
|
26
|
+
version: '6.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
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: '
|
40
|
+
version: '6.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: faraday
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: zeitwerk
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.6'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.6'
|
83
97
|
description: Ruby client for the PriceHubble REST API
|
84
98
|
email:
|
85
99
|
- hermann.mayer92@gmail.com
|
@@ -120,10 +134,10 @@ files:
|
|
120
134
|
- doc/examples/property_valuations_errors.rb
|
121
135
|
- doc/examples/simple_property_valuations.rb
|
122
136
|
- docker-compose.yml
|
123
|
-
- gemfiles/rails_5.2.gemfile
|
124
137
|
- gemfiles/rails_6.1.gemfile
|
125
138
|
- gemfiles/rails_7.1.gemfile
|
126
139
|
- lib/price_hubble.rb
|
140
|
+
- lib/price_hubble/base_entity.rb
|
127
141
|
- lib/price_hubble/client.rb
|
128
142
|
- lib/price_hubble/client/authentication.rb
|
129
143
|
- lib/price_hubble/client/base.rb
|
@@ -140,7 +154,6 @@ files:
|
|
140
154
|
- lib/price_hubble/core_ext/hash.rb
|
141
155
|
- lib/price_hubble/entity/address.rb
|
142
156
|
- lib/price_hubble/entity/authentication.rb
|
143
|
-
- lib/price_hubble/entity/base_entity.rb
|
144
157
|
- lib/price_hubble/entity/concern/associations.rb
|
145
158
|
- lib/price_hubble/entity/concern/attributes.rb
|
146
159
|
- lib/price_hubble/entity/concern/attributes/date_array.rb
|
@@ -160,9 +173,9 @@ files:
|
|
160
173
|
- lib/price_hubble/entity/valuation.rb
|
161
174
|
- lib/price_hubble/entity/valuation_request.rb
|
162
175
|
- lib/price_hubble/entity/valuation_scores.rb
|
163
|
-
- lib/price_hubble/errors.rb
|
164
|
-
- lib/price_hubble/faraday.rb
|
165
176
|
- lib/price_hubble/identity.rb
|
177
|
+
- lib/price_hubble/initializers/errors.rb
|
178
|
+
- lib/price_hubble/initializers/faraday.rb
|
166
179
|
- lib/price_hubble/instrumentation.rb
|
167
180
|
- lib/price_hubble/instrumentation/log_subscriber.rb
|
168
181
|
- lib/price_hubble/railtie.rb
|
data/gemfiles/rails_5.2.gemfile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal", "~> 2.4"
|
6
|
-
gem "bundler", "~> 2.3"
|
7
|
-
gem "countless", "~> 1.1"
|
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", "~> 1.28"
|
14
|
-
gem "rubocop-rails", "~> 2.14"
|
15
|
-
gem "rubocop-rspec", "~> 2.10"
|
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", "~> 5.2.0"
|
24
|
-
gem "activesupport", "~> 5.2.0"
|
25
|
-
|
26
|
-
gemspec path: "../"
|
File without changes
|
File without changes
|