planter-cli 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -3
- data/.rubocop_todo.yml +63 -0
- data/.yardopts +2 -2
- data/CHANGELOG.md +8 -0
- data/Guardfile +1 -1
- data/README.md +1 -1
- data/Rakefile +0 -3
- data/lib/planter/color.rb +1 -3
- data/lib/planter/config.rb +34 -21
- data/lib/planter/fileentry.rb +9 -3
- data/lib/planter/filelist.rb +16 -0
- data/lib/planter/numeric.rb +10 -2
- data/lib/planter/prompt.rb +21 -1
- data/lib/planter/string.rb +7 -4
- data/lib/planter/tag.rb +5 -1
- data/lib/planter/version.rb +1 -1
- data/lib/planter.rb +4 -4
- data/planter-cli.gemspec +1 -1
- data/src/_README.md +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d14e865eb5a5c296dc5b5672ffbacece33956b90e87c796b4d773f8c8ad1fa3
|
4
|
+
data.tar.gz: 8b1a869c83c2c0a31692cd41a24044d3b90e9558da5911de6e7549c60204bbc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ade318397e46f22c542775777285f967848dd4d4271452dad8b15f6224ef99923cffb8558de4efb8ce1161d7c1398d260d1864d4923be3f8a17f70a46835160c
|
7
|
+
data.tar.gz: 2ce7038f68dad0af81a595ceb7bd7efc7487a87d9c2d4df86bade005c109efdfa00ef139298dce03aa1e3d074ee45155d5c756f1f264dfe08d134c62e4d957a8
|
data/.rubocop.yml
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
1
3
|
Style/RegexpLiteral:
|
2
4
|
Exclude:
|
3
5
|
- Guardfile
|
@@ -16,6 +18,7 @@ AllCops:
|
|
16
18
|
Exclude:
|
17
19
|
- pkg/**/*.rb
|
18
20
|
- test/*
|
21
|
+
- 'lib/tty-spinner/**/*'
|
19
22
|
|
20
23
|
Style/MutableConstant:
|
21
24
|
Enabled: false
|
@@ -31,9 +34,6 @@ Style/StringLiteralsInInterpolation:
|
|
31
34
|
Enabled: true
|
32
35
|
EnforcedStyle: single_quotes
|
33
36
|
|
34
|
-
Layout/LineLength:
|
35
|
-
Max: 120
|
36
|
-
|
37
37
|
Metrics/MethodLength:
|
38
38
|
Max: 45
|
39
39
|
|
@@ -42,6 +42,7 @@ Metrics/BlockLength:
|
|
42
42
|
Exclude:
|
43
43
|
- Rakefile
|
44
44
|
- lib/*.rb
|
45
|
+
- lib/planter/string.rb
|
45
46
|
|
46
47
|
Metrics/ClassLength:
|
47
48
|
Max: 300
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2024-09-04 13:26:32 UTC using RuboCop version 1.66.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
12
|
+
# URISchemes: http, https
|
13
|
+
Layout/LineLength:
|
14
|
+
Max: 125
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
18
|
+
# AllowedMethods: refine
|
19
|
+
Metrics/BlockLength:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/planter/string.rb'
|
22
|
+
|
23
|
+
# Offense count: 1
|
24
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
25
|
+
Metrics/ClassLength:
|
26
|
+
Exclude:
|
27
|
+
- 'lib/planter/string.rb'
|
28
|
+
|
29
|
+
# Offense count: 2
|
30
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
31
|
+
Metrics/CyclomaticComplexity:
|
32
|
+
Exclude:
|
33
|
+
- 'lib/planter/prompt.rb'
|
34
|
+
- 'lib/planter/string.rb'
|
35
|
+
|
36
|
+
# Offense count: 2
|
37
|
+
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
|
38
|
+
Metrics/MethodLength:
|
39
|
+
Exclude:
|
40
|
+
- 'lib/planter/prompt.rb'
|
41
|
+
- 'lib/planter/string.rb'
|
42
|
+
|
43
|
+
# Offense count: 1
|
44
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
45
|
+
Metrics/PerceivedComplexity:
|
46
|
+
Exclude:
|
47
|
+
- 'lib/planter/prompt.rb'
|
48
|
+
|
49
|
+
# Offense count: 1
|
50
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
51
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
52
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
53
|
+
Naming/FileName:
|
54
|
+
Exclude:
|
55
|
+
- 'Rakefile.rb'
|
56
|
+
- 'spec/templates/test/Rakefile'
|
57
|
+
|
58
|
+
# Offense count: 1
|
59
|
+
# This cop supports safe autocorrection (--autocorrect).
|
60
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
61
|
+
# URISchemes: http, https
|
62
|
+
Layout/LineLength:
|
63
|
+
Max: 125
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
data/Guardfile
CHANGED
data/README.md
CHANGED
@@ -302,7 +302,7 @@ Some directories like `.git` and files like `_planter.yml` are automatically ign
|
|
302
302
|
|
303
303
|
When `plant` is run, any defined variables will be requested on the command line using the defined prompt. If a `default` key is specified, hitting return at the prompt will accept the default value.
|
304
304
|
|
305
|
-
Variables can be passed on the command line with `--var KEY:VALUE`. This flag can contain a comma-separated list, e.g. `--var KEY:VALUE,KEY:VALUE` or used multiple times in the same command. Variables passed on the command line will not be prompted for when processing variables.
|
305
|
+
Variables can be passed on the command line with `--var KEY:VALUE`. This flag can contain a comma-separated list, e.g. `--var KEY:VALUE,KEY:VALUE` or be used multiple times in the same command. Variables passed on the command line will not be prompted for when processing variables.
|
306
306
|
|
307
307
|
|
308
308
|
|
data/Rakefile
CHANGED
@@ -134,9 +134,6 @@ task :cver do
|
|
134
134
|
puts IO.read(File.join(File.dirname(__FILE__), 'CHANGELOG.md')).match(/^#+ (\d+\.\d+\.\d+(\w+)?)/)[1]
|
135
135
|
end
|
136
136
|
|
137
|
-
desc 'Alias for build'
|
138
|
-
task package: :build
|
139
|
-
|
140
137
|
desc 'Bump incremental version number'
|
141
138
|
task :bump, :type do |_, args|
|
142
139
|
args.with_defaults(type: 'inc')
|
data/lib/planter/color.rb
CHANGED
@@ -128,9 +128,7 @@ module Planter
|
|
128
128
|
compiled = ''
|
129
129
|
normalize_color.chars.each do |char|
|
130
130
|
compiled += char
|
131
|
-
if Color.attributes.include?(compiled.to_sym) || compiled =~ /^([fb]g?)?#([a-f0-9]{6})$/i
|
132
|
-
valid_color = compiled
|
133
|
-
end
|
131
|
+
valid_color = compiled if Color.attributes.include?(compiled.to_sym) || compiled =~ /^([fb]g?)?#([a-f0-9]{6})$/i
|
134
132
|
end
|
135
133
|
|
136
134
|
valid_color
|
data/lib/planter/config.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Planter
|
4
|
+
## Configuration class
|
4
5
|
class Config < Hash
|
5
6
|
attr_reader :template
|
6
7
|
|
7
8
|
##
|
8
9
|
## Initialize a new Config object for a template
|
9
10
|
##
|
10
|
-
## @param template [String] template name
|
11
|
-
##
|
12
11
|
def initialize
|
13
|
-
|
12
|
+
super()
|
14
13
|
|
15
14
|
@config = initial_config
|
16
15
|
@template = Planter.template
|
@@ -22,26 +21,17 @@ module Planter
|
|
22
21
|
generate_accessors
|
23
22
|
end
|
24
23
|
|
25
|
-
|
26
|
-
{
|
27
|
-
defaults: false,
|
28
|
-
git_init: false,
|
29
|
-
files: { '_planter.yml' => 'ignore' },
|
30
|
-
color: true,
|
31
|
-
preserve_tags: nil,
|
32
|
-
variables: nil,
|
33
|
-
replacements: nil,
|
34
|
-
repo: false,
|
35
|
-
patterns: nil,
|
36
|
-
debug: false,
|
37
|
-
script: nil
|
38
|
-
}
|
39
|
-
end
|
40
|
-
|
24
|
+
## String representation of the configuration
|
41
25
|
def to_s
|
42
26
|
@config.to_s
|
43
27
|
end
|
44
28
|
|
29
|
+
## Get a config key
|
30
|
+
##
|
31
|
+
## @param key [String,Symbol] key
|
32
|
+
##
|
33
|
+
## @return [String] value
|
34
|
+
##
|
45
35
|
def [](key)
|
46
36
|
@config[key]
|
47
37
|
end
|
@@ -59,7 +49,32 @@ module Planter
|
|
59
49
|
|
60
50
|
private
|
61
51
|
|
52
|
+
## Default configuration
|
53
|
+
##
|
54
|
+
## @return [Hash] default configuration
|
55
|
+
##
|
56
|
+
## @api private
|
57
|
+
##
|
58
|
+
def initial_config
|
59
|
+
{
|
60
|
+
defaults: false,
|
61
|
+
git_init: false,
|
62
|
+
files: { '_planter.yml' => 'ignore' },
|
63
|
+
color: true,
|
64
|
+
preserve_tags: nil,
|
65
|
+
variables: nil,
|
66
|
+
replacements: nil,
|
67
|
+
repo: false,
|
68
|
+
patterns: nil,
|
69
|
+
debug: false,
|
70
|
+
script: nil
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
62
74
|
## Generate accessors for configuration
|
75
|
+
##
|
76
|
+
## @api private
|
77
|
+
##
|
63
78
|
def generate_accessors
|
64
79
|
@config.each do |k, v|
|
65
80
|
define_singleton_method(k) { v } unless respond_to?(k)
|
@@ -69,8 +84,6 @@ module Planter
|
|
69
84
|
##
|
70
85
|
## Build a configuration from template name
|
71
86
|
##
|
72
|
-
## @param template [String] The template name
|
73
|
-
##
|
74
87
|
## @return [Hash] Configuration object
|
75
88
|
##
|
76
89
|
## @api private
|
data/lib/planter/fileentry.rb
CHANGED
@@ -6,8 +6,14 @@ module Planter
|
|
6
6
|
# Operation to execute on the file
|
7
7
|
attr_accessor :operation
|
8
8
|
|
9
|
-
# File path
|
10
|
-
attr_reader :file
|
9
|
+
# File path
|
10
|
+
attr_reader :file
|
11
|
+
|
12
|
+
# Target path
|
13
|
+
attr_reader :target
|
14
|
+
|
15
|
+
# Tags
|
16
|
+
attr_reader :tags
|
11
17
|
|
12
18
|
##
|
13
19
|
## Initialize a FileEntry object
|
@@ -19,7 +25,7 @@ module Planter
|
|
19
25
|
## @return [FileEntry] a Hash of parameters
|
20
26
|
##
|
21
27
|
def initialize(file, target, operation)
|
22
|
-
return
|
28
|
+
return unless File.exist?(file)
|
23
29
|
|
24
30
|
@file = file
|
25
31
|
@target = target
|
data/lib/planter/filelist.rb
CHANGED
@@ -50,6 +50,10 @@ module Planter
|
|
50
50
|
##
|
51
51
|
## @param entry [FileEntry] The file entry
|
52
52
|
##
|
53
|
+
## @return [Boolean] success
|
54
|
+
##
|
55
|
+
## @api private
|
56
|
+
##
|
53
57
|
def handle_operator(entry)
|
54
58
|
case entry.operation
|
55
59
|
when :ignore
|
@@ -72,6 +76,8 @@ module Planter
|
|
72
76
|
#
|
73
77
|
# @return [Boolean] success
|
74
78
|
#
|
79
|
+
# @api private
|
80
|
+
#
|
75
81
|
def apply_tags(entry)
|
76
82
|
return unless Planter.config.preserve_tags
|
77
83
|
|
@@ -83,6 +89,8 @@ module Planter
|
|
83
89
|
##
|
84
90
|
## @return [Boolean] success
|
85
91
|
##
|
92
|
+
## @api private
|
93
|
+
##
|
86
94
|
def prepare_copy
|
87
95
|
@files.each do |entry|
|
88
96
|
if entry.matches_pattern?
|
@@ -97,6 +105,10 @@ module Planter
|
|
97
105
|
##
|
98
106
|
## @param entry [FileEntry] The file entry
|
99
107
|
##
|
108
|
+
## @return [Boolean] success
|
109
|
+
##
|
110
|
+
## @api private
|
111
|
+
##
|
100
112
|
def propogate_operation(entry)
|
101
113
|
@files.each do |file|
|
102
114
|
file.operation = entry.operation if file.file =~ /^#{entry.file}/
|
@@ -111,6 +123,8 @@ module Planter
|
|
111
123
|
##
|
112
124
|
## @return [Boolean] success
|
113
125
|
##
|
126
|
+
## @api private
|
127
|
+
##
|
114
128
|
def merge(entry)
|
115
129
|
return copy_file(entry) if File.directory?(entry.file)
|
116
130
|
|
@@ -164,6 +178,8 @@ module Planter
|
|
164
178
|
##
|
165
179
|
## @return [Boolean] success
|
166
180
|
##
|
181
|
+
## @api private
|
182
|
+
##
|
167
183
|
def copy_file(file, overwrite: false)
|
168
184
|
# If the target file already exists and overwrite is true,
|
169
185
|
# or Planter.overwrite is true, then delete the target file
|
data/lib/planter/numeric.rb
CHANGED
@@ -1,29 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Planter
|
4
|
+
# Integer extensions
|
4
5
|
class ::Integer
|
6
|
+
# Clean value (dummy method)
|
5
7
|
def clean_value
|
6
8
|
self
|
7
9
|
end
|
8
10
|
|
9
|
-
|
11
|
+
# Has selector (dummy method)
|
12
|
+
def selector?
|
10
13
|
true
|
11
14
|
end
|
12
15
|
|
16
|
+
# Highlight character
|
13
17
|
def highlight_character(default: nil)
|
14
18
|
"(#{self})".highlight_character(default: default)
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
22
|
+
# Float extensions
|
18
23
|
class ::Float
|
24
|
+
# Clean value (dummy method)
|
19
25
|
def clean_value
|
20
26
|
self
|
21
27
|
end
|
22
28
|
|
23
|
-
|
29
|
+
# Has selector (dummy method)
|
30
|
+
def selector?
|
24
31
|
true
|
25
32
|
end
|
26
33
|
|
34
|
+
# Highlight character
|
27
35
|
def highlight_character(default: nil)
|
28
36
|
"(#{self})".highlight_character(default: default)
|
29
37
|
end
|
data/lib/planter/prompt.rb
CHANGED
@@ -73,6 +73,8 @@ module Planter
|
|
73
73
|
##
|
74
74
|
## @return [Number] numeric response
|
75
75
|
##
|
76
|
+
## @api private
|
77
|
+
##
|
76
78
|
def read_number(integer: false)
|
77
79
|
default = @default ? " {xw}[{xbw}#{@default}{xw}]" : ''
|
78
80
|
Planter.notify("{by}#{@prompt} {xc}({bw}#{@min}{xc}-{bw}#{@max}{xc})#{default}")
|
@@ -92,6 +94,8 @@ module Planter
|
|
92
94
|
##
|
93
95
|
## @return [String] date string
|
94
96
|
##
|
97
|
+
## @api private
|
98
|
+
##
|
95
99
|
def date_default
|
96
100
|
default = @value || @default
|
97
101
|
return nil unless default
|
@@ -120,6 +124,8 @@ module Planter
|
|
120
124
|
##
|
121
125
|
## @return [Date] Parsed Date object
|
122
126
|
##
|
127
|
+
## @api private
|
128
|
+
##
|
123
129
|
def read_date(prompt: nil)
|
124
130
|
prompt ||= @prompt
|
125
131
|
default = date_default
|
@@ -141,6 +147,8 @@ module Planter
|
|
141
147
|
##
|
142
148
|
## @return [String] the single-line response
|
143
149
|
##
|
150
|
+
## @api private
|
151
|
+
##
|
144
152
|
def read_line(prompt: nil)
|
145
153
|
return @default if Planter.accept_defaults || ENV['PLANTER_DEBUG']
|
146
154
|
|
@@ -164,6 +172,8 @@ module Planter
|
|
164
172
|
##
|
165
173
|
## @return [String] the multi-line response
|
166
174
|
##
|
175
|
+
## @api private
|
176
|
+
##
|
167
177
|
def read_lines(prompt: nil)
|
168
178
|
prompt ||= @prompt
|
169
179
|
save = @gum ? 'Ctrl-J for newline, Enter' : 'Ctrl-D'
|
@@ -180,6 +190,8 @@ module Planter
|
|
180
190
|
##
|
181
191
|
## @return [String] String response
|
182
192
|
##
|
193
|
+
## @api private
|
194
|
+
##
|
183
195
|
def read_number_gum
|
184
196
|
trap('SIGINT') { exit! }
|
185
197
|
res = `gum input --placeholder "#{@min}-#{@max}"`.strip
|
@@ -193,6 +205,8 @@ module Planter
|
|
193
205
|
##
|
194
206
|
## @return [String] String response
|
195
207
|
##
|
208
|
+
## @api private
|
209
|
+
##
|
196
210
|
def read_line_tty
|
197
211
|
trap('SIGINT') { exit! }
|
198
212
|
reader = TTY::Reader.new
|
@@ -207,6 +221,8 @@ module Planter
|
|
207
221
|
##
|
208
222
|
## @return [String] String response
|
209
223
|
##
|
224
|
+
## @api private
|
225
|
+
##
|
210
226
|
def read_line_gum
|
211
227
|
trap('SIGINT') { exit! }
|
212
228
|
res = `gum input --placeholder "(blank to use default)"`.strip
|
@@ -220,6 +236,8 @@ module Planter
|
|
220
236
|
##
|
221
237
|
## @return [string] multiline input
|
222
238
|
##
|
239
|
+
## @api private
|
240
|
+
##
|
223
241
|
def read_mutliline_tty
|
224
242
|
trap('SIGINT') { exit! }
|
225
243
|
reader = TTY::Reader.new
|
@@ -232,6 +250,8 @@ module Planter
|
|
232
250
|
##
|
233
251
|
## @return [string] multiline input
|
234
252
|
##
|
253
|
+
## @api private
|
254
|
+
##
|
235
255
|
def read_multiline_gum(prompt)
|
236
256
|
trap('SIGINT') { exit! }
|
237
257
|
width = TTY::Screen.cols > 80 ? 80 : TTY::Screen.cols
|
@@ -268,7 +288,7 @@ module Planter
|
|
268
288
|
values = choices.to_values.map(&:clean_value)
|
269
289
|
end
|
270
290
|
|
271
|
-
die('Choice(s) without selector, please edit config') unless keys.all?(&:
|
291
|
+
die('Choice(s) without selector, please edit config') unless keys.all?(&:selector?)
|
272
292
|
|
273
293
|
default = case default_response.to_s
|
274
294
|
when /^\d+$/
|
data/lib/planter/string.rb
CHANGED
@@ -239,7 +239,7 @@ module Planter
|
|
239
239
|
variables = variables.nil? ? Planter.variables : variables
|
240
240
|
op_rx = ' *(?<content>c(?:opy)?|o(?:ver(?:write)?)?|i(?:gnore)?|m(?:erge)?)? *'
|
241
241
|
|
242
|
-
strip.gsub(/^if .*?(?:end(?: ?if)?|$)/mi) do |construct|
|
242
|
+
output = strip.gsub(/^if .*?(?:end(?: ?if)?|$)/mi) do |construct|
|
243
243
|
# Get the condition and the content
|
244
244
|
output = construct.match(/else:#{op_rx}/m) ? Regexp.last_match(1) : ''
|
245
245
|
|
@@ -249,13 +249,16 @@ module Planter
|
|
249
249
|
end
|
250
250
|
|
251
251
|
apply_conditions(conditions, variables, output)
|
252
|
-
end
|
252
|
+
end
|
253
|
+
output = output.gsub(/^#{op_rx} +if .*?(end( ?if)?|$)/mi) do |construct|
|
253
254
|
# Get the condition and the content
|
254
255
|
output = construct.match(/else[; ]+(#{op_rx})/m) ? Regexp.last_match(1) : :ignore
|
255
256
|
condition = construct.match(/^#{op_rx}(?<statement>if) +(?<condition>.*?)(?=;|$)/mi)
|
256
257
|
|
257
258
|
apply_conditions([condition], variables, output)
|
258
|
-
end
|
259
|
+
end
|
260
|
+
|
261
|
+
output.normalize_operator
|
259
262
|
end
|
260
263
|
|
261
264
|
##
|
@@ -695,7 +698,7 @@ module Planter
|
|
695
698
|
#
|
696
699
|
# @return [Boolean] has selector
|
697
700
|
#
|
698
|
-
def
|
701
|
+
def selector?
|
699
702
|
self =~ /\(.\)/ ? true : false
|
700
703
|
end
|
701
704
|
end
|
data/lib/planter/tag.rb
CHANGED
@@ -28,8 +28,11 @@ module Planter
|
|
28
28
|
|
29
29
|
# Add tags to a directory.
|
30
30
|
#
|
31
|
-
# @param
|
31
|
+
# @param target [String] The directory to tag.
|
32
32
|
# @param tags [Array<String>] The tags to add.
|
33
|
+
#
|
34
|
+
# @return [Boolean] Success.
|
35
|
+
#
|
33
36
|
def add(target, tags)
|
34
37
|
return false unless TTY::Which.exist?('xattr')
|
35
38
|
|
@@ -105,6 +108,7 @@ module Planter
|
|
105
108
|
# @return [Boolean] success
|
106
109
|
#
|
107
110
|
# @api private
|
111
|
+
#
|
108
112
|
def set_tags(target, tags)
|
109
113
|
return false unless TTY::Which.exist?('xattr')
|
110
114
|
|
data/lib/planter/version.rb
CHANGED
data/lib/planter.rb
CHANGED
@@ -45,7 +45,6 @@ EXIT_CODES = {
|
|
45
45
|
# Exit the program with a message
|
46
46
|
#
|
47
47
|
# @param msg [String] error message
|
48
|
-
# @param level [Symbol] notification level
|
49
48
|
# @param code [Integer] Exit code
|
50
49
|
#
|
51
50
|
def die(msg = 'Exited', code = :canceled)
|
@@ -90,6 +89,9 @@ module Planter
|
|
90
89
|
## Accept all defaults
|
91
90
|
attr_accessor :accept_defaults
|
92
91
|
|
92
|
+
## Reader for the configuration object
|
93
|
+
##
|
94
|
+
## @return [Planter::Config] Configuration object
|
93
95
|
def config
|
94
96
|
@config ||= Config.new
|
95
97
|
end
|
@@ -127,9 +129,7 @@ module Planter
|
|
127
129
|
|
128
130
|
above_spinner ? spinner.log(out.x) : warn(out.x)
|
129
131
|
|
130
|
-
if exit_code && $stdout.isatty && (ENV['PLANTER_RSPEC'] == 'true' || ENV['PLANTER_DEBUG'] != 'true')
|
131
|
-
exit(exit_code)
|
132
|
-
end
|
132
|
+
exit(exit_code) if exit_code && $stdout.isatty && (ENV['PLANTER_RSPEC'] == 'true' || ENV['PLANTER_DEBUG'] != 'true')
|
133
133
|
|
134
134
|
true
|
135
135
|
end
|
data/planter-cli.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 2.2'
|
26
26
|
spec.add_development_dependency 'rake', '~> 13.0'
|
27
27
|
|
28
|
-
spec.add_development_dependency 'guard', '~> 2.
|
28
|
+
spec.add_development_dependency 'guard', '~> 2.16'
|
29
29
|
spec.add_development_dependency 'guard-rspec', '~> 4.5'
|
30
30
|
spec.add_development_dependency 'guard-rubocop', '~> 1.2'
|
31
31
|
spec.add_development_dependency 'guard-yard', '~> 2.1'
|
data/src/_README.md
CHANGED
@@ -307,7 +307,7 @@ Some directories like `.git` and files like `_planter.yml` are automatically ign
|
|
307
307
|
|
308
308
|
When `plant` is run, any defined variables will be requested on the command line using the defined prompt. If a `default` key is specified, hitting return at the prompt will accept the default value.
|
309
309
|
|
310
|
-
Variables can be passed on the command line with `--var KEY:VALUE`. This flag can contain a comma-separated list, e.g. `--var KEY:VALUE,KEY:VALUE` or used multiple times in the same command. Variables passed on the command line will not be prompted for when processing variables.
|
310
|
+
Variables can be passed on the command line with `--var KEY:VALUE`. This flag can contain a comma-separated list, e.g. `--var KEY:VALUE,KEY:VALUE` or be used multiple times in the same command. Variables passed on the command line will not be prompted for when processing variables.
|
311
311
|
|
312
312
|
<!--GITHUB-->
|
313
313
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: planter-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
61
|
+
version: '2.16'
|
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: '2.
|
68
|
+
version: '2.16'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard-rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -346,6 +346,7 @@ files:
|
|
346
346
|
- ".irbrc"
|
347
347
|
- ".rspec"
|
348
348
|
- ".rubocop.yml"
|
349
|
+
- ".rubocop_todo.yml"
|
349
350
|
- ".travis.yml"
|
350
351
|
- ".yardopts"
|
351
352
|
- CHANGELOG.md
|