n1_loader 1.7.2 → 1.7.3

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: 61980f2b94429810da38a914db9e3779385a86cf0fbe95773311b19a2551c5a3
4
- data.tar.gz: 8817ef5434d16ba5eb13deec0a78110fae07b9def1256e6b1d163deb02ed5a05
3
+ metadata.gz: 69bd23d2b22a8c7fccab4ca436c23079961fe20d5eb9eb5c9d5f9d6e9cfe6ab2
4
+ data.tar.gz: 8c7d60b0cb94207339ea697dc977d9669a5af9931b745bce889257535aaed109
5
5
  SHA512:
6
- metadata.gz: b78afcfdc23c584456a3e5daef5c8f18f102bafffffbb06640275afdd9ee2e65368384d29d2dd77f0a5c991a4c281d808086bc1648da38a304eac743b3265fcd
7
- data.tar.gz: 26795d6614b90f868a6aaec760180e0270a4726c5ce0e1f88fc04b97cfc751a8627a8d94efc27d2443d82cc145207759b595afe3383a4f8a38cacc8af75d4b3f
6
+ metadata.gz: 340851e05310b0cfb05c9b8acd412d4bb1d06747e61e311008bd217bfead1aef6cc123bd3ca333a6bca025d0a367b2b0b4f589899438455cd9702ac6d79012c8
7
+ data.tar.gz: bdf43c35be906b011170d053ed050a60b7491087e10afde229510a10293df1d64e32a2a04d8c304611ae8a417c05568f7deda51a91b81b68820390a47dd824e7
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module N1Loader
4
- VERSION = "1.7.2"
4
+ VERSION = "1.7.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: n1_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: 1.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
@@ -143,39 +143,6 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".github/workflows/rubocop.yml"
147
- - ".github/workflows/tests.yml"
148
- - ".gitignore"
149
- - ".rspec"
150
- - ".rubocop.yml"
151
- - CHANGELOG.md
152
- - CODE_OF_CONDUCT.md
153
- - Gemfile
154
- - LICENSE.txt
155
- - README.md
156
- - Rakefile
157
- - activerecord-gemfiles/ar_5_latest.gemfile
158
- - activerecord-gemfiles/ar_6_latest.gemfile
159
- - activerecord-gemfiles/ar_7_latest.gemfile
160
- - ar_lazy_preload-gemfiles/ar_lazy_preload_0.6.1.gemfile
161
- - ar_lazy_preload-gemfiles/ar_lazy_preload_master.gemfile
162
- - bin/console
163
- - bin/setup
164
- - examples/active_record_integration.rb
165
- - examples/ar_lazy_integration.rb
166
- - examples/ar_lazy_integration_with_isolated_loader.rb
167
- - examples/arguments_support.rb
168
- - examples/context/service.rb
169
- - examples/context/setup_ar_lazy.rb
170
- - examples/context/setup_database.rb
171
- - examples/core.rb
172
- - examples/graphql.rb
173
- - examples/isolated_loader.rb
174
- - examples/lazy_loading.rb
175
- - examples/reloading.rb
176
- - examples/shared_loader.rb
177
- - examples/single_case.rb
178
- - guides/enhanced-activerecord.md
179
146
  - lib/n1_loader.rb
180
147
  - lib/n1_loader/active_record.rb
181
148
  - lib/n1_loader/active_record/associations_preloader_v5.rb
@@ -199,7 +166,6 @@ files:
199
166
  - lib/n1_loader/core/loader_collection.rb
200
167
  - lib/n1_loader/core/preloader.rb
201
168
  - lib/n1_loader/version.rb
202
- - n1_loader.gemspec
203
169
  homepage: https://github.com/djezzzl/n1_loader
204
170
  licenses:
205
171
  - MIT
@@ -1,24 +0,0 @@
1
- name: Rubocop
2
-
3
- on:
4
- pull_request:
5
- schedule:
6
- - cron: '0 0 * * 0'
7
-
8
- jobs:
9
- rubocop:
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - uses: actions/checkout@v3
14
-
15
- - name: Set up Ruby
16
- uses: ruby/setup-ruby@v1
17
- with:
18
- ruby-version: 2.7
19
-
20
- - name: Install dependencies
21
- run: bundle install
22
-
23
- - name: Run Rubocop
24
- run: bundle exec rubocop
@@ -1,66 +0,0 @@
1
- name: RSpec tests
2
-
3
- on:
4
- pull_request:
5
- schedule:
6
- - cron: '0 0 * * 0'
7
-
8
- jobs:
9
- tests:
10
- runs-on: ubuntu-latest
11
-
12
- strategy:
13
- matrix:
14
- ruby-version:
15
- - '2.7'
16
- - '3.0'
17
- - 'head'
18
- activerecord-gemfile:
19
- - 'ar_5_latest'
20
- - 'ar_6_latest'
21
- - 'ar_7_latest'
22
- ar_lazy_preload-gemfile:
23
- - 'ar_lazy_preload_0.6.1'
24
- - 'ar_lazy_preload_master'
25
- exclude:
26
- - ruby-version: 'head'
27
- activerecord-gemfile: 'ar_5_latest'
28
-
29
- - ruby-version: 'head'
30
- activerecord-gemfile: 'ar_5_latest'
31
-
32
- - ruby-version: '3.0'
33
- activerecord-gemfile: 'ar_5_latest'
34
-
35
- - ruby-version: '3.0'
36
- activerecord-gemfile: 'ar_5_latest'
37
-
38
- - activerecord-gemfile: 'ar_7_latest'
39
- ar_lazy_preload-gemfile: 'ar_lazy_preload_0.6.1'
40
-
41
- - activerecord-gemfile: 'ar_5_latest'
42
- ar_lazy_preload-gemfile: 'ar_lazy_preload_master'
43
-
44
- env:
45
- ACTIVERECORD_GEMFILE: ${{ matrix.activerecord-gemfile }}
46
- AR_LAZY_PRELOAD_GEMFILE: ${{ matrix.ar_lazy_preload-gemfile }}
47
-
48
- steps:
49
- - uses: actions/checkout@v3
50
-
51
- - name: Set up Ruby ${{ matrix.ruby-version }}
52
- uses: ruby/setup-ruby@v1
53
- with:
54
- ruby-version: ${{ matrix.ruby-version }}
55
-
56
- - name: Install dependencies
57
- run: bundle install
58
-
59
- - name: Run Core tests
60
- run: bundle exec rspec spec/n1_loader_spec.rb
61
-
62
- - name: Run ActiveRecord tests
63
- run: bundle exec rspec spec/n1_loader_spec.rb spec/activerecord_spec.rb
64
-
65
- - name: Run ArLazyPreload tests
66
- run: bundle exec rspec spec/n1_loader_spec.rb spec/activerecord_spec.rb spec/ar_lazy_preload_spec.rb
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- /.idea
10
- .rspec_status
11
- Gemfile.lock
12
- .ruby-version
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,20 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.5
3
- Exclude:
4
- - examples/**/*
5
- - vendor/bundle/**/*
6
-
7
- Style/StringLiterals:
8
- Enabled: true
9
- EnforcedStyle: double_quotes
10
-
11
- Style/StringLiteralsInInterpolation:
12
- Enabled: true
13
- EnforcedStyle: double_quotes
14
-
15
- Layout/LineLength:
16
- Max: 120
17
-
18
- Metrics/BlockLength:
19
- Exclude:
20
- - spec/**/*
data/CHANGELOG.md DELETED
@@ -1,133 +0,0 @@
1
- ## [1.7.2] - 2023/08/04
2
-
3
- - Refactor core that ended up with speed boost.
4
-
5
- ## [1.7.1] - 2023/07/30
6
-
7
- - Fix interface discrepancy for `N1LoaderReflection`. Thanks [Denis Talakevich](https://github.com/senid231) for suggesting it!
8
-
9
- ## [1.7.0] - 2023/07/30
10
-
11
- Extend the flexibility of loading data comparison. Thanks [Nazar Matus](https://github.com/FunkyloverOne) for suggesting it!
12
-
13
- **BREAKING CHANGES:**
14
-
15
- Loose comparison of loaded data. Before loaded data was initialized with identity comparator in mind:
16
-
17
- ```ruby
18
- @loaded = {}.compare_by_identity
19
- ```
20
-
21
- Now it will be:
22
-
23
- ```ruby
24
- @loaded = {}
25
- ```
26
-
27
- This might bring unwanted results for cases when strict comparison was wanted.
28
-
29
- On the other hand, it gives more flexibility for many other cases, especially with isolated loader.
30
- For example, this will work now, when it wasn't working before.
31
-
32
- ```ruby
33
- # ActiveRecord object
34
- object = Entity.first
35
-
36
- # Initialize isolated loader
37
- instance = loader.new([object])
38
-
39
- # This was working before because the loaded object is identical to passed object by `#object_id`
40
- instance.for(object)
41
-
42
- # This wasn't working before because the loaded object is not identical to passed one by `#object_id`
43
- #
44
- # But it will be working now, because object == Entity.find(object.id)
45
- instance.for(Entity.find(object.id))
46
- ```
47
-
48
- If you need strict comparison support, please feel free to open the issue or the PR.
49
-
50
- ## [1.6.6] - 2023/07/30
51
-
52
- - Fix naive check of required arguments. Thanks [Nazar Matus](https://github.com/FunkyloverOne) for the issue!
53
-
54
- ## [1.6.5] - 2023/07/30
55
-
56
- - Fix nested preloading for ActiveRecord 7. Thanks [Igor Gonchar](https://github.com/gigorok) for the issue!
57
-
58
- ## [1.6.4] - 2023/07/30
59
-
60
- - Add support of `n1_optimized` ending with `?` (question mark). Thanks [Ilya Kamenko](https://github.com/Galathius) for the suggestion!
61
-
62
- ## [1.6.3] - 2022/12/30
63
-
64
- - Performance optimization: avoid unnecessary calls. Thanks [Nazar Matus](https://github.com/FunkyloverOne) for the [contribution](https://github.com/djezzzl/n1_loader/pull/33).
65
-
66
- ## [1.6.2] - 2022/11/23
67
-
68
- - Add fund metadata
69
-
70
- ## [1.6.1] - 2022/10/29
71
-
72
- - Fix ArLazyPreload context setup when using isolated loaders for objects without the context.
73
-
74
- ## [1.6.0] - 2022/10/24
75
-
76
- - Add support of ArLazyPreload context for isolated loaders.
77
-
78
- ## [1.5.1] - 2022/09/20
79
-
80
- - Fix support of falsey value of arguments. Thanks [Aitor Lopez Beltran](https://github.com/aitorlb) for the [contribution](https://github.com/djezzzl/n1_loader/pull/23)!
81
-
82
- ## [1.5.0] - 2022/05/01
83
-
84
- - Add support of Rails 7
85
-
86
- ## [1.4.4] - 2022/04/29
87
-
88
- - Inject `N1Loader::Loadable` to `ActiveRecord::Base` automatically
89
- - Make `reload` to call `n1_clear_cache`
90
-
91
- ## [1.4.3] - 2022-04-13
92
-
93
- - Add `default` support to arguments
94
-
95
- ## [1.4.2] - 2022-03-01
96
-
97
- - Add n1_clear_cache method which is useful for cases like reload in ActiveRecord
98
-
99
- ## [1.4.1] - 2022-02-24
100
-
101
- - Fix preloading of invalid objects
102
-
103
- ## [1.4.0] - 2022-02-22
104
-
105
- - add support of optional arguments
106
-
107
- BREAKING CHANGES:
108
- - rework arguments to use single definition through `argument <name>` only
109
- - use keyword arguments
110
-
111
- ## [1.3.0] - 2022-02-22
112
-
113
- - add support of named arguments with `argument <name>`
114
-
115
- BREAKING CHANGES:
116
- - rename `n1_load` to `n1_optimized`
117
- - rework `def self.arguments_key` to `cache_key`
118
-
119
- ## [1.2.0] - 2022-01-14
120
-
121
- - Introduce arguments support.
122
-
123
- ## [1.1.0] - 2021-12-27
124
-
125
- - Introduce `fulfill` method to abstract the storage.
126
-
127
- ## [1.0.0] - 2021-12-26
128
-
129
- - Various of great features.
130
-
131
- ## [0.1.0] - 2021-12-16
132
-
133
- - Initial release.
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders 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, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile DELETED
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in n1_loader.gemspec
6
- gemspec
7
-
8
- # Hack to make Github work with Circle CI job names with slashes
9
- gemfiles = []
10
- gemfiles << "activerecord-gemfiles/#{ENV["ACTIVERECORD_GEMFILE"]}.gemfile" if ENV["ACTIVERECORD_GEMFILE"]
11
- gemfiles << "ar_lazy_preload-gemfiles/#{ENV["AR_LAZY_PRELOAD_GEMFILE"]}.gemfile" if ENV["AR_LAZY_PRELOAD_GEMFILE"]
12
-
13
- gemfiles.each do |path|
14
- eval(File.read(path)) # rubocop:disable Security/Eval
15
- end
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021 TODO: Write your name
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.