Class: Builtins::EnvDiff

Inherits:
Builtin show all
Defined in:
lib/builtins/envdiff.rb

Instance Attribute Summary

Attributes inherited from Builtin

#args, #config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Builtin

class_for, #initialize

Constructor Details

This class inherits a constructor from Builtin

Class Method Details

.descriptionObject



8
9
10
# File 'lib/builtins/envdiff.rb', line 8

def description
	"compares keys present in config and secrets between different environments"
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/builtins/envdiff.rb', line 13

def run
	check_args

	if source_only_keys.empty? && dest_only_keys.empty?
		Output.out("Environments '#{source_env}' and '#{dest_env}' define the same #{source_keys.length} key(s).")
		return
	end

	output_key_summary(source_only_keys, source_env, dest_env) if source_only_keys.any?
	output_key_summary(dest_only_keys, dest_env, source_env) if dest_only_keys.any?
end