Description:
The Ruby dynamic OO programming language.
|
|
|
Same name for class and instance method
|
| |
Newbie here. Consider the following two "say" methods. irb(main):020:0> class Test2 irb(main):021:1> def self.say(block) irb(main):022:2> block.call(self.class) irb(main):023:2> end irb(main):024:1> def say(block) irb(main):025:2> block.call(self.class) irb(main):026:2> end irb(main):027:1> end... more »
|
|
How to alias_method_chain initialize from a mixin.
|
| |
Hi, I've been having a little trouble the past couple days getting an alias_method_chain working on the initialize method via a module getting mixed into a class. For example: - - - - - module Dsl def self.included(base) base.instance_eval do include InstanceMethods alias_method :initialize_without_block_supp ort, :initialize... more »
|
|
loofah 0.4.0 Released
|
| |
[Note: parts of this message were removed to make it a legal post.] loofah version 0.4.0 has been released! * <[link]> * <[link]> * <[link]> Loofah is a general library for manipulating HTML/XML documents and fragments. It's built on top of Nokogiri and libxml2, so it's fast and... more »
|
|
really crazy about this (do/while)
|
| |
Hello, Please see the code and running result below: ...[root@localhost tmp]# cat t5.rb temp = 98.4 i = 0 begin i += 1 puts "step" + i.to_s + " befre adding is " + temp.to_s temp += 0.1 puts "step" + i.to_s + " after adding is " + temp.to_s puts end while temp < 98.6 [root@localhost tmp]# ruby t5.rb... more »
|
|
How to match and count
|
| |
Hello, I have been using awk for some text handling. Now I'm beginning Ruby (really newbie) and want to find a way in ruby to do this with awk: awk '{if ($4~/something/) {i+=1}} END {print i}' file.txt That means if a line's 4th field match "something" then increase the counter by 1. How to write the corresponding ruby code?... more »
|
|
RubyScript2exe
|
| |
hey guys im trying to use RubyScript2exe but im getting this error [link] <= the picture of the error someone knows whats the problem? thanks
|
|
All in one Ruby - HELP!
|
| |
Hey guys! im trying to run my Ruby scripts in a computer that havent got the Ruby interpreter, and my script use a GUI based on GTK. to make this standalone ruby im using All in One Ruby. but the GTK libs and stuff are not in the package. what shoud i do? thanks
|
|
Order of evaluation and precedence
|
| |
In _The Ruby Programming Language_, it is asserted that order of evaluation is controlled by precedence. However, this is often asserted in books about C, where it's definitely not true. Is it actually true in Ruby? In other words: def a puts "a" 1 end def b puts "b" 1 end def c puts "c"... more »
|
|
issues with Kernel#select
|
| |
Waking up a thread that is waiting in Kernel#select does not appear to work in ruby 1.9 Can someone please confirm that this is the case. Is this the intended behavior, or is this a bug? ...require 'socket' pair = Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM, 0) t = Thread.new { Kernel.select pair, nil, nil, nil... more »
|
|
|