anyway_config 2.5.0 → 2.5.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/anyway/rails/autoload.rb +15 -15
- data/lib/anyway/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b7d08d5b962854362876ef57a33cb5a7db900a2b116cfc55e6a111fe67a6908
|
4
|
+
data.tar.gz: 8330ecf2804805dc40fd4966e5f0da06a8e46d87a9f01d1d377f5687b61cbdff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5af5f14653ba282b7c4e89d88c85dc3908d693fa7dc93c0436dba5044c1a8d98cae12284b97bfae9c3b9415dea5b745ac3bb9ee3639fc7880c61b3c3f6bf7465
|
7
|
+
data.tar.gz: b6d44f0500203371beaa12cdc47a24a9e9a66d66305491649e0961a9285d5280692cf5828736fa79afbd8fdd1459e26bf0a2715415c44188604c90616b880242
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 2.5.1 (2023-08-04)
|
6
|
+
|
7
|
+
- Fix Rails detection. ([@palkan][])
|
8
|
+
|
9
|
+
Fixes [#134](https://github.com/palkan/anyway_config/issues/134).
|
10
|
+
|
5
11
|
## 2.5.0 (2023-07-24)
|
6
12
|
|
7
13
|
- Generators: Add `config_name` to generated classes if name contains underscore. ([@palkan][])
|
@@ -4,8 +4,10 @@
|
|
4
4
|
# when Anyway Config is loaded before Rails (e.g., in config/puma.rb).
|
5
5
|
module Anyway
|
6
6
|
module Rails
|
7
|
+
using RubyNext
|
8
|
+
|
7
9
|
class << self
|
8
|
-
attr_reader :tracer
|
10
|
+
attr_reader :tracer, :name_method
|
9
11
|
attr_accessor :disable_postponed_load_warning
|
10
12
|
|
11
13
|
private
|
@@ -14,26 +16,24 @@ module Anyway
|
|
14
16
|
# Ignore singletons
|
15
17
|
return if event.self.singleton_class?
|
16
18
|
|
17
|
-
# We wait till `rails` has been loaded,
|
18
|
-
# https://github.com/
|
19
|
-
return unless event.self
|
20
|
-
|
21
|
-
# We must check for methods defined in `rails.rb` to distinguish events
|
22
|
-
# happening when we open the `Rails` module in other files.
|
23
|
-
if defined?(::Rails.env)
|
24
|
-
tracer.disable
|
19
|
+
# We wait till `rails/application/configuration.rb` has been loaded, since we rely on it
|
20
|
+
# See https://github.com/palkan/anyway_config/issues/134
|
21
|
+
return unless name_method.bind_call(event.self) == "Rails::Application::Configuration"
|
25
22
|
|
26
|
-
|
27
|
-
warn "Anyway Config was loaded before Rails. Activating Anyway Config Rails plugins now.\n" \
|
28
|
-
"NOTE: Already loaded configs were provisioned without Rails-specific sources."
|
29
|
-
end
|
23
|
+
tracer.disable
|
30
24
|
|
31
|
-
|
25
|
+
unless disable_postponed_load_warning
|
26
|
+
warn "Anyway Config was loaded before Rails. Activating Anyway Config Rails plugins now.\n" \
|
27
|
+
"NOTE: Already loaded configs were provisioned without Rails-specific sources."
|
32
28
|
end
|
29
|
+
|
30
|
+
require "anyway/rails"
|
33
31
|
end
|
34
32
|
end
|
35
33
|
|
36
|
-
@tracer = TracePoint.new(:
|
34
|
+
@tracer = TracePoint.new(:end, &method(:tracepoint_class_callback))
|
37
35
|
@tracer.enable
|
36
|
+
# Use `Module#name` instead of `self.name` to handle overwritten `name` method
|
37
|
+
@name_method = Module.instance_method(:name)
|
38
38
|
end
|
39
39
|
end
|
data/lib/anyway/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anyway_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-core
|