This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
Trying to debug what may be a require/load problem in my environment (just printing $" & $: was not enough) I was hoping to wrap the load method, but my expected print statements do not execute, so I assume that the following did not work as I had hoped
module Kernel
alias :old_load :load
def load(fname, wrap=false)
puts "loading #{fname}"
old_load fname, wrap
end
end
So is it generally possible to wrap kernel methods (using aliases or otherwise)? If so whats would be the right syntax?
Thanks
Related
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
Any time I want to use ruby's ri tool, (e.g. after typing something like ri GC), after it shows the documentation, I can find no way of exiting it and none of the usual key combinations for terminating a command-line command works. Because of that I'm forced to close the whole terminal window to continue my works.
How can I quit normally from ri after it showed documentation?
The answer is to simply type q and it will exit.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
Can anyone tell me what is the difference between parse and foreach in CSV?
Check Ruby Document here.
Generally speaking, #parse is used to parse a string while #foreach is for a file.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
Even though I'm using different ajaxUrl's. Like ajax01Url, ajax02Url, etc. Each one of them with its own typeNum. I keep getting the same array content in function(data).
Any suggestions how to clean this?
It was my own fault, I had a typo on the action name :)
I was calling the two different uri.action with the same name. Even though they have different pageType.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I have this regex:
diff.\*\n.\*\n.\*\n.\*\n.\*\n
I want to match everything from the word "diff" to the fifth new line. Can someone simplify it for me?
You need grouping:
diff(?:.*\n){5}
I think you are asking for this:
/diff(.*\n){5}/
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I noticed in the Cell > Cell properties menu an item I assume was recently added, but I really wouldn't know for sure (8.0.4/Win here). It's called Initialization Command:
Nothing about it to be found in my documentation center. Neither does it seem to be in the online reference:
Any idea what this is supposed to do? As far as I can see its effect is the same as the Initialization Cell menu item.