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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12c68dae2b3404d2b6bfb5e90d65988a817e05f0
4
- data.tar.gz: 63865f5cb4df9d9fa5a6757bc68cdcb895efc732
3
+ metadata.gz: d9437823f2357e73015476b3e0c005000611492e
4
+ data.tar.gz: 15c76dcacafc77b5006133ea3ad5df5140fb9c93
5
5
  SHA512:
6
- metadata.gz: a2c924baf3e216458ccf3ce8f4234a91a791d3c58f6759fff098681671da13ad07fa93011f7c3fa9c50c6688ce33e5054770f09075ad53df654d5767c023a366
7
- data.tar.gz: 9bbb372a6a0804b804d4eebe3e12e71915d5a9d6d3d244c1fa4674b3c7bffcb05dd05c5ef5cb382b977c1c2f67a816b0c49fca72f4363e75435a8c281f45e6e0
6
+ metadata.gz: e627e8f0988c2ca5e66b2906eff459e16eb47e8d2aad2ec2540678c3780d547720a096cd85847e318ecf0ddcaf3ad27000c74f3ae7741a05ee43911b6e6e2d9a
7
+ data.tar.gz: e54c83e13d67b9cec8ad7d4be21ef94c458083f512de6eb0fafdd708fa896606de9439d2b961a9573592a8ec5ce95d476592459ee37ffd8020a321cefdf8cda6
@@ -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
- desc '(Debug) Show debug messages'
42
- switch [:verbose, :debug], negatable: false
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 [:q, :quiet, :err, :error], negatable: false
61
+ switch [:quieter, :err, :error], negatable: false
51
62
 
52
- desc 'Only show warnings, errors and fatal messages'
53
- switch [:w, :warn], negatable: false
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
- ## note: no more "magic" - remove expand_config_args!! - always pass in planet.ini or similar
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
- ## note: no more "magic" - remove expand_config_args!! - always pass in planet.ini or similar
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
- ## note: no more "magic" - remove expand_config_args!! - always pass in planet.ini or similar
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.quiet?
359
+ elsif opts.error?
352
360
  LogUtils::Logger.root.level = :error
353
361
  else
354
362
  ## do nothing; keep :info level (default)
@@ -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 = @quiet = true
18
+ @verbose = @warn = @error = true
19
19
  end
20
20
 
21
- if options[:warn] == true ## warn level
22
- @warn = @quiet = true
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[:quiet] == true ## error level (for now) - why? why not?
27
- @quiet = true
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 quiet=(value) @quiet = true; end ## use error/error? - why? why not?
71
- def quiet?() @quiet || false; end
72
- def error?() @quiet || false; end ## add error? alias for quiet
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
 
@@ -4,7 +4,7 @@ module PlutoCli
4
4
 
5
5
  MAJOR = 1
6
6
  MINOR = 3
7
- PATCH = 0
7
+ PATCH = 1
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
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.0
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-26 00:00:00.000000000 Z
11
+ date: 2017-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pluto-models