cheftacular 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cheftacular/auditor.rb +2 -0
- data/lib/cheftacular/helpers.rb +3 -3
- data/lib/cheftacular/stateless_actions/help.rb +6 -6
- data/lib/cheftacular/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de48354bd1ec85f816c861050cd49feafabdc874
|
4
|
+
data.tar.gz: 6b7870f9aaf06cc78e48a6628302e64cfdfefe0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c465e268d416e318c181ea3f67bb15aeb554bd5c6f6b96b2cecdeefdb5694b3903e6a007cf9804626a4250cf9fda8f1d124e18eef0353607835e56b265c3fed
|
7
|
+
data.tar.gz: eea0fd5fd016033c479b5595b25327600f84eb441dc078df685e75be4eec7fc627319ecb1f8c5c6548d8038d758e093ab74ea9a0571863cc3de3af19ed78ef56
|
data/lib/cheftacular/auditor.rb
CHANGED
data/lib/cheftacular/helpers.rb
CHANGED
@@ -239,7 +239,7 @@ class Cheftacular
|
|
239
239
|
current_file_path 'node_cache'
|
240
240
|
end
|
241
241
|
|
242
|
-
def cleanup_file_caches mode='old'
|
242
|
+
def cleanup_file_caches mode='old', check_current_day_entry=false
|
243
243
|
base_dir = File.join( @config['locs']['app-root'], 'tmp', declassify )
|
244
244
|
|
245
245
|
Dir.entries(base_dir).each do |entry|
|
@@ -248,10 +248,10 @@ class Cheftacular
|
|
248
248
|
case mode
|
249
249
|
when 'old'
|
250
250
|
FileUtils.rm("#{ base_dir }/#{ entry }") if File.file?("#{ base_dir }/#{ entry }") && !entry.include?(Time.now.strftime("%Y%m%d"))
|
251
|
-
|
252
|
-
check_current_day_entry = false
|
253
251
|
when 'current'
|
254
252
|
check_current_day_entry = true
|
253
|
+
when 'current-audit-only'
|
254
|
+
FileUtils.rm("#{ base_dir }/#{ entry }") if File.file?("#{ base_dir }/#{ entry }") && entry.include?(Time.now.strftime("%Y%m%d"))
|
255
255
|
end
|
256
256
|
|
257
257
|
|
@@ -13,13 +13,15 @@ class Cheftacular
|
|
13
13
|
|
14
14
|
class StatelessAction
|
15
15
|
def help inference_modes=[]
|
16
|
-
target_command
|
17
|
-
target_command
|
16
|
+
target_command = @options['command'] == 'help' ? ARGV[1] : ARGV[0]
|
17
|
+
target_command = @config['cheftacular']['mode'] if target_command == 'current'
|
18
|
+
target_command ||= ''
|
18
19
|
|
19
20
|
case target_command
|
20
21
|
when 'action' then inference_modes << 'action'
|
21
22
|
when 'application' || 'devops' then inference_modes << 'both'
|
22
23
|
when 'stateless_action' then inference_modes << 'stateless_action'
|
24
|
+
when '' then inference_modes << 'both'
|
23
25
|
end
|
24
26
|
|
25
27
|
if @config['helper'].is_command? target_command
|
@@ -38,7 +40,7 @@ class Cheftacular
|
|
38
40
|
|
39
41
|
end if inference_modes.include?('action') || inference_modes.include?('both')
|
40
42
|
|
41
|
-
@config['stateless_action_documentation'].
|
43
|
+
@config['stateless_action_documentation'].public_methods(false).each do |method|
|
42
44
|
@config['stateless_action_documentation'].send(method)
|
43
45
|
|
44
46
|
end if inference_modes.include?('stateless_action') || inference_modes.include?('both')
|
@@ -49,15 +51,13 @@ class Cheftacular
|
|
49
51
|
|
50
52
|
puts @config['helper'].compile_documentation_lines('stateless_action').flatten.join("\n\n") if target_command == 'stateless_action'
|
51
53
|
|
52
|
-
puts @config['helper'].compile_documentation_lines('application').flatten.join("\n\n") if target_command == 'application'
|
54
|
+
puts @config['helper'].compile_documentation_lines('application').flatten.join("\n\n") if target_command == 'application' || target_command.empty?
|
53
55
|
|
54
56
|
puts @config['helper'].compile_documentation_lines('devops').flatten.join("\n\n") if target_command == 'devops'
|
55
57
|
|
56
58
|
if inference_modes.empty? && @config['helper'].is_not_command_or_stateless_command?(target_command)
|
57
59
|
methods = @config['action_documentation'].public_methods(false) + @config['action_documentation'].public_methods(false)
|
58
60
|
|
59
|
-
puts methods.sort
|
60
|
-
|
61
61
|
sorted_methods = methods.uniq.sort_by { |method| @config['helper'].compare_strings(target_command, method.to_s)}
|
62
62
|
|
63
63
|
puts "Unable to find documentation for #{ target_command }, did you mean:"
|
data/lib/cheftacular/version.rb
CHANGED