anonymous_loader 0.1.0 → 0.1.5

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.
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "version_gem"
4
-
5
4
  require_relative "anonymous_loader/version"
6
5
 
7
6
  # Loads Ruby source under anonymous modules to avoid top-level namespace collisions.
@@ -18,7 +17,7 @@ module AnonymousLoader
18
17
  PathRequest = Struct.new(:path, :gem_name, :require_path, :requirement, :version_file)
19
18
  # Internal load-path version lookup request.
20
19
  # @api private
21
- VersionRequest = Struct.new(:candidate, :version_file)
20
+ VersionRequest = Struct.new(:candidate, :require_path, :version_file)
22
21
 
23
22
  class << self
24
23
  # Evaluate one or more Ruby files inside a fresh anonymous module.
@@ -165,16 +164,16 @@ module AnonymousLoader
165
164
  end
166
165
 
167
166
  def resolve_versioned_load_path(candidates, request)
168
- versions = load_path_versions(candidates, request.version_file)
167
+ versions = load_path_versions(candidates, request)
169
168
  match = versions.find { |pair| request.requirement.satisfied_by?(pair.last) }
170
169
  return match.first if match
171
170
 
172
171
  raise_load_path_version_mismatch(request, versions.map(&:last))
173
172
  end
174
173
 
175
- def load_path_versions(candidates, version_file)
174
+ def load_path_versions(candidates, request)
176
175
  candidates.each_with_object([]) do |candidate, versions|
177
- version = version_for_load_path_candidate(VersionRequest.new(candidate, version_file))
176
+ version = version_for_load_path_candidate(VersionRequest.new(candidate, request.require_path, request.version_file))
178
177
  versions << [candidate, version] if version
179
178
  end
180
179
  end
@@ -219,8 +218,8 @@ module AnonymousLoader
219
218
 
220
219
  def load_path_root(request)
221
220
  candidate_dir = File.dirname(request.candidate)
222
- version_depth = request.version_file.split("/").length - 1
223
- version_depth.times { candidate_dir = File.dirname(candidate_dir) }
221
+ require_depth = request.require_path.split("/").length - 1
222
+ require_depth.times { candidate_dir = File.dirname(candidate_dir) }
224
223
  candidate_dir
225
224
  end
226
225
  end
@@ -11,4 +11,8 @@ module AnonymousLoader
11
11
  def self.load: (files: String | Array[String], ?root: String?, **untyped) -> Module
12
12
  def self.load_path: (?path: String?, ?gem_name: String?, ?require_path: String?, ?version_requirement: String | Gem::Requirement?, ?version_file: String?, **untyped) -> Module
13
13
  def self.resolve_path: (?path: String?, ?gem_name: String?, ?require_path: String?, ?version_requirement: String | Gem::Requirement?, ?version_file: String?, **untyped) -> String
14
+ module Version
15
+ VERSION: String
16
+ end
17
+ VERSION: String
14
18
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anonymous_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '1.1'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 1.1.12
49
+ version: 1.1.17
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,27 +56,27 @@ dependencies:
56
56
  version: '1.1'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 1.1.12
59
+ version: 1.1.17
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: kettle-dev
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '2.2'
66
+ version: '3.1'
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 2.2.12
69
+ version: 3.1.24
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '2.2'
76
+ version: '3.1'
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 2.2.12
79
+ version: 3.1.24
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: bundler-audit
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -131,20 +131,20 @@ dependencies:
131
131
  requirements:
132
132
  - - "~>"
133
133
  - !ruby/object:Gem::Version
134
- version: '3.1'
134
+ version: '3.2'
135
135
  - - ">="
136
136
  - !ruby/object:Gem::Version
137
- version: 3.1.2
137
+ version: 3.2.6
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '3.1'
144
+ version: '3.2'
145
145
  - - ">="
146
146
  - !ruby/object:Gem::Version
147
- version: 3.1.2
147
+ version: 3.2.6
148
148
  - !ruby/object:Gem::Dependency
149
149
  name: kettle-test
150
150
  requirement: !ruby/object:Gem::Requirement
@@ -154,7 +154,7 @@ dependencies:
154
154
  version: '2.0'
155
155
  - - ">="
156
156
  - !ruby/object:Gem::Version
157
- version: 2.0.5
157
+ version: 2.0.27
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
@@ -164,27 +164,27 @@ dependencies:
164
164
  version: '2.0'
165
165
  - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 2.0.5
167
+ version: 2.0.27
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: turbo_tests2
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: '3.1'
174
+ version: '4.0'
175
175
  - - ">="
176
176
  - !ruby/object:Gem::Version
177
- version: 3.1.4
177
+ version: 4.0.0
178
178
  type: :development
179
179
  prerelease: false
180
180
  version_requirements: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - "~>"
183
183
  - !ruby/object:Gem::Version
184
- version: '3.1'
184
+ version: '4.0'
185
185
  - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: 3.1.4
187
+ version: 4.0.0
188
188
  - !ruby/object:Gem::Dependency
189
189
  name: ruby-progressbar
190
190
  requirement: !ruby/object:Gem::Requirement
@@ -208,7 +208,7 @@ dependencies:
208
208
  version: '1.0'
209
209
  - - ">="
210
210
  - !ruby/object:Gem::Version
211
- version: 1.0.3
211
+ version: 1.0.9
212
212
  type: :development
213
213
  prerelease: false
214
214
  version_requirements: !ruby/object:Gem::Requirement
@@ -218,7 +218,7 @@ dependencies:
218
218
  version: '1.0'
219
219
  - - ">="
220
220
  - !ruby/object:Gem::Version
221
- version: 1.0.3
221
+ version: 1.0.9
222
222
  - !ruby/object:Gem::Dependency
223
223
  name: gitmoji-regex
224
224
  requirement: !ruby/object:Gem::Requirement
@@ -228,7 +228,7 @@ dependencies:
228
228
  version: '2.0'
229
229
  - - ">="
230
230
  - !ruby/object:Gem::Version
231
- version: 2.0.2
231
+ version: 2.0.15
232
232
  type: :development
233
233
  prerelease: false
234
234
  version_requirements: !ruby/object:Gem::Requirement
@@ -238,56 +238,40 @@ dependencies:
238
238
  version: '2.0'
239
239
  - - ">="
240
240
  - !ruby/object:Gem::Version
241
- version: 2.0.2
242
- description: "\U0001F48E AnonymousLoader resolves Ruby files from paths, gem metadata,
241
+ version: 2.0.15
242
+ description: "\U0001F3AD AnonymousLoader resolves Ruby files from paths, gem metadata,
243
243
  or $LOAD_PATH and evaluates them inside anonymous modules to avoid top-level namespace
244
244
  collisions."
245
245
  email:
246
246
  - floss@galtzo.com
247
247
  executables: []
248
248
  extensions: []
249
- extra_rdoc_files:
250
- - CHANGELOG.md
251
- - CITATION.cff
252
- - CODE_OF_CONDUCT.md
253
- - CONTRIBUTING.md
254
- - FUNDING.md
255
- - LICENSE.md
256
- - README.md
257
- - RUBOCOP.md
258
- - SECURITY.md
249
+ extra_rdoc_files: []
259
250
  files:
260
251
  - CHANGELOG.md
261
- - CITATION.cff
262
- - CODE_OF_CONDUCT.md
263
- - CONTRIBUTING.md
264
- - FUNDING.md
265
252
  - LICENSE.md
266
253
  - README.md
267
- - RUBOCOP.md
268
- - SECURITY.md
269
- - certs/pboling.pem
270
254
  - lib/anonymous_loader.rb
271
255
  - lib/anonymous_loader/version.rb
272
256
  - sig/anonymous_loader.rbs
273
- - sig/anonymous_loader/version.rbs
274
257
  homepage: https://github.com/ruby-oauth/anonymous_loader
275
258
  licenses:
276
259
  - MIT
277
260
  metadata:
278
261
  homepage_uri: https://anonymous-loader.galtzo.com
279
- source_code_uri: https://github.com/ruby-oauth/anonymous_loader/tree/v0.1.0
280
- changelog_uri: https://github.com/ruby-oauth/anonymous_loader/blob/v0.1.0/CHANGELOG.md
262
+ source_code_uri: https://github.com/ruby-oauth/anonymous_loader/tree/v0.1.5
263
+ changelog_uri: https://github.com/ruby-oauth/anonymous_loader/blob/v0.1.5/CHANGELOG.md
281
264
  bug_tracker_uri: https://github.com/ruby-oauth/anonymous_loader/issues
282
- documentation_uri: https://www.rubydoc.info/gems/anonymous_loader/0.1.0
265
+ documentation_uri: https://www.rubydoc.info/gems/anonymous_loader/0.1.5
283
266
  funding_uri: https://github.com/sponsors/pboling
284
267
  wiki_uri: https://github.com/ruby-oauth/anonymous_loader/wiki
285
268
  news_uri: https://www.railsbling.com/tags/anonymous_loader
286
269
  discord_uri: https://discord.gg/3qme4XHNKN
270
+ mailing_list_uri: https://www.rubyforum.org/tag/ruby-oauth
287
271
  rubygems_mfa_required: 'true'
288
272
  rdoc_options:
289
273
  - "--title"
290
- - "anonymous_loader - \U0001F48E Load Ruby source files inside anonymous namespaces."
274
+ - "anonymous_loader - \U0001F3AD Load Ruby source files inside anonymous namespaces."
291
275
  - "--main"
292
276
  - README.md
293
277
  - "--exclude"
@@ -308,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
308
292
  - !ruby/object:Gem::Version
309
293
  version: '0'
310
294
  requirements: []
311
- rubygems_version: 4.0.10
295
+ rubygems_version: 4.0.20
312
296
  specification_version: 4
313
- summary: "\U0001F48E Load Ruby source files inside anonymous namespaces."
297
+ summary: "\U0001F3AD Load Ruby source files inside anonymous namespaces."
314
298
  test_files: []
metadata.gz.sig CHANGED
Binary file
data/CITATION.cff DELETED
@@ -1,20 +0,0 @@
1
- cff-version: 1.2.0
2
- title: "anonymous_loader"
3
- message: >-
4
- If you use this work and you want to cite it,
5
- then you can use the metadata from this file.
6
- type: software
7
- authors:
8
- - given-names: "Peter H."
9
- family-names: "Boling"
10
- email: "floss@galtzo.com"
11
- affiliation: "galtzo.com"
12
- orcid: 'https://orcid.org/0009-0008-8519-441X'
13
- identifiers:
14
- - type: url
15
- value: 'https://github.com/ruby-oauth/anonymous_loader'
16
- description: "anonymous_loader"
17
- repository-code: 'https://github.com/ruby-oauth/anonymous_loader'
18
- abstract: >-
19
- anonymous_loader
20
- license: See license file
data/CODE_OF_CONDUCT.md DELETED
@@ -1,134 +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
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, caste, color, religion, or sexual
10
- identity and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the overall
26
- community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or advances of
31
- any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email address,
35
- without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official email address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- [![Contact Maintainer][🚂maint-contact-img]][🚂maint-contact].
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series of
86
- actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or permanent
93
- ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within the
113
- community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.1, available at
119
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
-
121
- Community Impact Guidelines were inspired by
122
- [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
-
124
- For answers to common questions about this code of conduct, see the FAQ at
125
- [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
- [https://www.contributor-covenant.org/translations][translations].
127
-
128
- [homepage]: https://www.contributor-covenant.org
129
- [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
- [Mozilla CoC]: https://github.com/mozilla/diversity
131
- [FAQ]: https://www.contributor-covenant.org/faq
132
- [translations]: https://www.contributor-covenant.org/translations
133
- [🚂maint-contact]: http://www.railsbling.com/contact
134
- [🚂maint-contact-img]: https://img.shields.io/badge/Contact-Maintainer-0093D0.svg?style=flat&logo=rubyonrails&logoColor=red