How to order a hash based on its keys?1130 (6/21/2011 2:34:16 PM) comp.lang.ruby Hi, I want to order a hash using itds keys: irb> a =3D { 2=3D>"2", 3=3D>"3", 1=3D>"1" } irb> a.sort [[1, "1"], [2, "2"], [3, "3"]] But I want a resulting hash with keys ordered: { 1=3D>"1", 2=3D>"2",... UTF
Where is the #hash method defined?542 (6/8/2011 10:47:02 PM) comp.lang.ruby Hi, any object in Ruby has the method #hash which returns an integer unique for the object (such value doesn't change during the lifetime of the Ruby process). I cannot find which class or module #hash method ... UTF
Using sprintf() to print a Hash1143 (5/24/2011 11:45:29 AM) comp.lang.ruby Hi, I just have a single Hash and want to print it into the standar output as follows (key: value): ------------------------------------ listen_ip: 1.2.3.4 listen_port: 90 use_tls: ... UTF
UDPSocket does not work with IPv6 ?038 (5/11/2011 3:34:28 PM) comp.lang.ruby Hi, I've a IPv6 address in my host. ------------------------ UDPSocket.open do |s| s.connect "2001:838:2:1::30:67", 1 end ------------------------- =3D> Errno::EAFNOSUPPORT: Address family not supported by... UTF
How to get the IPs of all the interfaces in my host?337 (5/11/2011 2:13:11 PM) comp.lang.ruby Hi, basically I'm looking for a way to find all the IP's in the network interfaces of my computer in a reliable way. I know a "workaround": -------------------------- UDPSocket.open {|s| s.connect "1.2.3.4", ... UTF
Documentation about ruby-openssl345 (5/4/2011 11:16:33 AM) comp.lang.ruby Hi, is there somewhere good documentation about ruby-openssl API? or any good tutorial? The RDOC is hard to read: http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/index.html Thanks a lot. PD: Is there an... UTF
Is it usual/valid to extend custom classes under Errno module?423 (4/22/2011 6:15:25 PM) comp.lang.ruby Hi, I've coded a DNS library. When a DNS query fails my library doesn't raise an exception (as it's expensive) but instead returns a Symbol (more efficient): - :dns_error_nxdomain - The domain name does not ex... UTF
Calling a custom Ruby C extension method from other C extension238 (4/19/2011 8:32:52 PM) comp.lang.ruby Hi, in my project I've created two Ruby C extensions: ext/my-exten/ ext/string/ They create my-create.so and string.so. string.so contains some custom methods I've added to class String (i.e. String#head... UTF
Get the real object in a Hash key1321 (4/15/2011 12:50:42 PM) comp.lang.ruby Hi, let's suppose this simple code in which I add internal attributes to String instances and use such String objects as Hash keys: ------------------------------------------------ h =3D {} k1 =3D "aaa" k1.in... UTF
Wrap external source file in a module564 (5/1/2011 5:55:18 PM) comp.lang.ruby Hello, i have another question. I have a strange situation which i have not resolved yet where for some reason i have to wrap several classes in a module, otherwise the program doesn't work as expected (by me ... muranov(4)
Documentation about ruby-openssl345 (5/4/2011 11:16:33 AM) comp.lang.ruby Hi, is there somewhere good documentation about ruby-openssl API? or any good tutorial? The RDOC is hard to read: http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/index.html Thanks a lot. PD: Is there an... ibc(607)
Ruby Activity2327 (5/7/2011 4:17:44 PM) comp.lang.ruby Is ruby still being developed? The official site has last release in dec 2010. The other thing is are any of the GUI toolkits still being developed. Most of them date back to 2009 or later. I love ruby but I... kajisakka(8)
How to get the IPs of all the interfaces in my host?337 (5/11/2011 2:13:11 PM) comp.lang.ruby Hi, basically I'm looking for a way to find all the IP's in the network interfaces of my computer in a reliable way. I know a "workaround": -------------------------- UDPSocket.open {|s| s.connect "1.2.3.4", ... ibc(607)
Using sprintf() to print a Hash1143 (5/24/2011 11:45:29 AM) comp.lang.ruby Hi, I just have a single Hash and want to print it into the standar output as follows (key: value): ------------------------------------ listen_ip: 1.2.3.4 listen_port: 90 use_tls: ... ibc(607)
Changes for Ruby in Debian (and Ubuntu)1336 (5/24/2011 9:48:56 PM) comp.lang.ruby Hi, Since the beginning of 2011, the Debian Ruby team has been working on several big changes. Those changes all are available in Debian unstable, some of them are also available in Debian testing, and they sh... lucas(25)
Where is the #hash method defined?542 (6/8/2011 10:47:02 PM) comp.lang.ruby Hi, any object in Ruby has the method #hash which returns an integer unique for the object (such value doesn't change during the lifetime of the Ruby process). I cannot find which class or module #hash method ... ibc(607)
RFC - One word alias for require_relative13277 (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)
How to order a hash based on its keys?1130 (6/21/2011 2:34:16 PM) comp.lang.ruby Hi, I want to order a hash using itds keys: irb> a =3D { 2=3D>"2", 3=3D>"3", 1=3D>"1" } irb> a.sort [[1, "1"], [2, "2"], [3, "3"]] But I want a resulting hash with keys ordered: { 1=3D>"1", 2=3D>"2",... ibc(607)