Pass by reference versus pass by value

Posted on: Friday, Mar 7, 2014

I’m currently studying Ruby and Rails with the Tealeaf Academy. It’s going well and it’s really fun to study Ruby. After years of Java, I feel Ruby is being a step forward.

During the study, the subject of Ruby’s passing by reference or passing by values.  (For the less-technical readers; this is the difference between passing the value of a variable to a method or passing only a reference to the value to a method. The latter enables the possibility of modifying the original variable by using the reference.)

Unfortunately, the whole subject of Ruby being either pass by reference or pass by value wasn’t clear to me. So I did some Googling to find out the answer. This confused me even more because some people are convinced it’s pass by reference and others are convinced it’s pass by value.
Having a Java background, I was convinced it’s pass by reference as it’s possible to modify the original object in a method using the method parameter as a reference.

Read the rest of this entry »

Here’s a post of something that I wanted to make a note of and may be useful to keep.

I got an error when trying to do a Maven release. I was using the command:

mvn release:prepare

and getting the following:

[ERROR] Provider message:
[ERROR] The svn tag command failed.
[ERROR] Command output:
[ERROR] svn: OPTIONS of 'http://extranet.esperantoxl.nl/subversion/': authorization failed: Could not authenticate to server: rejected Basic challenge (http://extranet.esperantoxl.nl)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I’m not sure where my authentication details were getting lost, but as a workaround, I added the authentication on the command line:

mvn release:prepare -Dusername=[username] -Dpassword=[password]