rom-repository 5.1.2 → 5.2.1

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: 83427b52cf7ed58c4b99b81a6ca94864811b60c0535b65cac6ccb73fe66f217e
4
- data.tar.gz: 2e8a88c1afe03a2a3544a2ef4c3cb9519b5fd9ade3cc1339b905eddf743fec7f
3
+ metadata.gz: d9dd018e536140066d8d0f38ef7de6f0699727c49c8441e282edf673781a6a1c
4
+ data.tar.gz: 66bc8bae27bdaa51d9a2cccf0266f4351d04692050cbb493e0babac1a7017874
5
5
  SHA512:
6
- metadata.gz: c0fa0ef473e8855130dcba3fb34d6be7afd79e15f87e9abc1807a4a07f2c837c80e4374c6b5cb01aa28e8920958d809bdcaa2b8f3560bdcf3cce02b037853517
7
- data.tar.gz: 55a2278520f13ff789652a8983b0895ae18ebecffa1a0bd55b96a4a16b4fcea2c3a63c760ae073813fe9062998f86be6ec088f71f95510e089d4cb822b1b1c7a
6
+ metadata.gz: 022bc16aab756a1e11e74a9c665534e1bc30fab8cd9227d6a43bcad9b96f05a9fff912196ebe4cef1307c32953b2b58cb3640299acae516a935126593d95783b
7
+ data.tar.gz: 4fca6bea5d7affe2f17c0a0dd5f56a1138769d5e5df2af4fa222e1de4d050b389de0cab946a2d3480b857c3d69f520f1b8347bd6dd9c724797a11b328e6e5a2d
@@ -111,6 +111,7 @@ module ROM
111
111
  super
112
112
  @relations = {}
113
113
  end
114
+ ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true)
114
115
 
115
116
  # Open a database transaction
116
117
  #
@@ -153,7 +154,7 @@ module ROM
153
154
  # @!visibility private
154
155
  #
155
156
  # @api public
156
- def session(&block)
157
+ def session
157
158
  session = Session.new(self)
158
159
  yield(session)
159
160
  transaction { session.commit! }
@@ -59,7 +59,7 @@ module ROM
59
59
  include(relation_reader)
60
60
  end
61
61
 
62
- super(options.merge(container: container))
62
+ super(**options, container: container)
63
63
  end
64
64
 
65
65
  # Inherits configured relations and commands
@@ -70,7 +70,7 @@ module ROM
70
70
 
71
71
  return if self === Repository
72
72
 
73
- klass.extend(Dry::Core::Cache)
73
+ klass.extend(::Dry::Core::Cache)
74
74
  klass.commands(*commands)
75
75
  end
76
76
 
@@ -105,7 +105,7 @@ module ROM
105
105
  @commands.each do |spec|
106
106
  type, *view = Array(spec).flatten
107
107
 
108
- if view.size > 0
108
+ if !view.empty?
109
109
  define_restricted_command_method(type, view, mapper: mapper, use: use, plugins_options: plugins_options)
110
110
  else
111
111
  define_command_method(type, mapper: mapper, use: use, plugins_options: plugins_options)
@@ -117,8 +117,8 @@ module ROM
117
117
  end
118
118
 
119
119
  # @api public
120
- def use(plugin, options = EMPTY_HASH)
121
- ROM.plugin_registry[:repository].fetch(plugin).apply_to(self, options)
120
+ def use(plugin, **options)
121
+ ROM.plugin_registry[:repository].fetch(plugin).apply_to(self, **options)
122
122
  end
123
123
 
124
124
  private
@@ -142,8 +142,8 @@ module ROM
142
142
  define_method(meth_name) do |*args|
143
143
  arity = root.__send__(view_name).arity
144
144
 
145
- view_args = args[0..arity-1]
146
- input = args[arity..args.size-1]
145
+ view_args = args[0..arity - 1]
146
+ input = args[arity..args.size - 1]
147
147
 
148
148
  changeset = input.first
149
149
 
@@ -13,10 +13,10 @@ module ROM
13
13
  module InstanceMethods
14
14
  # @api private
15
15
  def set_relation(name)
16
- container.
17
- relations[name].
18
- with(auto_struct: auto_struct).
19
- struct_namespace(struct_namespace)
16
+ container
17
+ .relations[name]
18
+ .with(auto_struct: auto_struct)
19
+ .struct_namespace(struct_namespace)
20
20
  end
21
21
  end
22
22
 
@@ -62,6 +62,7 @@ module ROM
62
62
  super
63
63
  @root = set_relation(self.class.root)
64
64
  end
65
+ ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true)
65
66
  end
66
67
  end
67
68
  end
@@ -32,7 +32,7 @@ module ROM
32
32
  @status = :success
33
33
 
34
34
  self
35
- rescue => e
35
+ rescue StandardError => e
36
36
  @status = :failure
37
37
  raise e
38
38
  ensure
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ROM
4
4
  class Repository
5
- VERSION = '5.1.2'
5
+ VERSION = '5.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-repository
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-17 00:00:00.000000000 Z
11
+ date: 2020-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-initializer
@@ -50,20 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '5.1'
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 5.1.2
53
+ version: '5.2'
57
54
  type: :runtime
58
55
  prerelease: false
59
56
  version_requirements: !ruby/object:Gem::Requirement
60
57
  requirements:
61
58
  - - "~>"
62
59
  - !ruby/object:Gem::Version
63
- version: '5.1'
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 5.1.2
60
+ version: '5.2'
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: rake
69
63
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
125
  - !ruby/object:Gem::Version
132
126
  version: '0'
133
127
  requirements: []
134
- rubygems_version: 3.0.3
128
+ rubygems_version: 3.1.0.pre3
135
129
  signing_key:
136
130
  specification_version: 4
137
131
  summary: Repository abstraction for rom-rb