rom-changeset 5.3.0 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7e1da660a6ec7a0f8668013df049f51b632c3611f6990948a393a282f8b0970
4
- data.tar.gz: 8f4ff7902b50320eb1cbfe1bf4a8095ae6289ebb1fe62a3678112a60e3838514
3
+ metadata.gz: 73941151ab589fd80e2f349694426b73635ff681387cd678b9b2122e0c06d24a
4
+ data.tar.gz: 1e272f155fe1617f88f2206e9ee4b673d8780c851e4fc9615f89b8a10e209f13
5
5
  SHA512:
6
- metadata.gz: e8c8114f23b1bb24f04c963be84bca79fbcd686b37f462b3174d3e1c4f6bae6ea8a5d807ae6599e5dbbe6d9d40092cffc11d86f402af6fced6d4d21b0d80a496
7
- data.tar.gz: 8bb8ef006df6205797fb436dcef8d5580fb3e9f78478bbfff189e98aaf71c9742541ecba7211152d387ae0627bac2be014107cdabef1b139ea1ea4e171dbd93e
6
+ metadata.gz: '09b80246997d59a8ce86ee87aa7c781102f9160d6ce49f9f21d2aff7cd5a5bb88b3981006a997d9454766b5611ac6c5111fdccc0dd3dc0876e0376212b2bfcd5'
7
+ data.tar.gz: 3eee18aee1e68b06292173d265bdcf96717ff9bc66daae001e60ae0ed4ec2c9c5edc1b41d5ffe9d936e7dc243d9ea218a3e3822c4d8e31f54b55285f06935ce0
@@ -11,14 +11,16 @@ module ROM
11
11
  # Changeset extenions for combined relations
12
12
  #
13
13
  # @api public
14
- class Relation::Graph
15
- # Build a changeset for a combined relation
16
- #
17
- # @raise NotImplementedError
18
- #
19
- # @api public
20
- def changeset(*)
21
- raise NotImplementedError, "Changeset doesn't support combined relations yet"
14
+ module Relation
15
+ class Graph
16
+ # Build a changeset for a combined relation
17
+ #
18
+ # @raise NotImplementedError
19
+ #
20
+ # @api public
21
+ def changeset(*)
22
+ raise NotImplementedError, "Changeset doesn't support combined relations yet"
23
+ end
22
24
  end
23
25
  end
24
26
  end
@@ -73,9 +73,9 @@ module ROM
73
73
  # @return [Array<Pipe>, Transproc::Function>]
74
74
  #
75
75
  # @api public
76
- def self.extend(*, &block)
77
- if block
78
- map(use_for_diff: false, &block)
76
+ def self.extend(*, &)
77
+ if block_given?
78
+ map(use_for_diff: false, &)
79
79
  else
80
80
  super
81
81
  end
@@ -87,7 +87,7 @@ module ROM
87
87
  #
88
88
  # @return [Pipe]
89
89
  def self.default_pipe(context)
90
- !pipes.empty? ? pipes.map { |p| p.bind(context) }.reduce(:>>) : EMPTY_PIPE
90
+ pipes.empty? ? EMPTY_PIPE : pipes.map { |p| p.bind(context) }.reduce(:>>)
91
91
  end
92
92
 
93
93
  # @api private
@@ -131,8 +131,8 @@ module ROM
131
131
  # @return [Changeset]
132
132
  #
133
133
  # @api public
134
- def map(*steps, &block)
135
- extend(*steps, for_diff: true, &block)
134
+ def map(*steps, &)
135
+ extend(*steps, for_diff: true, &)
136
136
  end
137
137
 
138
138
  # Pipe changeset's data using custom steps define on the pipe.
@@ -148,12 +148,12 @@ module ROM
148
148
  # @return [Changeset]
149
149
  #
150
150
  # @api public
151
- def extend(*steps, **options, &block)
152
- if block
153
- if !steps.empty?
154
- extend(*steps, **options).extend(**options, &block)
151
+ def extend(*steps, **options, &)
152
+ if block_given?
153
+ if steps.empty?
154
+ with(pipe: pipe.compose(Pipe.new(proc(&)).bind(self), **options))
155
155
  else
156
- with(pipe: pipe.compose(Pipe.new(block).bind(self), **options))
156
+ extend(*steps, **options).extend(**options, &)
157
157
  end
158
158
  else
159
159
  with(pipe: steps.reduce(pipe.with(**options)) { |a, e| a.compose(pipe[e], **options) })
@@ -266,9 +266,9 @@ module ROM
266
266
  end
267
267
 
268
268
  # @api private
269
- def method_missing(meth, *args, &block)
269
+ def method_missing(meth, ...)
270
270
  if __data__.respond_to?(meth)
271
- response = __data__.__send__(meth, *args, &block)
271
+ response = __data__.__send__(meth, ...)
272
272
 
273
273
  if response.is_a?(__data__.class)
274
274
  with(__data__: response)
@@ -279,7 +279,6 @@ module ROM
279
279
  super
280
280
  end
281
281
  end
282
- ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
283
282
  end
284
283
  end
285
284
  end
@@ -62,6 +62,8 @@ module ROM
62
62
  # @return [Hash]
63
63
  #
64
64
  # @api public
65
+ #
66
+ # rubocop:disable Metrics/AbcSize
65
67
  def diff
66
68
  @diff ||=
67
69
  begin
@@ -73,9 +75,10 @@ module ROM
73
75
  new_tuple = data_tuple.to_a.select { |k, _| data_keys.include?(k) }
74
76
  ori_tuple = source.to_a.select { |k, _| data_keys.include?(k) }
75
77
 
76
- Hash[new_tuple - (new_tuple & ori_tuple)]
78
+ (new_tuple - (new_tuple & ori_tuple)).to_h
77
79
  end
78
80
  end
81
+ # rubocop:enable Metrics/AbcSize
79
82
  end
80
83
  end
81
84
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ROM
4
4
  class Changeset
5
- VERSION = '5.3.0'
5
+ VERSION = '5.4.0'
6
6
  end
7
7
  end
@@ -94,7 +94,8 @@ module ROM
94
94
  end
95
95
  rescue KeyError
96
96
  raise ArgumentError,
97
- "+#{type.inspect}+ is not a valid changeset type. Must be one of: #{TYPES.keys.inspect}"
97
+ "+#{type.inspect}+ is not a valid changeset type. " \
98
+ "Must be one of: #{TYPES.keys.inspect}"
98
99
  end
99
100
  end
100
101
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-changeset
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-11-11 00:00:00.000000000 Z
10
+ date: 2025-01-08 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: dry-core
@@ -30,62 +29,28 @@ dependencies:
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '5.3'
32
+ version: '5.4'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '5.3'
39
+ version: '5.4'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: transproc
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '1.0'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 1.1.0
46
+ version: '1.1'
51
47
  type: :runtime
52
48
  prerelease: false
53
49
  version_requirements: !ruby/object:Gem::Requirement
54
50
  requirements:
55
51
  - - "~>"
56
52
  - !ruby/object:Gem::Version
57
- version: '1.0'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 1.1.0
61
- - !ruby/object:Gem::Dependency
62
- name: rake
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '11.2'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '11.2'
75
- - !ruby/object:Gem::Dependency
76
- name: rspec
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '3.5'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '3.5'
53
+ version: '1.1'
89
54
  description: rom-changeset adds support for preprocessing data on top of rom-rb repositories
90
55
  email: piotr.solnica+oss@gmail.com
91
56
  executables: []
@@ -115,7 +80,7 @@ metadata:
115
80
  documentation_uri: https://api.rom-rb.org/rom/
116
81
  mailing_list_uri: https://discourse.rom-rb.org/
117
82
  bug_tracker_uri: https://github.com/rom-rb/rom/issues
118
- post_install_message:
83
+ rubygems_mfa_required: 'true'
119
84
  rdoc_options: []
120
85
  require_paths:
121
86
  - lib
@@ -130,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
95
  - !ruby/object:Gem::Version
131
96
  version: '0'
132
97
  requirements: []
133
- rubygems_version: 3.3.7
134
- signing_key:
98
+ rubygems_version: 3.6.2
135
99
  specification_version: 4
136
100
  summary: Changeset abstraction for rom-rb
137
101
  test_files: []