flickwerk 0.2.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5e0ab83481440a9b1050a5de6178a3b70d6f82745e0615f41cd467c3dea954c
4
- data.tar.gz: 654d07fc6f2765164142c002dacfbebb73517f8a90c3ff5a42b57ed036f30c32
3
+ metadata.gz: a2282cc97b8ee8bb05493ba03cf1ed27690fdffacf62bb8ff203b6db3bf6c36c
4
+ data.tar.gz: 943a5ae6ec43be5b7139ba5b578335339564cb0ab832a0038250a58e005e46cc
5
5
  SHA512:
6
- metadata.gz: 3902ae52304b8d83e36ef895955d6425dd14594d8e871baa7497ceef02f7b8287aa0c5283823773c937bfb783dbf0b68390f971936750b59fdfec4fafdc0c470
7
- data.tar.gz: 821e7be27c93ba058af9c262cb131bba535ad1c4d6041dae60e13f063853ffcb881d313260d7d8ea083810b21b4405f149852921b37e4779eb4f8960e4c5c35d
6
+ metadata.gz: 7a93c5ffc75887ee60dde2635995ac097b70fe6b068106be82a173106eeb9c8d122e38053f9e42880940434fde943adf6b2bc02fab3965da252819c1880f2a89
7
+ data.tar.gz: 28891d06643e9cc430a5b793704abe65baa14825af3bf49a52bcc07fa9e4c32bcdce56a97e0b8f16f70ce3b125c9dcf3efaf64d09b8e0cf21e44b18191b3cc5b
@@ -10,13 +10,17 @@ class Flickwerk::Railtie < Rails::Railtie
10
10
  end
11
11
  end
12
12
 
13
- initializer "flickwerk.find_patches", after: :setup_main_autoloader do
14
- Flickwerk.patch_paths.each do |path|
15
- Flickwerk::PatchFinder.new(path).call
13
+ initializer "flickwerk.find_patches" do |app|
14
+ app.config.to_prepare do
15
+ Flickwerk.patch_paths.each do |path|
16
+ Flickwerk::PatchFinder.new(path).call
17
+ end
16
18
  end
17
19
  end
18
20
 
19
- initializer "flickwerk.add_patches", after: "flickwerk.find_patches" do
20
- Flickwerk::PatchLoader.call
21
+ initializer "flickwerk.add_patches", after: "flickwerk.find_patches" do |app|
22
+ app.config.to_prepare do
23
+ Flickwerk::PatchLoader.call
24
+ end
21
25
  end
22
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flickwerk
4
- VERSION = "0.2.1"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/flickwerk.rb CHANGED
@@ -9,6 +9,7 @@ module Flickwerk
9
9
 
10
10
  mattr_accessor :patch_paths, default: []
11
11
  mattr_accessor :patches, default: Hash.new([])
12
+ mattr_accessor :aliases, default: {}
12
13
 
13
14
  def self.included(engine)
14
15
  engine.root.glob("app/patches/*").each do |path|
@@ -17,6 +18,7 @@ module Flickwerk
17
18
  end
18
19
 
19
20
  def self.patch(class_name, with:)
20
- patches[class_name] += [with]
21
+ klass_name = aliases[class_name] || class_name
22
+ patches[klass_name] += [with]
21
23
  end
22
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Meyerhoff
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-16 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties