Archive for 'Ruby'

Ruby vs Python

Python vs. Ruby: A Battle to The Death

Hidden Gems of Ruby 1.9

At GoGaRuco (Golden Gate RubyConf) in San Francisco, CA today… Talk by Aaron Patterson minitest require ‘minitest/autorun’ refute_equal (same as assert_not in TestUnit) inherit from MiniTest::Unit::TestCase Test Performance Run test with -verbose, you can see how long each test takes. minitest/spec (similar to rspec) ——— ObjectSpace ObjectSpace.each_object do |obj| p obj end count_object_size (to see [...]

Lightning Talks at GoGaRuco

At GoGaRuco (Golden Gate RubyConf) today in San Francisco, CA The following is just some brief notes and may or may not make any sense. Talks went pretty quickly. Concurrency with Rubinius Ron Evans – TicketMaster (universal api) – allows migration of one system to another. (supports JIRA amongst other things) —– Fixture Builder by [...]

Data-Driven Government and the Ruby Developer

At GoGaRuCo (Golden Gate RubyConf) today in San Francisco, CA… Talk by Eric Mill who works at Sunlight Labs and who is working with government to make their data public. Here are some examples of where you can get data. Data SF.org Californa Data Chicago Every Block New York Data Mine United States Data GovTrack.us [...]

Ruby APIs for NoSQL

At GoGaRuco (Golden Gate RubyConf) today in San Francisco, CA… Talk by: Sarah Mei, Pivotal Labs How you store data in Ruby without using a relational database. ActiveModel compliant libraries mongoDB: mongoid – gem: mongoid How do you unify a model with a data scattered across multiple stores? This is not solved yet. How do [...]

Succeeding at Open Source Development

At GoGaRuco (Golden Gate RubyConf) today… Here’s what I got out of the Open Source Development talk: If you want to build up your open source project and manage it properly, you have to be open to newer contributors who are enthusiastic, even if they build a feature you think is useless. Communication is important. [...]

RVM and Frozen Rails Conflict

I have an existing rails application and want to switch to using RVM in order to tie particular versions of Ruby, Rails and RubyGems to this application. My existing Rails application has a frozen Rails version 2.2.2 tied into it and so exists in my vendor/rails directory. Before I installed RVM, the following question came [...]

Ruby File Path Separators

File path separators on Unix systems and Windows are different. On Unix, a forward slash / is used and on Windows a backslash \ is used. However, when writing Ruby code you don’t need to worry about this; Just use the forward slash / character and it will be cross-platform for you. An even better [...]

Instance and Class Variable Accessor Methods

When you define classes in Ruby, you must specify what kind of access you want to give Instance and Class attributes/variables which are defined in that class. The way you do it is that you write reader and writer methods. You can write these methods out explicitly or use the shorthand attribute (attr_) methods like [...]

Ruby Iterators

Here are some Ruby Iterators and description of how they can be used: times Iterate through the block 3 times, n starts at 0 and ends at 2 and is incremented by 1 each time. n is the block variable. upto Iterate through the block 3 times, starting at 1 and ending at 3, each [...]