# Ruby

**URL:** https://www.ruby-forum.com/c/ruby/7.md?page=514

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 515

---

## [Is this an executable code?](https://www.ruby-forum.com/t/is-this-an-executable-code/197572)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 8\
**Last updated:** [October 16, 2010, 1:54pm UTC](https://www.ruby-forum.com/t/is-this-an-executable-code/197572 "2010-10-16T13:54:34Z")

</div>

Time.local(year, month, day, hour, min, sec, msec) I typed this in IRB and it was “undefined local variable or method ‘year’…” Is ‘local’ a method for the Time class? Thanks guys

---

## [Getting the size of a block device](https://www.ruby-forum.com/t/getting-the-size-of-a-block-device/196237)

<div class="topic-metadata">

**Author:** [@callyworld](https://www.ruby-forum.com/u/callyworld)\
**Replies:** 3\
**Last updated:** [October 16, 2010, 5:54am UTC](https://www.ruby-forum.com/t/getting-the-size-of-a-block-device/196237 "2010-10-16T05:54:59Z")

</div>

In Linux at least, one cannot simply get the size of a block device file (e.g., /dev/sda) by using the normal means of requesting the file size. One must use a special command, such as /sbin/blockdev --getsz /dev/sda …

---

## [Helping with Ruby, where to start?](https://www.ruby-forum.com/t/helping-with-ruby-where-to-start/196349)

<div class="topic-metadata">

**Author:** [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Replies:** 9\
**Last updated:** [October 16, 2010, 4:12am UTC](https://www.ruby-forum.com/t/helping-with-ruby-where-to-start/196349 "2010-10-16T04:12:39Z")

</div>

How does one start to help the Ruby community? I figure the best way to learn and build better Ruby skills is start by fixing bugs or help with testing. I keep telling myself I know Ruby =P I mean I’ve been coding in …

---

## [Redmine's Ruby 1.x.x project name is renamed](https://www.ruby-forum.com/t/redmines-ruby-1-x-x-project-name-is-renamed/197565)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [October 16, 2010, 3:43am UTC](https://www.ruby-forum.com/t/redmines-ruby-1-x-x-project-name-is-renamed/197565 "2010-10-16T03:43:13Z")

</div>

$B@.@%$G$9!#(B FYI $B$G$9$,!"(BRedmine $B$N(B Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2 $B$N%W%m%8%’%/%HL\>$r!"(B Backport186 $B$d(B Archive191 $BEy$KJQ99$7$^$7$?!#(B $BM}M3$O%P%0Js9p$r(B $B%P!\<%8%g%s8GM-$N%A%1%C%H$H$7$F$7$h$&$…

---

## [Questions about JRuby + Java 7](https://www.ruby-forum.com/t/questions-about-jruby-java-7/197563)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [October 16, 2010, 2:48am UTC](https://www.ruby-forum.com/t/questions-about-jruby-java-7/197563 "2010-10-16T02:48:04Z")

</div>

Hi JRuby folk, I’ve got some questions about JRuby internals that I hope someone on this list can help answer: The JSR 292http://java.sun.com/developer/technicalArticles/DynTypeLang/index.htmlhomepage talks about t…

---

## [Embedded JRuby in Java](https://www.ruby-forum.com/t/embedded-jruby-in-java/196110)

<div class="topic-metadata">

**Author:** [@Shay\_B](https://www.ruby-forum.com/u/Shay_B)\
**Replies:** 3\
**Last updated:** [October 16, 2010, 2:24am UTC](https://www.ruby-forum.com/t/embedded-jruby-in-java/196110 "2010-10-16T02:24:52Z")

</div>

Hi, I want to embed JRuby in Java in order to execute ruby code that is provided by the user (can be cached/compiled), unique scripts don’t expect to be in the 10s. The JSR / BSF options are problematic, due to the …

---

## [Ruby Standard Environment](https://www.ruby-forum.com/t/ruby-standard-environment/197532)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 4\
**Last updated:** [October 16, 2010, 12:42am UTC](https://www.ruby-forum.com/t/ruby-standard-environment/197532 "2010-10-16T00:42:48Z")

</div>

I am running windows XP professional with Ruby 1.92. I have a Ruby project that requires mechanize, nokogiri, rest-open-uri. It fills in a web-page search form, walks the returned web-pages sequentially and extracts s…

---

## ["JRuby Update" slide for my talk](https://www.ruby-forum.com/t/jruby-update-slide-for-my-talk/197557)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [October 15, 2010, 11:47pm UTC](https://www.ruby-forum.com/t/jruby-update-slide-for-my-talk/197557 "2010-10-15T23:47:37Z")

</div>

Hi, #shamelessselfpromotion I talk about JRuby today at Rakuten Technology Conference 2010 in Japan on behalf of Japan JRuby U. Group. Here’s my slides: JRuby Update by Hiroshi Nakamura (flash needed) Hope someone e…

---

## [Problems with gem installation on Windows](https://www.ruby-forum.com/t/problems-with-gem-installation-on-windows/197536)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [October 15, 2010, 10:59pm UTC](https://www.ruby-forum.com/t/problems-with-gem-installation-on-windows/197536 "2010-10-15T22:59:11Z")

</div>

I am looking for ruby expert for installing ‘libxslt-ruby’ gem on Windows with Ruby 1.9.2 via Bundler. The main problem is it is dependent on the following libraries to function properly: \* libm (math routines: very …

---

## [Kind of nested loops](https://www.ruby-forum.com/t/kind-of-nested-loops/197474)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 6\
**Last updated:** [October 15, 2010, 10:59pm UTC](https://www.ruby-forum.com/t/kind-of-nested-loops/197474 "2010-10-15T22:59:10Z")

</div>

I am trying to get this going where i have this build array and then I have an array of hashes named after the items in the build. Depending upon what is in the array, I want to read the arrays of hashes. I wrote this…

---

## [Options in a class](https://www.ruby-forum.com/t/options-in-a-class/197374)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 10\
**Last updated:** [October 15, 2010, 10:59pm UTC](https://www.ruby-forum.com/t/options-in-a-class/197374 "2010-10-15T22:59:08Z")

</div>

I have some problems understanding the basics of classes and modules in Ruby – and arg and options. How do you create a e g class that can take some options, but leave them out if not needed? This is what I’m familiar…

---

## [Jruby-rack and --faster](https://www.ruby-forum.com/t/jruby-rack-and-faster/197541)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 5\
**Last updated:** [October 15, 2010, 10:44pm UTC](https://www.ruby-forum.com/t/jruby-rack-and-faster/197541 "2010-10-15T22:44:02Z")

</div>

Came across the --faster option yesterday and decided to give it a try because it sounded as if it would make things faster :-). I am using trinidad to run a sinatra app and ran into an error with jruby-rack org.jrub…

---

## [Setting variable with either value](https://www.ruby-forum.com/t/setting-variable-with-either-value/197534)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 1\
**Last updated:** [October 15, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/setting-variable-with-either-value/197534 "2010-10-15T22:39:50Z")

</div>

Is there a better way to write this? @a = “abc” @a = @b if @b This will set value @a to @b if @b already have a value since before. If not it will use the default @a which is “abc”.

---

## [Unequal equality](https://www.ruby-forum.com/t/unequal-equality/197555)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [October 15, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/unequal-equality/197555 "2010-10-15T22:39:48Z")

</div>

I’ve got such that output during testing my program: \[terminal\_output\] Loaded suite ./niep\_test Started …F. Finished in 0.009922 seconds. Failure: test\_sanity(SFTester) \[./niep\_test.rb:12:in sanity' ./niep\_test.…

---

## [Processing regular expressions?](https://www.ruby-forum.com/t/processing-regular-expressions/197526)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [October 15, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/processing-regular-expressions/197526 "2010-10-15T22:39:45Z")

</div>

I’m interested in manipulating & munging regular expressions, not the matches, but the regexes themselves. Specifically, I want to parse out the groups/captures in a regex much like .named\_captures and .names, but for…

---

## [Rspec-rails-2.0.1 is released!](https://www.ruby-forum.com/t/rspec-rails-2-0-1-is-released/197543)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [October 15, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-0-1-is-released/197543 "2010-10-15T22:39:37Z")

</div>

The rails-3.0.1 release excluded a change that I had naively expected to be included. This upgrade is only necessary if you write view specs and are upgrading to rails-3.0.1. To upgrade, all you need to do is change y…

---

## [Can I use JRuby 1.5 with Nokogiri](https://www.ruby-forum.com/t/can-i-use-jruby-1-5-with-nokogiri/197538)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [October 15, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/can-i-use-jruby-1-5-with-nokogiri/197538 "2010-10-15T22:39:35Z")

</div>

I’m using JRuby 1.4.1 and tried switching to 1.5.1 but got all sorts of warnings about ObjectSpace being disabled with nokogiri (1.4.1). Just wondering if there are any issues I should be concerned with regarding thi…

---

## [Outsider 0.0.2 released](https://www.ruby-forum.com/t/outsider-0-0-2-released/197539)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [October 15, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/outsider-0-0-2-released/197539 "2010-10-15T22:39:35Z")

</div>

Outsider 0.0.2 has been released. Outsider is a gem plugin which allows gem authors to install files outside the gem installation directory. Currently, it won’t work on Windows and it’s only tested on Gentoo Linux F…

---

## [How do i split a file by newline](https://www.ruby-forum.com/t/how-do-i-split-a-file-by-newline/197514)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 4\
**Last updated:** [October 15, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/how-do-i-split-a-file-by-newline/197514 "2010-10-15T22:39:31Z")

</div>

Hi all, I would like to know how do i split a file by newline ,am able to do it tab space like path=“E:/expr/amit.txt” File.open(path).each do |i| k=i.split("\\t" ) puts “#{k\[0\]}” end o/p: amit and this is conte…

---

## [Ruby and MS Sql Server on Win 2003](https://www.ruby-forum.com/t/ruby-and-ms-sql-server-on-win-2003/197523)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [October 15, 2010, 3:34pm UTC](https://www.ruby-forum.com/t/ruby-and-ms-sql-server-on-win-2003/197523 "2010-10-15T15:34:05Z")

</div>

Hey guys have a quick qestion, Any libraries out there that I can use to make a connection from my linux box to a windows 2000 server running sql server 2000

---

## [Weird behavior with exec /backticks](https://www.ruby-forum.com/t/weird-behavior-with-exec-backticks/197516)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [October 15, 2010, 2:15pm UTC](https://www.ruby-forum.com/t/weird-behavior-with-exec-backticks/197516 "2010-10-15T14:15:10Z")

</div>

I have the following shell script that I call with backticks What this script does it to execute the params passed but kill the process if a timeout expires. When I run this script from the shell everything works ju…

---

## [How do I highlight Ruby code on a GitHub wiki?](https://www.ruby-forum.com/t/how-do-i-highlight-ruby-code-on-a-github-wiki/197486)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 3\
**Last updated:** [October 15, 2010, 10:48am UTC](https://www.ruby-forum.com/t/how-do-i-highlight-ruby-code-on-a-github-wiki/197486 "2010-10-15T10:48:25Z")

</div>

I understand this question is a little off-topic here, but the documentation on GitHub.com doesn’t help me. Here’s the story: GitHub allows one to use various markup languages when editing wiki pages. By default is u…

---

## [How do i provide password for su command while using net/telnet in ruby](https://www.ruby-forum.com/t/how-do-i-provide-password-for-su-command-while-using-net-telnet-in-ruby/197436)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 6\
**Last updated:** [October 15, 2010, 8:10am UTC](https://www.ruby-forum.com/t/how-do-i-provide-password-for-su-command-while-using-net-telnet-in-ruby/197436 "2010-10-15T08:10:08Z")

</div>

Hii all , Am using Net/TELNET to connect to remote host trying to run su command in order to get root privilage this is how i doing require ‘net/telnet’ localhost = Net::Telnet::new(“Host” =\> “192.147.217.27”, “Time…

---

## [Sort\_by: multiple fields with reverse sort](https://www.ruby-forum.com/t/sort-by-multiple-fields-with-reverse-sort/197361)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 15\
**Last updated:** [October 15, 2010, 7:41am UTC](https://www.ruby-forum.com/t/sort-by-multiple-fields-with-reverse-sort/197361 "2010-10-15T07:41:19Z")

</div>

I need to use sort\_by to sort a table, since the user could select columns in any order. b=\[ \["radio", 30, 5\], \["radio", 20, 5\], \["archie", 20, 5\], \[“newton”, 10, 3\] \] b.sort\_by{|x| \[ x\[1\], x\[0\] \]} Works fine. Howev…

---

## [Nokogiri & Rb 1.9.2-p0](https://www.ruby-forum.com/t/nokogiri-rb-1-9-2-p0/197446)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 4\
**Last updated:** [October 15, 2010, 4:10am UTC](https://www.ruby-forum.com/t/nokogiri-rb-1-9-2-p0/197446 "2010-10-15T04:10:42Z")

</div>

Is there an error with nokogiri and title recent windows build of ruby 1.9.2-p0? I have installed ruby and nokogiri gem. I was following the railscast As I am just learning things I thought I would start by running t…

---

## [Setting local variables in a binding](https://www.ruby-forum.com/t/setting-local-variables-in-a-binding/196073)

<div class="topic-metadata">

**Author:** [@Martin\_DeMello](https://www.ruby-forum.com/u/Martin_DeMello)\
**Replies:** 14\
**Last updated:** [October 15, 2010, 2:58am UTC](https://www.ruby-forum.com/t/setting-local-variables-in-a-binding/196073 "2010-10-15T02:58:55Z")

</div>

Why does this not work? ruby-1.9.2-p0 \> b = binding =\> #Binding:0x9adc81c ruby-1.9.2-p0 \> eval(“x = 5”, b) =\> 5 ruby-1.9.2-p0 \> x NameError: undefined local variable or method x' for main:Object from (irb):6 from /…

---

## [Gem Commands with Nokogiri](https://www.ruby-forum.com/t/gem-commands-with-nokogiri/197479)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [October 15, 2010, 2:30am UTC](https://www.ruby-forum.com/t/gem-commands-with-nokogiri/197479 "2010-10-15T02:30:55Z")

</div>

I am on windows XP. trying to install nokogiri. I have the devkit installed. I received the error below. So I am trying to use the commands based on its output but they are erroring for me as well. PS C:\\devkit\> gem …

---

## [Why does a lot of code not include parenthesis?](https://www.ruby-forum.com/t/why-does-a-lot-of-code-not-include-parenthesis/196295)

<div class="topic-metadata">

**Author:** [@egervari](https://www.ruby-forum.com/u/egervari)\
**Replies:** 31\
**Last updated:** [October 15, 2010, 1:12am UTC](https://www.ruby-forum.com/t/why-does-a-lot-of-code-not-include-parenthesis/196295 "2010-10-15T01:12:40Z")

</div>

I just started playing around with ruby and rails, and one thing I’ve noticed is that the style of the code is a little odd. People don’t use parenthesis most or even all of the time. I find this to look messy. It’s h…

---

## [Ruby 1.9.2-p0 mingw32 on vista 64 -- interpreter crashes calling thread.join](https://www.ruby-forum.com/t/ruby-1-9-2-p0-mingw32-on-vista-64-interpreter-crashes-calling-thread-join/197470)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 1\
**Last updated:** [October 14, 2010, 11:49pm UTC](https://www.ruby-forum.com/t/ruby-1-9-2-p0-mingw32-on-vista-64-interpreter-crashes-calling-thread-join/197470 "2010-10-14T23:49:29Z")

</div>

t = Thread.new {somecode} t.join causes the interpreter to crash (This application has requested the Runtime to terminate it in an unusual way) while… t = Thread.new {somecode} sleep 1 t.join or… t = Thread.new…

---

## [\<Class info\> from a String](https://www.ruby-forum.com/t/class-info-from-a-string/197463)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 4\
**Last updated:** [October 14, 2010, 11:46pm UTC](https://www.ruby-forum.com/t/class-info-from-a-string/197463 "2010-10-14T23:46:23Z")

</div>

If I were to have this: class Hew def initialize(string) @string = string end def other\_method end end a = Hew.new(“Broown Cew”) =\> #\<Hew:0x40e8238 @string = “Broown Cew”\> b = a.to\_s =\> “#Hew:0x40e8238” My qu…

[Previous page](https://www.ruby-forum.com/c/ruby/7.md?page=513)

[Next page](https://www.ruby-forum.com/c/ruby/7.md?page=515)
