fastlane-plugin-patch 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/lib/fastlane/plugin/patch/actions/apply_patch_action.rb +8 -5
- data/lib/fastlane/plugin/patch/actions/revert_patch_action.rb +7 -4
- data/lib/fastlane/plugin/patch/helper/patch_helper.rb +1 -1
- data/lib/fastlane/plugin/patch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e43a5073e5e6f001a9bac1edc8d5c01269365664
|
4
|
+
data.tar.gz: 6a43c19f97495874c41cf06267c9090305e4fe89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d693bb861b0a1d6ccf36acac47d7068a5f6c8093deb6e100fcd5b18c2dd98bb21c055eabc12ad9b5ac28e695ef8b8c533b736a7a2a911351e0904f5835d1cb4b
|
7
|
+
data.tar.gz: 006cc262c53603c6c2411e3197354e75792dcb4518474c6b43f245be10b697ea5f5835b0f3fea57964be6c687a0e87c30dfbb6592becdef6299dd8af5ff701db
|
data/README.md
CHANGED
@@ -60,6 +60,19 @@ apply_patch(
|
|
60
60
|
)
|
61
61
|
```
|
62
62
|
|
63
|
+
#### Capture groups
|
64
|
+
|
65
|
+
Capture groups may be used in `:replace` mode.
|
66
|
+
|
67
|
+
```Ruby
|
68
|
+
apply_patch(
|
69
|
+
files: "MyPod.podspec",
|
70
|
+
regexp: /(s.name\s*=\s*)"MyPod"/,
|
71
|
+
text: '\1"MyOtherPod"',
|
72
|
+
mode: :replace
|
73
|
+
)
|
74
|
+
```
|
75
|
+
|
63
76
|
### revert_patch action
|
64
77
|
|
65
78
|
Revert patches by passing the same arguments to the `revert_patch` action:
|
@@ -28,8 +28,11 @@ module Fastlane
|
|
28
28
|
UI.user_error! "Must specify :regexp and :text either in a patch or via arguments" if
|
29
29
|
params[:regexp].nil? || params[:text].nil?
|
30
30
|
|
31
|
-
helper =
|
32
|
-
helper.files_from_params
|
31
|
+
helper = Helper::PatchHelper
|
32
|
+
files = helper.files_from_params params
|
33
|
+
UI.user_error! "Must specify at least one file to patch using the :files option" if files.empty?
|
34
|
+
|
35
|
+
files.each do |file|
|
33
36
|
modified_contents = File.open(file, "r") do |f|
|
34
37
|
helper.apply_patch f.read,
|
35
38
|
params[:regexp],
|
@@ -55,9 +58,9 @@ module Fastlane
|
|
55
58
|
|
56
59
|
def self.details
|
57
60
|
<<-EOF
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
Append or prepend text to a specified pattern in a list of files or
|
62
|
+
replace it, once or globally. Patches are specified by arguments or
|
63
|
+
YAML files. Revert the same patches with the revert_patch action.
|
61
64
|
EOF
|
62
65
|
end
|
63
66
|
|
@@ -28,8 +28,11 @@ module Fastlane
|
|
28
28
|
UI.user_error! "Must specify :regexp and :text either in a patch or via arguments" if
|
29
29
|
params[:regexp].nil? || params[:text].nil?
|
30
30
|
|
31
|
-
helper =
|
32
|
-
helper.files_from_params
|
31
|
+
helper = Helper::PatchHelper
|
32
|
+
files = helper.files_from_params params
|
33
|
+
UI.user_error! "Must specify at least one file to revert using the :files option" if files.empty?
|
34
|
+
|
35
|
+
files.each do |file|
|
33
36
|
modified_contents = File.open(file, "r") do |f|
|
34
37
|
helper.revert_patch f.read,
|
35
38
|
params[:regexp],
|
@@ -55,8 +58,8 @@ module Fastlane
|
|
55
58
|
|
56
59
|
def self.details
|
57
60
|
<<-EOF
|
58
|
-
|
59
|
-
|
61
|
+
Revert a patch by specifying the arguments provided to apply_patch
|
62
|
+
using arguments or the same YAML patch files.
|
60
63
|
EOF
|
61
64
|
end
|
62
65
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Dee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|