flickwerk 0.3.1 → 0.3.2
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/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: 345f0a2e87adf7c5b68542723b564d9cd84de0991a7c52f100ed20cf3cf712e0
|
4
|
+
data.tar.gz: 31d4905e5d5b9ca8f5bd967d07a66ace54b1b963a12d619462cfa34cc8732fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f066e5ec937af4c9544928f38dd17454ecbb396c594096087e66271f6d985ac84622296be5261e2fb86ca519ee062cda7ec8b77b90b49cc2060f7439bfb614c6
|
7
|
+
data.tar.gz: 7813581a4e322803963a25e9af118101b0b72dbed06e8a19b66d9675307b7e23d4e3f4f0e5b438dd1beb80aafeef095446288c34dde747c18794ce4acd5441aa
|
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/version.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.2
|
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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|