Method: Nugrant::Helper::Env::Exporter.terminal_exporter
- Defined in:
- lib/nugrant/helper/env/exporter.rb
permalink .terminal_exporter(bag, options = {}) ⇒ side-effect
Export to terminal the commands that are required to export or unset a bunch of environment variables taken from the bag.
Options:
* :escape_value => If true, escape the value to export (or unset), default to true.
* :io => The io where the command should be displayed, default to $stdout.
* :namer => The namer used to transform bag segments into variable name, default to Namer::default().
* :override => If true, variable a exported even when the override an existing env key, default to true.
* :type => The type of command, default to :export.
99 100 101 102 103 104 105 106 |
# File 'lib/nugrant/helper/env/exporter.rb', line 99 def self.terminal_exporter(bag, = {}) io = [:io] || $stdout type = [:type] || :export export(bag, ) do |key, value| io.puts(command(type, key, value, )) end end |