Simplify Remote::Environment
This commit is contained in:
@@ -42,7 +42,7 @@ module Producer
|
||||
end
|
||||
|
||||
def environment
|
||||
Environment.new_from_string(execute 'env')
|
||||
Environment.string_to_hash(execute 'env')
|
||||
end
|
||||
|
||||
def cleanup
|
||||
|
@@ -6,19 +6,6 @@ module Producer
|
||||
def string_to_hash(str)
|
||||
Hash[str.each_line.map { |l| l.chomp.split '=', 2 }]
|
||||
end
|
||||
|
||||
def new_from_string(str)
|
||||
new string_to_hash str
|
||||
end
|
||||
end
|
||||
|
||||
extend Forwardable
|
||||
def_delegators :@variables, :[], :key?
|
||||
|
||||
attr_reader :variables
|
||||
|
||||
def initialize(variables)
|
||||
@variables = variables
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user