Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6926

I need help understanding some code..

Newsgroups comp.lang.ruby
Date 2014-03-05 11:55 -0800
Message-ID <201e9c0c-0723-49b1-8021-a72d7caf0987@googlegroups.com> (permalink)
Subject I need help understanding some code..
From Thomas Foster <thomas.foster80@gmail.com>

Show all headers | View raw


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.

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

I need help understanding some code.. Thomas Foster <thomas.foster80@gmail.com> - 2014-03-05 11:55 -0800
  Re: I need help understanding some code.. Thomas Foster <thomas.foster80@gmail.com> - 2014-03-05 11:56 -0800
  Re: I need help understanding some code.. Thomas Foster <thomas.foster80@gmail.com> - 2014-03-05 13:07 -0800
    Re: I need help understanding some code.. Robert Klemme <shortcutter@googlemail.com> - 2014-03-07 08:43 +0100

csiph-web