Method that mutates object2242 (5/25/2011 7:22:46 PM) comp.lang.ruby Say we want to write a String method called clear that takes a given string and modifies that string to be equal to "". Ex. str = "string" we call str.clear and we get back "", not just "" printed to the scr... solomon.jas(12)
CORE - Object Instantiation and Location1626 (5/26/2011 8:23:34 AM) comp.lang.ruby #ruby 1.9 class Person def initialize(name) @name = name @where = "don't know" # end def report print "\n", @name, " instantiated in: ", @where, "\n" end end p = Person.new("Nancy") p.repo... ilias(783)
CORE - Alternative Variable Substitution1827 (6/1/2011 8:13:38 AM) comp.lang.ruby ruby 1.9 prints "#{name} has 5 credits" Is there any *existent* library (ruby 1.9) availbale, which enables an alternative variable substitution, like e.g. prints "&name has 5 credits" - -- http://lazaridi... ilias(783)
a little challenge - reproduce this error2141 (6/8/2011 12:30:51 PM) comp.lang.ruby Want to see a really amazing error I got this week? Okay... but to make it more interesting I am going to the change some names to protect the innocent, and offer up a little challenge: How can reproduce it? T... transfire(2969)
CORE - Literal Instantiation breaks Object Model535 (6/9/2011 6:39:59 PM) comp.lang.ruby class String alias_method :orig_initialize, :initialize def initialize(val) orig_initialize "OBSERVED: " + val end def my_method_test print self.inspect, " test\n" end end oo_string = String.... ilias(783)
BARRIER - require "rubygems"2750 (6/9/2011 7:11:13 PM) comp.lang.ruby ruby 1.9.2p180 Windows 7 Rubygems is included in ruby 1.9. Because it's included, I expect that it will work out-of-the-box, without the need to use ruby -rubygems myscript.rb and especially not require "r... ilias(783)
PSA: Ilias is Crazy1436 (6/10/2011 6:41:59 PM) comp.lang.ruby I guess I have to post this periodically since our population is growing = and changing so much. --- Please stop responding to Ilias, he is crazy. If you stop talking to = him, he will go away. If you don't ... ryand-ruby(1309)
RFC - One word alias for require_relative13271 (6/11/2011 5:35:01 PM) comp.lang.ruby This is a simple Request for Comments. Scenario: require_relative 'lib/alter' require 'alibrary' Some project manager complains about "require_relative", and asks you to find a one-word alias. Which name wo... ilias(783)
CORE - Inconsistent Handling of Uninitialized Variables1745 (6/15/2011 5:49:08 PM) comp.lang.ruby puts "\n== Testin in MAIN Context ==" local = 'local' @instance = 'instance' @@class = 'class' $global = 'global' puts "#@instance, #@@class, #$global, #{local}" begin puts $empty_global == nil rescue puts... ilias(783)