Class: LinuxEnvironmentReader
- Defined in:
- lib/teuton-get/reader/linux_environment_reader.rb
Instance Method Summary collapse
-
#initialize(command) ⇒ LinuxEnvironmentReader
constructor
A new instance of LinuxEnvironmentReader.
- #read ⇒ Object
Methods inherited from Reader
Constructor Details
#initialize(command) ⇒ LinuxEnvironmentReader
Returns a new instance of LinuxEnvironmentReader.
4 5 6 |
# File 'lib/teuton-get/reader/linux_environment_reader.rb', line 4 def initialize(command) @command = command end |
Instance Method Details
#read ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/teuton-get/reader/linux_environment_reader.rb', line 8 def read lines = @command.split("\n") data = {} lines.sort.each do |line| items = line.split("=") if items.size == 2 data[items[0].strip] = items[1].strip end end data end |