decorators 2.0.6 → 2.1.0
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/lib/decorators/paths.rb +2 -0
- data/lib/decorators/railtie.rb +2 -0
- data/lib/decorators.rb +17 -4
- data/readme.md +8 -1
- metadata +6 -43
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9efa7db170a09a587fead6631846e7212ad98fc9b814de4c59845b1ee397163
|
|
4
|
+
data.tar.gz: 8dc05592f028f78da76e3f2fdb44b78f19960957e8ba5166d43a7101ba0fa2c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 672b0091b73016852f0076508b6145bf64f4bd56ba9ccda823e9b10d30a2e019d3999c84785e63d1b1911aa9c8efb4c1405500eb3513d4c60f0e24709c768a7b
|
|
7
|
+
data.tar.gz: d04d6dc7df0c86f11e7e808922f013560a72c6023b771347bc9e5ef31140bbf5b8627fdf6d2b91b430a99b01e5374f8c63d024cde8377a49cc6d5e9079771897
|
data/lib/decorators/paths.rb
CHANGED
data/lib/decorators/railtie.rb
CHANGED
data/lib/decorators.rb
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "decorators/paths"
|
|
4
|
+
require "decorators/railtie"
|
|
3
5
|
|
|
6
|
+
module Decorators
|
|
4
7
|
class << self
|
|
5
8
|
def load!(cache_classes)
|
|
6
9
|
decorators_with_argument_errors = []
|
|
@@ -22,6 +25,7 @@ module Decorators
|
|
|
22
25
|
def register!(*paths_to_register)
|
|
23
26
|
paths_to_register.flatten.map do |path|
|
|
24
27
|
paths.register! path
|
|
28
|
+
ignore_in_autoloader(path)
|
|
25
29
|
end
|
|
26
30
|
end
|
|
27
31
|
|
|
@@ -47,10 +51,19 @@ module Decorators
|
|
|
47
51
|
end
|
|
48
52
|
end
|
|
49
53
|
|
|
54
|
+
# Decorators are loaded by hand, so Zeitwerk mustn't also manage them. Only
|
|
55
|
+
# subdirectories of app/decorators hold decorators; files directly inside it
|
|
56
|
+
# stay autoloadable.
|
|
57
|
+
def ignore_in_autoloader(path)
|
|
58
|
+
return unless defined?(Rails.autoloaders) && Rails.application && Rails.autoloaders.zeitwerk_enabled?
|
|
59
|
+
|
|
60
|
+
Dir[Pathname(path).join("app", "decorators", "*")].select { |entry| File.directory?(entry) }.each do |directory|
|
|
61
|
+
Rails.autoloaders.main.ignore(directory)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
50
65
|
def pattern
|
|
51
66
|
["app", "decorators", "*", "**", "*_decorator.rb"]
|
|
52
67
|
end
|
|
53
68
|
end
|
|
54
69
|
end
|
|
55
|
-
|
|
56
|
-
require "decorators/railtie"
|
data/readme.md
CHANGED
|
@@ -26,7 +26,7 @@ The important parts are being inside a sub directory of `app/decorators` and hav
|
|
|
26
26
|
In your Gemfile, add the gem:
|
|
27
27
|
|
|
28
28
|
```ruby
|
|
29
|
-
gem 'decorators', '~> 2.
|
|
29
|
+
gem 'decorators', '~> 2.1'
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Now, run `bundle install` and the gem should install.
|
|
@@ -49,6 +49,13 @@ require 'decorators'
|
|
|
49
49
|
Decorators.register! Rails.root, Rails.root.join('vendor', 'extensions', 'extension_with_decorators')
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
#### Zeitwerk
|
|
53
|
+
|
|
54
|
+
Decorators loads these files itself, so it tells Zeitwerk to ignore the
|
|
55
|
+
subdirectories of `app/decorators` in every path you register. Register your
|
|
56
|
+
paths before eager loading happens, e.g. from an initializer or a `to_prepare`
|
|
57
|
+
block, not `after_initialize`.
|
|
58
|
+
|
|
52
59
|
#### Avoiding Rails development mode reloading issues ([example](https://github.com/refinery/refinerycms/issues/2267))
|
|
53
60
|
|
|
54
61
|
If you are loading this from within a Rails engine definition make sure you require
|
metadata
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decorators
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Philip Arndt
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
|
-
cert_chain:
|
|
11
|
-
-
|
|
12
|
-
-----BEGIN CERTIFICATE-----
|
|
13
|
-
MIIEhjCCAu6gAwIBAgIBATANBgkqhkiG9w0BAQsFADBNMQ0wCwYDVQQDDARnZW1z
|
|
14
|
-
MREwDwYKCZImiZPyLGQBGRYBcDEVMBMGCgmSJomT8ixkARkWBWFybmR0MRIwEAYK
|
|
15
|
-
CZImiZPyLGQBGRYCaW8wHhcNMjQwNzI1MDkzMTM3WhcNMjUwNzI1MDkzMTM3WjBN
|
|
16
|
-
MQ0wCwYDVQQDDARnZW1zMREwDwYKCZImiZPyLGQBGRYBcDEVMBMGCgmSJomT8ixk
|
|
17
|
-
ARkWBWFybmR0MRIwEAYKCZImiZPyLGQBGRYCaW8wggGiMA0GCSqGSIb3DQEBAQUA
|
|
18
|
-
A4IBjwAwggGKAoIBgQCb2WAH3bZwQeiyrc8ihYIM3cDDfiJbUYDxwE4+c8PT+WBO
|
|
19
|
-
WIC4QMdiVLllwliKoCjDeH14dNHGYBJFFu4+jj+jyzYEPaxPn05N4zUZiFe3oXzf
|
|
20
|
-
ipaNxdCuilrMrRT0hFclKWvGUT5meVmfxEgX65FPHezv5W4za4ajxfMItUqJCooQ
|
|
21
|
-
lfXB8sO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uw0b+1NiR2gFpOLcOy2ixKdua13S9CWRRsR3VJve+PIyycC7
|
|
36
|
-
aLV+FI9i9b1YUXG2gDKqLOkF/FNBWNckAmGj7kYkdLG76G5aRGP0HvfKbIiQ3HTC
|
|
37
|
-
jAtsfxiSgc0fAw==
|
|
38
|
-
-----END CERTIFICATE-----
|
|
39
|
-
date: 2024-07-25 00:00:00.000000000 Z
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
40
11
|
dependencies:
|
|
41
12
|
- !ruby/object:Gem::Dependency
|
|
42
13
|
name: railties
|
|
@@ -47,7 +18,7 @@ dependencies:
|
|
|
47
18
|
version: 4.0.0
|
|
48
19
|
- - "<"
|
|
49
20
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: '
|
|
21
|
+
version: '9'
|
|
51
22
|
type: :runtime
|
|
52
23
|
prerelease: false
|
|
53
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -57,14 +28,11 @@ dependencies:
|
|
|
57
28
|
version: 4.0.0
|
|
58
29
|
- - "<"
|
|
59
30
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '
|
|
31
|
+
version: '9'
|
|
61
32
|
- !ruby/object:Gem::Dependency
|
|
62
33
|
name: rspec
|
|
63
34
|
requirement: !ruby/object:Gem::Requirement
|
|
64
35
|
requirements:
|
|
65
|
-
- - "~>"
|
|
66
|
-
- !ruby/object:Gem::Version
|
|
67
|
-
version: '3.5'
|
|
68
36
|
- - ">="
|
|
69
37
|
- !ruby/object:Gem::Version
|
|
70
38
|
version: 3.5.0
|
|
@@ -72,9 +40,6 @@ dependencies:
|
|
|
72
40
|
prerelease: false
|
|
73
41
|
version_requirements: !ruby/object:Gem::Requirement
|
|
74
42
|
requirements:
|
|
75
|
-
- - "~>"
|
|
76
|
-
- !ruby/object:Gem::Version
|
|
77
|
-
version: '3.5'
|
|
78
43
|
- - ">="
|
|
79
44
|
- !ruby/object:Gem::Version
|
|
80
45
|
version: 3.5.0
|
|
@@ -93,7 +58,6 @@ homepage: https://github.com/parndt/decorators
|
|
|
93
58
|
licenses:
|
|
94
59
|
- MIT
|
|
95
60
|
metadata: {}
|
|
96
|
-
post_install_message:
|
|
97
61
|
rdoc_options: []
|
|
98
62
|
require_paths:
|
|
99
63
|
- lib
|
|
@@ -108,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
108
72
|
- !ruby/object:Gem::Version
|
|
109
73
|
version: '0'
|
|
110
74
|
requirements: []
|
|
111
|
-
rubygems_version:
|
|
112
|
-
signing_key:
|
|
75
|
+
rubygems_version: 4.0.20
|
|
113
76
|
specification_version: 4
|
|
114
77
|
summary: Rails decorators plugin.
|
|
115
78
|
test_files: []
|
checksums.yaml.gz.sig
DELETED
|
Binary file
|
data.tar.gz.sig
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
�+1d������w�/��[�-��NIt#�2b�2
|
|
2
|
-
8���m��YS�om�q�[�?76�E�6�oxQ�ۄAlrL��p��6�Ur9�7��k[)��^�aVnJy���2(�wkg�0�L�o�{���e�|I�0fޢ�l��I�<�ԣ�:v�QZ�Ev�J
|
|
3
|
-
d��L\���E��홮o^���5�����1��j
|
|
4
|
-
j�H5��D��x�Yl� �z*��_D��k�o�FM���g�����mXBc��\�I�Z5���zʺRSaцf��j-�㘱^Ü�M���^�{%�S���p>��g�s�'ێǯ��+�C�@����27iO���_��m5���$��J��^wFFh�C��[i�B�B�LD�$�M7ͤ0�qˇ�E�,i�l��0�
|
metadata.gz.sig
DELETED
|
Binary file
|