T
Thomas Foster
I am new to ruby, but have been writing some code to understand it better. I am writing this post because I need some help with determining where SystemStackError is located...I am trying to use a ruby library to automate building vms in vmware an I see this error everytime I run the code.
/usr/local/rvm/gems/ruby-1.9.3 p545/gems/fog-.20.0/lib/fog/core/collection.rb stack level too deep (SystemStackError)
Here is the line that generates the error and I am trying to see if I can resolve this problem (with the help of you guys). I appreciate any help..Hopefully you can point me in the right direction so I can try and fix this problem.
def inspect
Thread.current[:formatador] ||= Formatador.new
data = "#{Thread.current[:formatador].indentation}<#{self.class.name}\n"
Thread.current[:formatador].indent do
unless self.class.attributes.empty?
data << "#{Thread.current[:formatador].indentation}"
data << self.class.attributes.map {|attribute| "#{attribute}=#{send(attribute).inspect}"}.join(",\n#{Thread.current[:formatador].indentation}")
data << "\n"
end
data << "#{Thread.current[:formatador].indentation}["
unless self.empty?
data << "\n"
Thread.current[:formatador].indent do
data << self.map {|member| member.inspect}.join(",\n")
data << "\n"
end
data << Thread.current[:formatador].indentation
end
data << "]\n"
end
data << "#{Thread.current[:formatador].indentation}>"
data
end
If you need more info, please let me know.
/usr/local/rvm/gems/ruby-1.9.3 p545/gems/fog-.20.0/lib/fog/core/collection.rb stack level too deep (SystemStackError)
Here is the line that generates the error and I am trying to see if I can resolve this problem (with the help of you guys). I appreciate any help..Hopefully you can point me in the right direction so I can try and fix this problem.
def inspect
Thread.current[:formatador] ||= Formatador.new
data = "#{Thread.current[:formatador].indentation}<#{self.class.name}\n"
Thread.current[:formatador].indent do
unless self.class.attributes.empty?
data << "#{Thread.current[:formatador].indentation}"
data << self.class.attributes.map {|attribute| "#{attribute}=#{send(attribute).inspect}"}.join(",\n#{Thread.current[:formatador].indentation}")
data << "\n"
end
data << "#{Thread.current[:formatador].indentation}["
unless self.empty?
data << "\n"
Thread.current[:formatador].indent do
data << self.map {|member| member.inspect}.join(",\n")
data << "\n"
end
data << Thread.current[:formatador].indentation
end
data << "]\n"
end
data << "#{Thread.current[:formatador].indentation}>"
data
end
If you need more info, please let me know.