pluto 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pluto/cli/main.rb +21 -13
- data/lib/pluto/cli/opts.rb +10 -8
- data/lib/pluto/cli/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: d9437823f2357e73015476b3e0c005000611492e
|
4
|
+
data.tar.gz: 15c76dcacafc77b5006133ea3ad5df5140fb9c93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e627e8f0988c2ca5e66b2906eff459e16eb47e8d2aad2ec2540678c3780d547720a096cd85847e318ecf0ddcaf3ad27000c74f3ae7741a05ee43911b6e6e2d9a
|
7
|
+
data.tar.gz: e54c83e13d67b9cec8ad7d4be21ef94c458083f512de6eb0fafdd708fa896606de9439d2b961a9573592a8ec5ce95d476592459ee37ffd8020a321cefdf8cda6
|
data/lib/pluto/cli/main.rb
CHANGED
@@ -34,23 +34,34 @@ end
|
|
34
34
|
###########################
|
35
35
|
|
36
36
|
|
37
|
+
def expand_config_args( args )
|
38
|
+
## todo/check: rename method?? e.g. check_config_args
|
39
|
+
## or auto_complete_config_ars similar? why? why not??
|
37
40
|
|
41
|
+
if args.empty? ## no args? args.length == 0
|
42
|
+
['planet.ini'] # add default planet.ini for convenience
|
43
|
+
else
|
44
|
+
args # pass through as-is
|
45
|
+
end
|
46
|
+
end
|
38
47
|
|
39
|
-
## "global" options (switches/flags)
|
40
48
|
|
41
|
-
|
42
|
-
|
49
|
+
|
50
|
+
## "global" options (switches/flags)
|
43
51
|
|
44
52
|
|
45
53
|
## todo/check:
|
46
54
|
## use quiet (warn) and quieter (error) - why? why not?
|
47
55
|
## use quiet for warn level (not error) as default - why? why not?
|
48
56
|
|
57
|
+
desc 'Only show warnings, errors and fatal messages'
|
58
|
+
switch [:q, :quiet, :w, :warn], negatable: false
|
59
|
+
|
49
60
|
desc 'Only show errors and fatal messages'
|
50
|
-
switch [:
|
61
|
+
switch [:quieter, :err, :error], negatable: false
|
51
62
|
|
52
|
-
desc '
|
53
|
-
switch [:
|
63
|
+
desc '(Debug) Show debug messages'
|
64
|
+
switch [:verbose, :debug], negatable: false
|
54
65
|
|
55
66
|
|
56
67
|
|
@@ -142,8 +153,7 @@ command [:merge, :m] do |c|
|
|
142
153
|
c.action do |g,o,args|
|
143
154
|
logger.debug 'hello from merge command'
|
144
155
|
|
145
|
-
|
146
|
-
## args = expand_config_args( args ) # add missing .ini|.yml extension if missing or add default config (e.g. pluto.ini)
|
156
|
+
args = expand_config_args( args ) # if missing add default config (e.g. planet.ini)
|
147
157
|
|
148
158
|
args.each do |arg|
|
149
159
|
name = File.basename( arg, '.*' )
|
@@ -193,8 +203,7 @@ command [:update, :up, :u] do |c|
|
|
193
203
|
c.action do |g,o,args|
|
194
204
|
logger.debug 'hello from update command'
|
195
205
|
|
196
|
-
|
197
|
-
## args = expand_config_args( args ) # add missing .ini|.yml extension if missing or add default config (e.g. pluto.ini)
|
206
|
+
args = expand_config_args( args ) # if missing add default config (e.g. planet.ini)
|
198
207
|
|
199
208
|
args.each do |arg|
|
200
209
|
name = File.basename( arg, '.*' )
|
@@ -256,8 +265,7 @@ command [:build, :b] do |c|
|
|
256
265
|
c.action do |g,o,args|
|
257
266
|
logger.debug 'hello from build command'
|
258
267
|
|
259
|
-
|
260
|
-
## args = expand_config_args( args ) # add missing .ini|.yml extension if missing or add default config (e.g. pluto.ini)
|
268
|
+
args = expand_config_args( args ) # if missing add default config (e.g. planet.ini)
|
261
269
|
|
262
270
|
args.each do |arg|
|
263
271
|
name = File.basename( arg, '.*' )
|
@@ -348,7 +356,7 @@ pre do |g,c,o,args|
|
|
348
356
|
LogUtils::Logger.root.level = :debug
|
349
357
|
elsif opts.warn?
|
350
358
|
LogUtils::Logger.root.level = :warn
|
351
|
-
elsif opts.
|
359
|
+
elsif opts.error?
|
352
360
|
LogUtils::Logger.root.level = :error
|
353
361
|
else
|
354
362
|
## do nothing; keep :info level (default)
|
data/lib/pluto/cli/opts.rb
CHANGED
@@ -15,16 +15,16 @@ class Opts
|
|
15
15
|
# use a single (internal) variable for log level - why? why not?
|
16
16
|
|
17
17
|
if options[:verbose] == true ## debug level
|
18
|
-
@verbose = @warn = @
|
18
|
+
@verbose = @warn = @error = true
|
19
19
|
end
|
20
20
|
|
21
|
-
if options[:warn] == true ## warn level
|
22
|
-
@warn = @
|
21
|
+
if options[:warn] == true ## warn level -- alias for quiet
|
22
|
+
@warn = @error = true
|
23
23
|
@verbose = false
|
24
24
|
end
|
25
25
|
|
26
|
-
if options[:
|
27
|
-
@
|
26
|
+
if options[:error] == true ## error level -- alias for quieter
|
27
|
+
@error = true
|
28
28
|
@verbose = @warn = false
|
29
29
|
end
|
30
30
|
|
@@ -60,16 +60,18 @@ class Opts
|
|
60
60
|
|
61
61
|
|
62
62
|
## # note: always assumes true for now for verbose/quiet/warn; default is false
|
63
|
+
## todo: switch verbose to debug internally - why? why not?
|
63
64
|
def verbose=(value) @verbose = true; end
|
64
65
|
def verbose?() @verbose || false; end
|
65
66
|
def debug?() @verbose || false; end ## add debug? alias for verbose
|
66
67
|
|
67
68
|
def warn=(value) @warn = true; end
|
68
69
|
def warn?() @warn || false; end
|
70
|
+
def quiet?() @warn || false; end ## add quiet? alias for warn
|
69
71
|
|
70
|
-
def
|
71
|
-
def
|
72
|
-
def
|
72
|
+
def error=(value) @error = true; end
|
73
|
+
def error?() @error || false; end
|
74
|
+
def quieter?() @error || false; end ## add quieter? alias for error
|
73
75
|
|
74
76
|
|
75
77
|
|
data/lib/pluto/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pluto-models
|