Class: Infrastructure::Formatters::BashSource
- Defined in:
- lib/infrastructure/formatters/bash_source.rb
Overview
transform hashes to bash source format
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#format(hash) ⇒ String
11 12 13 14 15 16 |
# File 'lib/infrastructure/formatters/bash_source.rb', line 11 def format(hash) hash.map do |key, value| val = value.gsub(/[']/, "'" => "\\'") "export #{key}='#{val}'\n" end.join end |