Class: EnvLint::EnvKeyParser

Inherits:
Object
  • Object
show all
Defined in:
lib/env_lint/env_key_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse_args(args) ⇒ Object



3
4
5
# File 'lib/env_lint/env_key_parser.rb', line 3

def parse_args(args)
  args.map { |arg| arg.split('=').first if arg.include?('=') }.compact
end

#parse_export_output(text) ⇒ Object



7
8
9
# File 'lib/env_lint/env_key_parser.rb', line 7

def parse_export_output(text)
  parse_args(text.split(/[\n\r]/).map { |line| line.gsub('declare -x', '').strip })
end