>> a = [1, 2, 3]
=> [1, 2, 3]
>> i = 'i will want to use this'
=> "i will want to use this"
>> a.each do |i|
?> puts i
>> end
1
2
3
=> [1, 2, 3]
>> i
=> 3

Should not be there in 1.9, the variable i should be local for the block.

The Sinatra framework is fun. For one page but dynamic site like the one I just built (Livispace company web site) it is ideal. Very simple; you don’t generate any files you won’t use, but still have the separation of views/controllers/models (called the MVC pattern by some;).

Now will need to figure out how to deamonize (and start/stop) cleanly. Seems like God might help.

Just svn export checkouts of tags/branches you use and trunk and create branches for them in the new Git repository. How often do you need anything from the history apart from the above? Let me rephrase: How often do you need to find the culprit instead of concentrating on fixing the problem?

Isn’t newest autotest (from ZenTest 3.10.0) working with RSpec for you? Like many times before..? Use the autospec command! I didn’t even know this existed..

From the HyperactiveResource source code:

#This means someone has set blah_ids = [1,2,3]
#Instead of being retarded like ActiveResource normally is,
#Let’s turn this into “1,2,3″

Funny.

“There is one special requirement for evoking a sub-routine within a tell block: it must be preceded by the word “my“. Doing so identifies to the script that the sub-routine name belongs to the script and not to the object targeted by the tell block.”

Who is this designed for? Not for me; I can’t get into the syntax :/

The job has been done for you in Facets:

>> require 'facets'
>> ['ab', 'cd', 'abc'].uniq_by {|i| i.length}
=> ["ab", "abc"]

And similar errors. An application that has old Rails “frozen” in vendor/rails stopped working when you did gem clean? The problem might be that action_web_service (which is not in vendor/rails) pulls in new versions of libraries from currently installed gems. What you need to do is put (uncomment) the following in Rails::Initializer.run do |config| in environment.rb:

  config.frameworks -= [ :action_web_service]

This was rather a note to self; did it help you?

An SSH private key can’t have an extension to be used by Ruby Net::SFTP. So if your private key name is key.priv, it won’t work with Net::SFTP:

Net::SFTP.start(host, user, :keys => ['key.priv']) # will ask for a password

While you can use such a key with “command line” SSH:

ssh -i key.priv host # will work just fine

If you rename the file not to have he extension (to “key” only), it’ll work. Didn’t find where to submit bugs, writing a post only. Not too big of a deal anyway. Just so you know.

DataMapper (dm-core, dm-more):

rake install SUDOLESS=true

Merb (merb-core, merb-more, merb-plugins):

rake install MERB_SUDO=

oh, well.