luna_park 0.13.1 → 0.13.3
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/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/luna_park/extensions/callable.rb +4 -4
- data/lib/luna_park/extensions/comparable.rb +28 -0
- data/lib/luna_park/extensions/comparable_debug.rb +0 -28
- data/lib/luna_park/extensions/repositories/postgres/read.rb +1 -1
- data/lib/luna_park/extensions/repositories/postgres/update.rb +1 -1
- data/lib/luna_park/extensions/wrappable.rb +1 -1
- data/lib/luna_park/notifiers/log.rb +1 -1
- data/lib/luna_park/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3d2e8740ca57654ad7cfbd190f89e59c70b34d82aa6f5748d1d41333198eb76
|
4
|
+
data.tar.gz: a9734bf6a2de9d3ece0c176484676d154045028488aa9db3bab2dee7b69f7762
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 361f2c83f82a9602679a4a837a66b67c0fbedc8d3abc170b127d3ab72c9e05a5c09c0e0af7567603ee689cb7d73b9c34f0a0c4dc25eb496b0668843c0254943a
|
7
|
+
data.tar.gz: 33b902c851f2d4bd691f566950dab4a64a3cc54cd31632b98f873d8acc1d5ac45fff2d9d62598e7e90e564b7b678efd5c35265e1f78cb194b11123fb448e7491
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.13.3] - 2025-03-31
|
8
|
+
Added
|
9
|
+
- `Extensions::Comparable#detailed_differences` method moved from `Extensions::ComparableDebug`
|
10
|
+
|
11
|
+
## [0.13.2] - 2023-12-25
|
12
|
+
Added
|
13
|
+
- Ruby 3 compatibility (still compatible with ruby 2.5)
|
14
|
+
|
7
15
|
## [0.13.1] - 2023-12-06
|
8
16
|
Changed
|
9
17
|
- `Extensions::Repositories::Postgres::Delete` returns boolean
|
data/Gemfile.lock
CHANGED
@@ -30,14 +30,14 @@ module LunaPark
|
|
30
30
|
# MyCallableObject.call!(params) # => 'call! used'
|
31
31
|
module Callable
|
32
32
|
# Preferred class method to run instance `call` method
|
33
|
-
def call(*args)
|
34
|
-
new(*args).call
|
33
|
+
def call(*args, **kwargs)
|
34
|
+
new(*args, **kwargs).call
|
35
35
|
end
|
36
36
|
|
37
37
|
##
|
38
38
|
# Preferred class method to run instance `call`! method
|
39
|
-
def call!(*args)
|
40
|
-
new(*args).call!
|
39
|
+
def call!(*args, **kwargs)
|
40
|
+
new(*args, **kwargs).call!
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -76,6 +76,34 @@ module LunaPark
|
|
76
76
|
|
77
77
|
alias == eql?
|
78
78
|
|
79
|
+
##
|
80
|
+
# Returns only different values, that causes missmatch
|
81
|
+
#
|
82
|
+
# @example
|
83
|
+
# t1 = Funds.new(from: { charge: { currency: 'USD', amount: 42 } }, usd: { currency: 'USD', amount: 41 }, comment: 'Foo')
|
84
|
+
# t2 = Funds.new(from: { charge: { currency: 'USD', amount: 43 } }, usd: { currency: 'USD', amount: 42 }, comment: 'Foo')
|
85
|
+
#
|
86
|
+
# t1 == t2 # => false
|
87
|
+
#
|
88
|
+
# t1.detailed_diff(t2) # =>
|
89
|
+
# { from: { charge: { amount: [42, 43] } }, usd: { amount: [41, 42] } }
|
90
|
+
def detailed_differences(other)
|
91
|
+
self.class.comparable_attributes_list.each_with_object({}) do |field, output|
|
92
|
+
left = send(field)
|
93
|
+
right = other&.send(field)
|
94
|
+
|
95
|
+
next if left == right
|
96
|
+
|
97
|
+
output[field] = if left.respond_to?(:detailed_differences)
|
98
|
+
left.detailed_differences(right)
|
99
|
+
else
|
100
|
+
[left, right]
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
alias detailed_diff detailed_differences
|
106
|
+
|
79
107
|
##
|
80
108
|
# Enable debug mode (just include debug methods)
|
81
109
|
def enable_debug
|
@@ -63,34 +63,6 @@ module LunaPark
|
|
63
63
|
end
|
64
64
|
|
65
65
|
alias detailed_cmp detailed_comparsion
|
66
|
-
|
67
|
-
##
|
68
|
-
# Returns only different values, that causes missmatch
|
69
|
-
#
|
70
|
-
# @example
|
71
|
-
# t1 = Funds.new(from: { charge: { currency: 'USD', amount: 42 } }, usd: { currency: 'USD', amount: 41 }, comment: 'Foo')
|
72
|
-
# t2 = Funds.new(from: { charge: { currency: 'USD', amount: 43 } }, usd: { currency: 'USD', amount: 42 }, comment: 'Foo')
|
73
|
-
#
|
74
|
-
# t1 == t2 # => false
|
75
|
-
#
|
76
|
-
# t1.detailed_diff(t2) # =>
|
77
|
-
# { from: { charge: { amount: [42, 43] } }, usd: { amount: [41, 42] } }
|
78
|
-
def detailed_differences(other)
|
79
|
-
self.class.comparable_attributes_list.each_with_object({}) do |field, output|
|
80
|
-
left = send(field)
|
81
|
-
right = other&.send(field)
|
82
|
-
|
83
|
-
next if left == right
|
84
|
-
|
85
|
-
output[field] = if left.respond_to?(:detailed_differences)
|
86
|
-
left.detailed_differences(right)
|
87
|
-
else
|
88
|
-
[left, right]
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
alias detailed_diff detailed_differences
|
94
66
|
end
|
95
67
|
end
|
96
68
|
end
|
@@ -27,7 +27,7 @@ module LunaPark
|
|
27
27
|
|
28
28
|
def reload!(entity, **scope)
|
29
29
|
new_rows = scoped(**scope).where(primary_key => entity.public_send(primary_key))
|
30
|
-
found! new_rows, not_found_by: { primary_key => entity.public_send(primary_key)}
|
30
|
+
found! new_rows, not_found_by: { primary_key => entity.public_send(primary_key) }
|
31
31
|
|
32
32
|
new_attrs = from_row __one_from__ new_rows
|
33
33
|
entity.set_attributes(new_attrs)
|
@@ -80,7 +80,7 @@ module LunaPark
|
|
80
80
|
# @param [Hash] details - Any another details for current message
|
81
81
|
def post(msg, lvl: :error, **details)
|
82
82
|
severity = severity(lvl)
|
83
|
-
message = serialize(msg, details)
|
83
|
+
message = serialize(msg, **details)
|
84
84
|
logger.add severity, message
|
85
85
|
end
|
86
86
|
|
data/lib/luna_park/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luna_park
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kudrin
|
8
8
|
- Philip Sorokin
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bugsnag
|
@@ -319,7 +319,7 @@ dependencies:
|
|
319
319
|
- - "~>"
|
320
320
|
- !ruby/object:Gem::Version
|
321
321
|
version: '0.9'
|
322
|
-
description:
|
322
|
+
description:
|
323
323
|
email:
|
324
324
|
- kudrin.alexander@gmail.com
|
325
325
|
executables: []
|
@@ -458,7 +458,7 @@ licenses:
|
|
458
458
|
- MIT
|
459
459
|
metadata:
|
460
460
|
yard.run: yri
|
461
|
-
post_install_message:
|
461
|
+
post_install_message:
|
462
462
|
rdoc_options: []
|
463
463
|
require_paths:
|
464
464
|
- lib
|
@@ -473,9 +473,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
473
473
|
- !ruby/object:Gem::Version
|
474
474
|
version: '0'
|
475
475
|
requirements: []
|
476
|
-
rubyforge_project:
|
476
|
+
rubyforge_project:
|
477
477
|
rubygems_version: 2.7.6.3
|
478
|
-
signing_key:
|
478
|
+
signing_key:
|
479
479
|
specification_version: 4
|
480
480
|
summary: Domain driven oriented microservice framework.
|
481
481
|
test_files: []
|