fastlane-plugin-maintenance 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f621164e8f2d3a86dbd19c4711d5de9153191496b1104e17407305c5281e452e
4
- data.tar.gz: b38c6d50dadc89b40ecc7f755ef585287fd4bc1b68dc3b0ee6a92eebce30a2bc
3
+ metadata.gz: a1f0e0fdb76b5c86eb70449d7eda5537f8c5675df21052407df553ba1dfdc3ba
4
+ data.tar.gz: c5c41b513d63c4d3211351cb9e6d7a323312a72c35bf093437370847839e15f4
5
5
  SHA512:
6
- metadata.gz: 5dcada27fe1bdb35840dfef49b5574295f05e93d87a7d0605f5c1fc2b66b801c9e3e78e35ccd8ffdba740f8629db10a8db0c0ed9d911c0d687f28bae125b0b09
7
- data.tar.gz: 6f35db1f5ecac7e7ca0dd5c8c47e28243094e8a803ea91db68f1056b44853c8530940bedee183009f46a28ee5ee63c7cf54c15cd92aaff722a60e69f69356c5a
6
+ metadata.gz: 07014b4221a386cfb2f4502cea63fec8e34264e2f04917e1edb56b156fb13fe2c1554fe0a8fbd1e8f602613aed7d5327724e7a728c400103dc1f8a61004eb3fc
7
+ data.tar.gz: 10fc68069bb9c4127e393206ffbe64dbc8be00bc6e0bd0d7234d356458466c43fb91c6c8610487010b8daf86807aa86181a911954b923ec38142a3f7c417f119
data/README.md CHANGED
@@ -12,13 +12,34 @@ fastlane add_plugin maintenance
12
12
 
13
13
  ## About maintenance
14
14
 
15
- Maintenance actions for plugin repos. May be run as standalone actions from the
16
- command line.
15
+ Maintenance actions for plugin repos.
16
+
17
+ ### rake action
18
+
19
+ ```bash
20
+ rake task: :release
21
+ ```
22
+
23
+ ```bash
24
+ rake task: :default
25
+ ```
26
+
27
+ ```bash
28
+ rake task: :default, rakefile: "Rakefile"
29
+ ```
30
+
31
+ General-purpose rake action to build tasks from a Rakefile.
32
+
33
+ |Parameter|Description|
34
+ |---------|-----------|
35
+ |task|The task to build. Symbol or String.|
36
+ |rakefile|The Rakefile to use. Defaults to "Rakefile"|
37
+ |options|Options for the task. Pass an array for multiple options.|
17
38
 
18
39
  ### update_rubocop action
19
40
 
20
41
  ```bash
21
- bundle exec fastlane run update_rubocop
42
+ update_rubocop
22
43
  ```
23
44
 
24
45
  Updates rubocop to the latest version. Pins your gemspec to a new version of rubocop if
@@ -0,0 +1,72 @@
1
+ require "fastlane/action"
2
+ require "rake"
3
+
4
+ module Fastlane
5
+ module Actions
6
+ class RakeAction < Action
7
+ class << self
8
+ include Rake::DSL
9
+
10
+ def run(params)
11
+ if File.exist?(params[:rakefile])
12
+ # Can't require. Because no .rb?
13
+ # rubocop: disable Security/Eval
14
+ eval File.read(params[:rakefile])
15
+ # rubocop: enable Security/Eval
16
+ end
17
+
18
+ case params[:options]
19
+ when Array
20
+ # Can pass multiple options as an array
21
+ args = *params[:options]
22
+ else
23
+ args = params[:options]
24
+ end
25
+
26
+ UI.header "rake #{params[:task]}"
27
+ Rake::Task[params[:task]].invoke args
28
+ end
29
+
30
+ def available_options
31
+ [
32
+ FastlaneCore::ConfigItem.new(
33
+ key: :task,
34
+ description: "Rake task to build",
35
+ is_string: false
36
+ ),
37
+ FastlaneCore::ConfigItem.new(
38
+ key: :rakefile,
39
+ description: "Rakefile to use",
40
+ type: String,
41
+ optional: true,
42
+ default_value: "Rakefile",
43
+ verify_block: ->(path) { File.open(path); true }
44
+ ),
45
+ FastlaneCore::ConfigItem.new(
46
+ key: :options,
47
+ description: "Options for task",
48
+ is_string: false,
49
+ optional: true
50
+ )
51
+ ]
52
+ end
53
+
54
+ def description
55
+ "General-purpose rake action to invoke tasks from a Rakefile or elsewhere."
56
+ end
57
+
58
+ def authors
59
+ ["Jimmy Dee"]
60
+ end
61
+
62
+ def example_code
63
+ [
64
+ "rake task: :release",
65
+ "rake task: :default",
66
+ %(rake task: :default, rakefile: "Rakefile")
67
+ ]
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -90,29 +90,26 @@ module Fastlane
90
90
  adjust_target_ruby_version
91
91
 
92
92
  UI.message "1. Running rubocop --auto-correct. This may fail."
93
- sh "bundle exec rubocop --auto-correct", print_command_output: false do |status|
93
+ sh "bundle exec rubocop --auto-correct", print_command_output: false do |status, output|
94
+ output.split("\n").each do |line|
95
+ adjust_namespace(line) if line =~ /has the wrong namespace/
96
+ end
97
+
94
98
  if status.success?
95
99
  UI.success "Done ✅"
96
100
  return
97
101
  end
98
102
  end
99
103
 
100
- UI.message "2. Running rubocop --display-cop-names for further automated fixes. This may fail."
104
+ UI.message "2. Running rubocop --display-cop-names to disable failing cops. This may fail."
101
105
  sh "bundle exec rubocop --display-cop-names", print_command_output: false do |status, output, command|
102
106
  if status.success?
103
107
  UI.success "Done ✅"
104
108
  return
105
109
  end
106
110
 
107
- UI.message "Adjusting changed namespaces and disabling failing cops."
108
-
109
111
  output.split("\n").each do |line|
110
- case line
111
- when /has the wrong namespace/
112
- adjust_namespace line
113
- else
114
- add_failing_cop line
115
- end
112
+ add_failing_cop line
116
113
  end
117
114
 
118
115
  disable_failing_cops
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Maintenance
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-maintenance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Dee
@@ -25,13 +25,13 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.5.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :development
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -39,35 +39,35 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: fastlane
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.69.0
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 2.69.0
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: fastlane
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 2.69.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 2.69.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -145,6 +145,7 @@ files:
145
145
  - LICENSE
146
146
  - README.md
147
147
  - lib/fastlane/plugin/maintenance.rb
148
+ - lib/fastlane/plugin/maintenance/actions/rake_action.rb
148
149
  - lib/fastlane/plugin/maintenance/actions/update_rubocop_action.rb
149
150
  - lib/fastlane/plugin/maintenance/helper/maintenance_helper.rb
150
151
  - lib/fastlane/plugin/maintenance/version.rb