rom-rails 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/README.md +7 -4
- data/db +1 -1
- data/lib/rom/rails/configuration.rb +4 -0
- data/lib/rom/rails/railtie.rb +17 -4
- data/lib/rom/rails/version.rb +1 -1
- data/log +1 -1
- data/rom-rails.gemspec +6 -0
- data/spec/dummy/config/initializers/rom.rb +1 -0
- data/spec/dummy/lib/namespaced_app/persistence/commands/create_additional_task.rb +11 -0
- data/spec/integration/initializer_spec.rb +6 -1
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aab84f6f3a0272e4e3745bace374ef628da306e77ab9c339b28bb320d8ff61dc
|
4
|
+
data.tar.gz: b2b0d450245b3405fad0b2cec2f513032f65fb294c2a47819cc2d503eb986de4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8432e4d4a4f9a9ed2c4da5ae7ba7e95d46d79e424796aedee2fda45fdd2c7b61a4f23203d03a848869e65fe665a8ed9736c8b031515b8103d23710291312dd3b
|
7
|
+
data.tar.gz: abe4967268a5f14621db4c24390c87bebdc1be02baaa1396d361e31c03863a3afd5295760d33697ad6c2dfc681aef02be90c509ad1dcd73f5763629b0ce9064f
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.4.0, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct)
|
data/README.md
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
[gem]: https://rubygems.org/gems/rom-rails
|
2
2
|
[actions]: https://github.com/rom-rb/rom-rails/actions
|
3
3
|
[codeclimate]: https://codeclimate.com/github/rom-rb/rom-rails
|
4
|
+
[codeacy]: https://www.codacy.com/gh/rom-rb/rom-rails
|
4
5
|
[coveralls]: https://coveralls.io/r/rom-rb/rom-rails
|
5
6
|
[inchpages]: http://inch-ci.org/github/rom-rb/rom-rails
|
6
7
|
|
7
|
-
# rom-rails
|
8
|
+
# rom-rails [![Join the chat at https://rom-rb.zulipchat.com](https://img.shields.io/badge/rom--rb-join%20chat-942283.svg)][chat]
|
8
9
|
|
9
10
|
[![Gem Version](https://badge.fury.io/rb/rom-rails.svg)][gem]
|
10
11
|
[![CI Status](https://github.com/rom-rb/rom-rails/workflows/ci/badge.svg)][actions]
|
11
12
|
[![Code Climate](https://codeclimate.com/github/rom-rb/rom-rails/badges/gpa.svg)][codeclimate]
|
13
|
+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/81d5362ea6314dd09432fb238d79f481)][codeacy]
|
12
14
|
[![Test Coverage](https://codeclimate.com/github/rom-rb/rom-rails/badges/coverage.svg)][codeclimate]
|
13
15
|
[![Inline docs](http://inch-ci.org/github/rom-rb/rom-rails.svg?branch=master)][inchpages]
|
14
16
|
|
@@ -16,9 +18,9 @@ Rails integration for [Ruby Object Mapper](https://github.com/rom-rb/rom) which
|
|
16
18
|
ships with:
|
17
19
|
|
18
20
|
* Relation generators
|
21
|
+
* Repository generators
|
19
22
|
* Mapper generators
|
20
23
|
* Command generators
|
21
|
-
* Repository generators
|
22
24
|
|
23
25
|
## Tests
|
24
26
|
|
@@ -37,8 +39,9 @@ You can read more about ROM and Rails on the official website:
|
|
37
39
|
|
38
40
|
## Community
|
39
41
|
|
40
|
-
* [
|
41
|
-
* [Discussion Forum](https://
|
42
|
+
* [Offical ROM blog](https://rom-rb.org/blog)
|
43
|
+
* [Discussion Forum](https://discourse.rom-rb.org)
|
44
|
+
* [Chat](https://rom-rb.zulipchat.com)
|
42
45
|
|
43
46
|
## License
|
44
47
|
|
data/db
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
spec/dummy/db
|
data/lib/rom/rails/railtie.rb
CHANGED
@@ -30,7 +30,7 @@ module ROM
|
|
30
30
|
initializer 'rom.adjust_eager_load_paths' do |app|
|
31
31
|
paths =
|
32
32
|
auto_registration_paths.inject([]) do |result, root_path|
|
33
|
-
result.concat(COMPONENT_DIRS.map { |dir| ::Rails.root.join(root_path, dir).to_s })
|
33
|
+
result.concat(COMPONENT_DIRS.map { |dir| ::Rails.root.join(root_path.is_a?(Hash) ? root_path[:path] : root_path, dir).to_s })
|
34
34
|
end
|
35
35
|
|
36
36
|
app.config.eager_load_paths -= paths
|
@@ -40,9 +40,18 @@ module ROM
|
|
40
40
|
load "rom/rails/tasks/db.rake" unless active_record?
|
41
41
|
end
|
42
42
|
|
43
|
+
# Load ROM-related application code on startup
|
44
|
+
config.after_initialize do
|
45
|
+
if !::Rails.application.config.rom.reload_on_each_request
|
46
|
+
ROM.env = Railtie.create_container
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
43
50
|
# Reload ROM-related application code on each request.
|
44
|
-
config.to_prepare do |
|
45
|
-
|
51
|
+
config.to_prepare do |prepare_conf|
|
52
|
+
if ::Rails.application.config.rom.reload_on_each_request
|
53
|
+
ROM.env = Railtie.create_container
|
54
|
+
end
|
46
55
|
end
|
47
56
|
|
48
57
|
console do |_app|
|
@@ -78,7 +87,11 @@ module ROM
|
|
78
87
|
configuration = create_configuration
|
79
88
|
|
80
89
|
auto_registration_paths.each do |root_path|
|
81
|
-
|
90
|
+
if root_path.is_a? Hash
|
91
|
+
configuration.auto_registration(::Rails.root.join(root_path[:path]), namespace: root_path[:namespace])
|
92
|
+
else
|
93
|
+
configuration.auto_registration(::Rails.root.join(root_path), namespace: false)
|
94
|
+
end
|
82
95
|
end
|
83
96
|
|
84
97
|
ROM.container(configuration)
|
data/lib/rom/rails/version.rb
CHANGED
data/log
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
spec/dummy/log
|
data/rom-rails.gemspec
CHANGED
@@ -16,6 +16,12 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
+
spec.metadata = {
|
20
|
+
"bug_tracker_uri" => "https://github.com/rom-rb/rom-rails/issues",
|
21
|
+
"changelog_uri" => "https://github.com/rom-rb/rom-rails/blob/master/CHANGELOG.md",
|
22
|
+
"source_code_uri" => "https://github.com/rom-rb/rom-rails",
|
23
|
+
}
|
24
|
+
|
19
25
|
spec.add_runtime_dependency 'addressable', '~> 2.3'
|
20
26
|
spec.add_runtime_dependency 'dry-core', '~> 0.4'
|
21
27
|
spec.add_runtime_dependency 'dry-equalizer', '~> 0.2'
|
@@ -4,4 +4,5 @@ ROM::Rails::Railtie.configure do |config|
|
|
4
4
|
config.gateways[:sql] = [:sql, "#{scheme}://#{Rails.root}/db/#{Rails.env}.sqlite3"]
|
5
5
|
config.gateways[:default] = [:test_adapter, foo: :bar]
|
6
6
|
config.auto_registration_paths += [Rails.root.join('lib', 'additional_app', 'persistence')]
|
7
|
+
config.auto_registration_paths += [{path: Rails.root.join('lib', 'namespaced_app', 'persistence'), namespace: 'NamespacedApp::Persistence'}]
|
7
8
|
end
|
@@ -7,7 +7,12 @@ RSpec.describe 'ROM initializer' do
|
|
7
7
|
expect(rom.relations.dummy).to eql(relation)
|
8
8
|
end
|
9
9
|
|
10
|
-
it 'loads commands from
|
10
|
+
it 'loads commands from additional auto_registration_paths' do
|
11
11
|
expect(rom.commands.tasks.create_additional).to be_a(CreateAdditionalTask)
|
12
12
|
end
|
13
|
+
|
14
|
+
it 'allows namespace configuration on autoload paths' do
|
15
|
+
puts rom.commands.tasks.elements
|
16
|
+
expect(rom.commands.tasks.namespaced_additional).to be_a(NamespacedApp::Persistence::Commands::CreateAdditionalTask)
|
17
|
+
end
|
13
18
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Flipse
|
8
8
|
- Piotr Solnica
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|
@@ -143,7 +143,7 @@ dependencies:
|
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0.50'
|
146
|
-
description:
|
146
|
+
description:
|
147
147
|
email:
|
148
148
|
- cflipse@gmail.com
|
149
149
|
- piotr.solnica@gmail.com
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- ".rspec"
|
162
162
|
- ".rubocop.yml"
|
163
163
|
- CHANGELOG.md
|
164
|
+
- CODE_OF_CONDUCT.md
|
164
165
|
- CONTRIBUTING.md
|
165
166
|
- Gemfile
|
166
167
|
- LICENSE
|
@@ -243,6 +244,7 @@ files:
|
|
243
244
|
- spec/dummy/db/migrate/20150403194906_create_tags.rb
|
244
245
|
- spec/dummy/lib/additional_app/persistence/commands/create_additional_task.rb
|
245
246
|
- spec/dummy/lib/assets/.keep
|
247
|
+
- spec/dummy/lib/namespaced_app/persistence/commands/create_additional_task.rb
|
246
248
|
- spec/dummy/lib/rom/test_adapter.rb
|
247
249
|
- spec/dummy/lib/tasks/.keep
|
248
250
|
- spec/dummy/log/.keep
|
@@ -270,8 +272,11 @@ files:
|
|
270
272
|
homepage: http://rom-rb.org
|
271
273
|
licenses:
|
272
274
|
- MIT
|
273
|
-
metadata:
|
274
|
-
|
275
|
+
metadata:
|
276
|
+
bug_tracker_uri: https://github.com/rom-rb/rom-rails/issues
|
277
|
+
changelog_uri: https://github.com/rom-rb/rom-rails/blob/master/CHANGELOG.md
|
278
|
+
source_code_uri: https://github.com/rom-rb/rom-rails
|
279
|
+
post_install_message:
|
275
280
|
rdoc_options: []
|
276
281
|
require_paths:
|
277
282
|
- lib
|
@@ -286,8 +291,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
291
|
- !ruby/object:Gem::Version
|
287
292
|
version: '0'
|
288
293
|
requirements: []
|
289
|
-
rubygems_version: 3.
|
290
|
-
signing_key:
|
294
|
+
rubygems_version: 3.2.32
|
295
|
+
signing_key:
|
291
296
|
specification_version: 4
|
292
297
|
summary: Integrate Ruby Object Mapper with Rails
|
293
298
|
test_files:
|
@@ -340,6 +345,7 @@ test_files:
|
|
340
345
|
- spec/dummy/db/migrate/20150403194906_create_tags.rb
|
341
346
|
- spec/dummy/lib/additional_app/persistence/commands/create_additional_task.rb
|
342
347
|
- spec/dummy/lib/assets/.keep
|
348
|
+
- spec/dummy/lib/namespaced_app/persistence/commands/create_additional_task.rb
|
343
349
|
- spec/dummy/lib/rom/test_adapter.rb
|
344
350
|
- spec/dummy/lib/tasks/.keep
|
345
351
|
- spec/dummy/log/.keep
|