Module: Exportr::Command::Core
- Included in:
- Exportr::Command
- Defined in:
- lib/exportr/command/core.rb
Instance Method Summary collapse
- #add(val) ⇒ Object
- #clear ⇒ Object
- #help ⇒ Object
- #list ⇒ Object
- #remove(val) ⇒ Object
- #version ⇒ Object
Instance Method Details
#add(val) ⇒ Object
7 8 9 10 11 |
# File 'lib/exportr/command/core.rb', line 7 def add val log log "Adding #{val.to_a[0][0]}=#{val.to_a[0][1]} to your environment..." write_config load_config.merge(val) end |
#clear ⇒ Object
19 20 21 22 23 |
# File 'lib/exportr/command/core.rb', line 19 def clear log log "Clearing environment variables..." write_config Hash.new end |
#help ⇒ Object
41 42 43 44 45 |
# File 'lib/exportr/command/core.rb', line 41 def help STDOUT.puts STDOUT.puts parser.help STDOUT.puts end |
#list ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/exportr/command/core.rb', line 25 def list log log "Exportr Environment Variables" log "--------------------------------------------------" vars = load_config.to_a vars.each { |var| log "#{var[0]}=#{var[1]}" } log("none.") unless vars.any? log end |
#remove(val) ⇒ Object
13 14 15 16 17 |
# File 'lib/exportr/command/core.rb', line 13 def remove val log log "Removing #{val.to_a[0][0]} from your environment..." write_config load_config.reject { |k,v| k == val.to_a[0][0] } end |