immoscout 2.0.0 → 2.2.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 +9 -24
- data/Appraisals +4 -0
- data/CHANGELOG.md +11 -0
- data/Envfile +1 -0
- data/Gemfile +1 -1
- data/LICENSE +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 +27 -0
- data/lib/immoscout/api/request.rb +0 -2
- data/lib/immoscout/configuration.rb +40 -2
- data/lib/immoscout/models/actions/attachment.rb +0 -8
- data/lib/immoscout/models/actions/real_estate.rb +0 -3
- data/lib/immoscout/models/concerns/propertiable.rb +0 -3
- data/lib/immoscout/models/concerns/renderable.rb +0 -12
- data/lib/immoscout/version.rb +1 -1
- data/lib/immoscout.rb +3 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b64222a9f90cd7ab67e2dd7d3720c65259089e840d65c5546917a40f96249d0
|
|
4
|
+
data.tar.gz: 15b72fdf189ebcbafb710d044fea76cdb1f61a83294008f7c68ec3bcc0d5debd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74a153dd522c08b0a0c6326cd707253612b1278ed05e5f5f84a20eee0cd0352f58b4e36cf55f52056896e0cda9dda3cfe6b82fc8ab9936151dfcb46c88e12a52
|
|
7
|
+
data.tar.gz: 1c672a2cf0e9cde9d5998b3a74a65b49e7616fa6d47325f8c28e75dc6bddedec6aa90108a88ec8f6ca4ed4ef0fe4b80e74293617c11daad1496d5df5b60c0ac0
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
inherit_from:
|
|
2
|
+
- https://potpourri.hausgold.de/config/rubocop.yml
|
|
3
|
+
- https://potpourri.hausgold.de/config/rubocop-gem.yml
|
|
4
|
+
|
|
1
5
|
plugins:
|
|
2
6
|
- rubocop-rspec
|
|
3
7
|
- rubocop-rails
|
|
@@ -5,39 +9,20 @@ plugins:
|
|
|
5
9
|
Rails:
|
|
6
10
|
Enabled: true
|
|
7
11
|
|
|
8
|
-
Style/Documentation:
|
|
9
|
-
Enabled: true
|
|
10
|
-
|
|
11
12
|
AllCops:
|
|
12
13
|
NewCops: enable
|
|
13
14
|
SuggestExtensions: false
|
|
14
15
|
DisplayCopNames: true
|
|
15
16
|
TargetRubyVersion: 3.2
|
|
16
|
-
TargetRailsVersion:
|
|
17
|
+
TargetRailsVersion: 7.1
|
|
17
18
|
Exclude:
|
|
18
19
|
- bin/**/*
|
|
19
20
|
- vendor/**/*
|
|
20
21
|
- build/**/*
|
|
21
22
|
- gemfiles/**/*
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- '*.gemspec'
|
|
27
|
-
- spec/**/*.rb
|
|
28
|
-
- '**/*.rake'
|
|
29
|
-
- doc/**/*.rb
|
|
30
|
-
|
|
31
|
-
# We stay at 80 characters per line.
|
|
32
|
-
# See: https://rubystyle.guide/#max-line-length
|
|
33
|
-
Layout/LineLength:
|
|
34
|
-
Max: 80
|
|
35
|
-
|
|
36
|
-
# MFA is not yet enabled for our gems yet.
|
|
37
|
-
Gemspec/RequireMFA:
|
|
38
|
-
Enabled: false
|
|
39
|
-
|
|
40
|
-
# We use memoized helpers all over the place to construct inputs and output
|
|
41
|
-
# which can be customized at nested contexts easily.
|
|
42
|
-
RSpec/MultipleMemoizedHelpers:
|
|
24
|
+
# Document all the things.
|
|
25
|
+
# TODO: Add missing documentations for all methods.
|
|
26
|
+
Style/DocumentationMethod:
|
|
43
27
|
Enabled: false
|
|
28
|
+
RequireForNonPublicMethods: false
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
* TODO: Replace this bullet point with an actual description of a change.
|
|
4
4
|
|
|
5
|
+
### 2.2.0 (19 December 2025)
|
|
6
|
+
|
|
7
|
+
* Migrated to a shared Rubocop configuration for HAUSGOLD gems ([#26](https://github.com/hausgold/immoscout/pull/26))
|
|
8
|
+
|
|
9
|
+
### 2.1.0 (23 October 2025)
|
|
10
|
+
|
|
11
|
+
* Dropped Reek ([#23](https://github.com/hausgold/immoscout/pull/23))
|
|
12
|
+
* Added support for Rails 8.1 ([#24](https://github.com/hausgold/immoscout/pull/24))
|
|
13
|
+
* Switched from `ActiveSupport::Configurable` to a custom implementation based
|
|
14
|
+
on `ActiveSupport::OrderedOptions` ([#25](https://github.com/hausgold/immoscout/pull/25))
|
|
15
|
+
|
|
5
16
|
### 2.0.0 (28 June 2025)
|
|
6
17
|
|
|
7
18
|
* Corrected some RuboCop glitches ([#21](https://github.com/hausgold/immoscout/pull/21))
|
data/Envfile
CHANGED
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/gemfiles/rails_7.1.gemfile
CHANGED
data/gemfiles/rails_7.2.gemfile
CHANGED
data/gemfiles/rails_8.0.gemfile
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
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"
|
|
9
|
+
gem "guard-rspec", "~> 4.7"
|
|
10
|
+
gem "railties", ">= 7.1"
|
|
11
|
+
gem "rake", "~> 13.0"
|
|
12
|
+
gem "redcarpet", "~> 3.5"
|
|
13
|
+
gem "rspec", "~> 3.12"
|
|
14
|
+
gem "rspec-json_expectations", "~> 2.2"
|
|
15
|
+
gem "rubocop"
|
|
16
|
+
gem "rubocop-rails"
|
|
17
|
+
gem "rubocop-rspec"
|
|
18
|
+
gem "simplecov", ">= 0.22"
|
|
19
|
+
gem "terminal-table", "~> 3.0"
|
|
20
|
+
gem "timecop", ">= 0.9.6"
|
|
21
|
+
gem "vcr", "~> 6.0"
|
|
22
|
+
gem "webmock", "~> 3.18"
|
|
23
|
+
gem "yard", ">= 0.9.28"
|
|
24
|
+
gem "yard-activesupport-concern", ">= 0.0.1"
|
|
25
|
+
gem "activesupport", "~> 8.1.0"
|
|
26
|
+
|
|
27
|
+
gemspec path: "../"
|
|
@@ -20,7 +20,6 @@ module Immoscout
|
|
|
20
20
|
request(:delete, path, payload, multipart)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
# rubocop:disable Metrics/MethodLength -- because of the header handling
|
|
24
23
|
def request(method, path, payload = nil, multipart = nil)
|
|
25
24
|
connection.send(method, path, multipart) do |request|
|
|
26
25
|
if multipart
|
|
@@ -34,7 +33,6 @@ module Immoscout
|
|
|
34
33
|
"RubyImmoscout/#{Immoscout::VERSION}"
|
|
35
34
|
end
|
|
36
35
|
end
|
|
37
|
-
# rubocop:enable Metrics/MethodLength
|
|
38
36
|
end
|
|
39
37
|
end
|
|
40
38
|
end
|
|
@@ -2,8 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
module Immoscout
|
|
4
4
|
# The configuration object of the +immoscout+ 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
|
config_accessor(:consumer_key) { ENV.fetch('IMMOSCOUT_CONSUMER_KEY', nil) }
|
|
9
47
|
config_accessor(:consumer_secret) do
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# rubocop:disable Metrics/BlockLength -- because this is how an ActiveSupport
|
|
4
|
-
# concern looks like
|
|
5
3
|
module Immoscout
|
|
6
4
|
module Models
|
|
7
5
|
module Actions
|
|
@@ -19,9 +17,6 @@ module Immoscout
|
|
|
19
17
|
.fetch('attachment')
|
|
20
18
|
end
|
|
21
19
|
|
|
22
|
-
# rubocop:disable Metrics/AbcSize -- because this is the bare minimum
|
|
23
|
-
# logic
|
|
24
|
-
# rubocop:disable Metrics/MethodLength -- ditto
|
|
25
20
|
def save
|
|
26
21
|
attachable_id = attachable.try(:id) || attachable
|
|
27
22
|
response = api.post(
|
|
@@ -38,8 +33,6 @@ module Immoscout
|
|
|
38
33
|
self.id = id_from_response(response)
|
|
39
34
|
self
|
|
40
35
|
end
|
|
41
|
-
# rubocop:enable Metrics/AbcSize
|
|
42
|
-
# rubocop:enable Metrics/MethodLength
|
|
43
36
|
|
|
44
37
|
def destroy
|
|
45
38
|
attachable_id = attachable.try(:id) || attachable
|
|
@@ -93,4 +86,3 @@ module Immoscout
|
|
|
93
86
|
end
|
|
94
87
|
end
|
|
95
88
|
end
|
|
96
|
-
# rubocop:enable Metrics/BlockLength
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# rubocop:disable Metrics/BlockLength -- because this is how an ActiveSupport
|
|
4
|
-
# concern looks like
|
|
5
3
|
module Immoscout
|
|
6
4
|
module Models
|
|
7
5
|
module Actions
|
|
@@ -115,4 +113,3 @@ module Immoscout
|
|
|
115
113
|
end
|
|
116
114
|
end
|
|
117
115
|
end
|
|
118
|
-
# rubocop:enable Metrics/BlockLength
|
|
@@ -13,8 +13,6 @@ module Immoscout
|
|
|
13
13
|
{}
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
# :reek:ControlParameter - standard stuff, reek!
|
|
17
|
-
# :reek:TooManyStatements
|
|
18
16
|
def method_missing(method_name, *arguments, &)
|
|
19
17
|
if method_name =~ /build_(\w+)/
|
|
20
18
|
match = Regexp.last_match(1).intern
|
|
@@ -32,7 +30,6 @@ module Immoscout
|
|
|
32
30
|
self.class.properties.keys.sort
|
|
33
31
|
end
|
|
34
32
|
|
|
35
|
-
# :reek:BooleanParameter - standard stuff, reek!
|
|
36
33
|
def respond_to_missing?(method_name, include_private = false)
|
|
37
34
|
method_name.to_s.start_with?('build_') || super
|
|
38
35
|
end
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# rubocop:disable Metrics/BlockLength -- because this is how an ActiveSupport
|
|
4
|
-
# concern looks like
|
|
5
3
|
module Immoscout
|
|
6
4
|
module Models
|
|
7
5
|
module Concerns
|
|
@@ -25,11 +23,6 @@ module Immoscout
|
|
|
25
23
|
self.class.try(:json_wrapper)
|
|
26
24
|
end
|
|
27
25
|
|
|
28
|
-
# rubocop:disable Metrics/PerceivedComplexity -- because this is the
|
|
29
|
-
# bare minimum logic
|
|
30
|
-
# rubocop:disable Metrics/MethodLength -- ditto
|
|
31
|
-
# rubocop:disable Metrics/CyclomaticComplexity -- ditto
|
|
32
|
-
# rubocop:disable Metrics/AbcSize -- ditto
|
|
33
26
|
def to_h
|
|
34
27
|
self.class.properties.each_with_object({}) do |(key, value), memo|
|
|
35
28
|
# skip if it's readonly and should not be exposed in #as_json
|
|
@@ -51,10 +44,6 @@ module Immoscout
|
|
|
51
44
|
memo
|
|
52
45
|
end
|
|
53
46
|
end
|
|
54
|
-
# rubocop:enable Metrics/PerceivedComplexity
|
|
55
|
-
# rubocop:enable Metrics/MethodLength
|
|
56
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
|
57
|
-
# rubocop:enable Metrics/AbcSize
|
|
58
47
|
|
|
59
48
|
def to_json_wrapped
|
|
60
49
|
{ self.class.try(:json_wrapper) => to_json_unwrapped }
|
|
@@ -71,4 +60,3 @@ module Immoscout
|
|
|
71
60
|
end
|
|
72
61
|
end
|
|
73
62
|
end
|
|
74
|
-
# rubocop:enable Metrics/BlockLength
|
data/lib/immoscout/version.rb
CHANGED
data/lib/immoscout.rb
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require 'zeitwerk'
|
|
4
4
|
require 'logger'
|
|
5
|
+
require 'active_support'
|
|
5
6
|
require 'active_support/concern'
|
|
6
|
-
require 'active_support/
|
|
7
|
+
require 'active_support/ordered_options'
|
|
8
|
+
require 'active_support/core_ext/class/attribute'
|
|
7
9
|
require 'active_support/core_ext/hash'
|
|
8
10
|
require 'active_support/core_ext/module'
|
|
9
11
|
require 'singleton'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: immoscout
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marcus Geissler
|
|
@@ -116,6 +116,7 @@ files:
|
|
|
116
116
|
- gemfiles/rails_7.1.gemfile
|
|
117
117
|
- gemfiles/rails_7.2.gemfile
|
|
118
118
|
- gemfiles/rails_8.0.gemfile
|
|
119
|
+
- gemfiles/rails_8.1.gemfile
|
|
119
120
|
- immoscout.gemspec
|
|
120
121
|
- lib/immoscout.rb
|
|
121
122
|
- lib/immoscout/api/client.rb
|