flickwerk 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/exe/flickwerk +1 -1
- data/lib/flickwerk/patch_finder.rb +1 -1
- data/lib/flickwerk/patchify.rb +6 -7
- data/lib/flickwerk/railtie.rb +1 -0
- data/lib/flickwerk/version.rb +1 -1
- data/lib/flickwerk.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: 3408516d5382df979190373fd3acb47eb26e91e6b52e9f9e770887a9e5c08382
|
4
|
+
data.tar.gz: d04f410971901f342e3baaffa3549eacefe03da60088babe2c9f7cb6cc85dc50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9666d78b3dfb945fb959ad14ed966e9e7bca57f62a682c1f5cfae811a70fc0a30d1dcebfb841e0693dfceb90b31e92e13574a9ddad0615220f0245334b716f23
|
7
|
+
data.tar.gz: 4e62dc30ebe97aa88e0a6f3e5cda2d4b7b27342ff093196807e6d1ba74c2285bd11ec87c0f407d60cf0f51e83693cffacf909c92d7b6e52ef72d5e7ab83d2dbe
|
data/README.md
CHANGED
@@ -190,7 +190,13 @@ Flickwerk will now move your decorators and rename them.
|
|
190
190
|
If your patches currently live in `app/overrides`, use an argument:
|
191
191
|
|
192
192
|
```sh
|
193
|
-
bundle exec flickwerk patchify overrides
|
193
|
+
bundle exec flickwerk patchify app/overrides
|
194
|
+
```
|
195
|
+
|
196
|
+
If you have patches in `lib`, they can be moved to `lib/patches`:
|
197
|
+
|
198
|
+
```sh
|
199
|
+
bundle exec flickwerk patchify lib/decorators lib/patches
|
194
200
|
```
|
195
201
|
|
196
202
|
Now, run your tests and make sure your patches comply with Flickwerk's requirements.
|
data/exe/flickwerk
CHANGED
@@ -7,7 +7,7 @@ require "flickwerk/patchify"
|
|
7
7
|
|
8
8
|
case ARGV[0]
|
9
9
|
when "patchify"
|
10
|
-
Flickwerk::Patchify.call(ARGV[1])
|
10
|
+
Flickwerk::Patchify.call(decorator_dir: ARGV[1] || "app/decorators", patches_dir: ARGV[2] || "app/patches")
|
11
11
|
else
|
12
12
|
raise ArgumentError, "Unknown command #{ARGV[0]}. Please use `patchify`."
|
13
13
|
end
|
data/lib/flickwerk/patchify.rb
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "active_support"
|
3
4
|
require "active_support/core_ext/string"
|
4
5
|
|
5
6
|
module Flickwerk
|
6
7
|
class Patchify
|
7
|
-
|
8
|
-
|
9
|
-
directory_name ||= "decorators"
|
10
|
-
source_dir = "app/#{directory_name}"
|
8
|
+
def self.call(decorator_dir:, patches_dir:)
|
9
|
+
directory_name = decorator_dir.split("/").last
|
11
10
|
suffix = directory_name.singularize
|
12
11
|
constant = suffix.camelize
|
13
12
|
|
14
|
-
Dir.glob("#{
|
15
|
-
relative_path = file.sub(/^#{
|
13
|
+
Dir.glob("#{decorator_dir}/**/*_#{suffix}.rb").each do |file|
|
14
|
+
relative_path = file.sub(/^#{decorator_dir}\//, "")
|
16
15
|
target_file = relative_path.sub("_#{suffix}.rb", "_patch.rb")
|
17
|
-
target_path = File.join(
|
16
|
+
target_path = File.join(patches_dir, File.dirname(relative_path))
|
18
17
|
|
19
18
|
# Create target directory if it doesn't exist
|
20
19
|
FileUtils.mkdir_p(target_path)
|
data/lib/flickwerk/railtie.rb
CHANGED
data/lib/flickwerk/version.rb
CHANGED
data/lib/flickwerk.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|