flickwerk 0.2.1 → 0.3.1

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: f5e0ab83481440a9b1050a5de6178a3b70d6f82745e0615f41cd467c3dea954c
4
- data.tar.gz: 654d07fc6f2765164142c002dacfbebb73517f8a90c3ff5a42b57ed036f30c32
3
+ metadata.gz: a3f767550c0a11caaa3f1fd9d2ceb95cebc12ed22d7b0a0f90891127364f2843
4
+ data.tar.gz: 83d91c33bffa4f7f2a66ad22fe19c0e55a768ee0f88db1d6e03aec423e844740
5
5
  SHA512:
6
- metadata.gz: 3902ae52304b8d83e36ef895955d6425dd14594d8e871baa7497ceef02f7b8287aa0c5283823773c937bfb783dbf0b68390f971936750b59fdfec4fafdc0c470
7
- data.tar.gz: 821e7be27c93ba058af9c262cb131bba535ad1c4d6041dae60e13f063853ffcb881d313260d7d8ea083810b21b4405f149852921b37e4779eb4f8960e4c5c35d
6
+ metadata.gz: 75ff28c2a648734224cf853f91bd27c2349c8fe57d6ac0d7637977ed55a13cb14fcee781cd15757d1c8a851d654c7cceadb849f03702fd713099ddf26e4b5edc
7
+ data.tar.gz: '00192ccc657c51c20aab77b476dde7d0c2344ae03d0dadbc87697fa5f91691c7350dda66071ea373d40df00da53b42239035bf7d63177abff5716e04d21abb44'
@@ -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.reloader.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.reloader.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.1"
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.1
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