Neither ruby and nor irb can load .rb file in current directory
None of these worked for me, but this did: irb -I . >require ‘file’ => true
None of these worked for me, but this did: irb -I . >require ‘file’ => true
Examples 2 and 3 are exactly the same. Modules and classes are also objects, and defining a singleton method on a object actually defines it on its singleton class. With that said, and since you have already established instance variable access is thread safe, examples 2 and 3 are thread safe. Example 1 should also … Read more
If you put the RVM source line in your bashrc (in order to ensure that non-interactive shells have access to RVM), you will need to source .bashrc from your .bash_profile with the following as the last lines in your .bash_profile if [ -f “$HOME/.bashrc” ]; then source $HOME/.bashrc fi This pre-supposes that you have [[ … Read more
Here is the way I fix the “invalid date format in specification” error: 1.) Go to the specifications folder located at: /usr/local/lib/ruby/gems/1.8/specifications/ 2.) Find the spec that is causing the problem. 3.) Change s.date = %q{2011-05-21 00:00:00.000000000Z} to s.date = %q{2011-05-21} That’s a WIN for me! Good Luck
TestClass.methods(false) to get only methods that belong to that class only. TestClass.instance_methods(false) would return the methods from your given example (since they are instance methods of TestClass).