How do I get ruby to print a full backtrace instead of a truncated one?
When I get exceptions, it is often from deep within the call stack. When this happens, more often than not, the actual offending … Read more
When I get exceptions, it is often from deep within the call stack. When this happens, more often than not, the actual offending … Read more
To generate a random number between 3 and 10, for example, I use: rand(8) + 3 Is there a nicer way to do … Read more
In general, what are the advantages and disadvantages of using an OpenStruct as compared to a Struct? What type of general use-cases would … Read more
After running the bundle install command, ‘Gemfile.lock‘ is created in the working directory. What do the directives inside that file mean? For example, … Read more
I read https://stackoverflow.com/questions/826734/when-do-ruby-instance-variables-get-set but I’m of two minds when to use class instance variables. Class variables are shared by all objects of a … Read more
Background: I have a module which declares a number of instance methods module UsefulThings def get_file; … def delete_file; … def format_text(x); … … Read more
I’m new to Ruby and don’t know how to add new item to already existing hash. For example, first I construct hash: hash … Read more
I have a large hash with nested arrays and hashes. I would like to simply print it out so it ‘readable’ to the … Read more
I would like to test whether a class inherits from another class, but there doesn’t seem to exist a method for that. class … Read more
It’s easy enough to read a CSV file into an array with Ruby but I can’t find any good documentation on how to … Read more