# Ruby

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

[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:** 733

---

## [Count the number of times an element occurs in an array](https://www.ruby-forum.com/t/count-the-number-of-times-an-element-occurs-in-an-array/176712)

<div class="topic-metadata">

**Author:** [@jimb](https://www.ruby-forum.com/u/jimb)\
**Replies:** 12\
**Last updated:** [October 9, 2009, 10:33am UTC](https://www.ruby-forum.com/t/count-the-number-of-times-an-element-occurs-in-an-array/176712 "2009-10-09T10:33:34Z")

</div>

Hi, I need to count the number of times an element occurs in an array. At the moment I’m doing it like this: a = \[“a”, “b”, “a”, “b”, “b”\] b = a.uniq c = \[\] 0.upto(b.length-1) do |e| d = 0 0.upto(a.length-1) do |…

---

## [Running BackgroundRB on Cygwin + Windows?](https://www.ruby-forum.com/t/running-backgroundrb-on-cygwin-windows/176971)

<div class="topic-metadata">

**Author:** [@Gerwin](https://www.ruby-forum.com/u/Gerwin)\
**Replies:** 0\
**Last updated:** [October 9, 2009, 5:40am UTC](https://www.ruby-forum.com/t/running-backgroundrb-on-cygwin-windows/176971 "2009-10-09T05:40:57Z")

</div>

Hi, I got BackgroundRB to start under cygwin (currently using the version from GIT) but when starting it I get the errors shown at the bottom of this message. Is it possible to run this cygwin+windows combination? Wh…

---

## [\[ANN\] Dfect 1.0.1](https://www.ruby-forum.com/t/ann-dfect-1-0-1/176969)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [October 9, 2009, 5:12am UTC](https://www.ruby-forum.com/t/ann-dfect-1-0-1/176969 "2009-10-09T05:12:15Z")

</div>

Dfect 1.0.1 Assertion testing library for Ruby http://snk.tuxfamily.org/lib/dfect/ Dfect is an assertion testing library for Ruby that emphasizes a simple assertion voc…

---

## [\[ANN\] ERBook 7.2.0](https://www.ruby-forum.com/t/ann-erbook-7-2-0/176968)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [October 9, 2009, 4:17am UTC](https://www.ruby-forum.com/t/ann-erbook-7-2-0/176968 "2009-10-09T04:17:18Z")

</div>

ERBook 7.2.0 Write books, manuals, and documents in eRuby http://snk.tuxfamily.org/lib/erbook/ ERBook is an extensible document processor that emits \[1\]any document you can im…

---

## [Assistance Needed Running IronRuby.Rack.Example](https://www.ruby-forum.com/t/assistance-needed-running-ironruby-rack-example/170877)

<div class="topic-metadata">

**Author:** [@tmilker](https://www.ruby-forum.com/u/tmilker)\
**Replies:** 9\
**Last updated:** [October 9, 2009, 3:29am UTC](https://www.ruby-forum.com/t/assistance-needed-running-ironruby-rack-example/170877 "2009-10-09T03:29:15Z")

</div>

Could I get some assistance in running rack on IronRuby? I am just trying out: http://github.com/jschementi/ironruby/tree/master/Merlin/Main/Hosts/IronRuby.Rack from RailsConf, not the latest one from the IronRuby tr…

---

## [Ruby and Excel and colour question](https://www.ruby-forum.com/t/ruby-and-excel-and-colour-question/176723)

<div class="topic-metadata">

**Author:** [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Replies:** 4\
**Last updated:** [October 9, 2009, 1:15am UTC](https://www.ruby-forum.com/t/ruby-and-excel-and-colour-question/176723 "2009-10-09T01:15:47Z")

</div>

Dear all, I need to be able to write a file in Excel format, where the fields have different background colours based on some condition which is evaluated based on the entries at runtime. I tried to look at the spre…

---

## [Difficulty updating Ruby Gems in a non-standard location](https://www.ruby-forum.com/t/difficulty-updating-ruby-gems-in-a-non-standard-location/176949)

<div class="topic-metadata">

**Author:** [@David\_Brodbeck](https://www.ruby-forum.com/u/David_Brodbeck)\
**Replies:** 5\
**Last updated:** [October 9, 2009, 12:42am UTC](https://www.ruby-forum.com/t/difficulty-updating-ruby-gems-in-a-non-standard-location/176949 "2009-10-09T00:42:59Z")

</div>

I have Ruby Gems installed in a non-standard location. Both $GEM\_PREFIX and $GEM\_HOME are set. I’m attempting to update from 0.9.4 to 1.3.5, without success. First attempt: I tried “gem update --system”. This didn…

---

## [Safe command line execution](https://www.ruby-forum.com/t/safe-command-line-execution/176898)

<div class="topic-metadata">

**Author:** [@Zundra\_D](https://www.ruby-forum.com/u/Zundra_D)\
**Replies:** 5\
**Last updated:** [October 8, 2009, 11:21pm UTC](https://www.ruby-forum.com/t/safe-command-line-execution/176898 "2009-10-08T23:21:02Z")

</div>

Hi all. I have a application that needs to execute a system call via command line. However, the problem I’m running into is this particular command takes a username and password both of which can be any pattern and …

---

## [Fast\_xs inconsistent with MRI implementation](https://www.ruby-forum.com/t/fast-xs-inconsistent-with-mri-implementation/176911)

<div class="topic-metadata">

**Author:** [@serguei\_f](https://www.ruby-forum.com/u/serguei_f)\
**Replies:** 3\
**Last updated:** [October 8, 2009, 10:44pm UTC](https://www.ruby-forum.com/t/fast-xs-inconsistent-with-mri-implementation/176911 "2009-10-08T22:44:09Z")

</div>

In MRI ruby 1.8.6, we’re seeing this behaviour of the fast\_xs method: require ‘fast\_xs’ =\> true " ’ ".fast\_xs =\> " ’ " “”".fast\_xs =\> “”" But in JRuby 1.4RC1, the escaping is different. jruby-1.4.0RC1 \> r…

---

## [Mixing instance\_eval and block with arguments](https://www.ruby-forum.com/t/mixing-instance-eval-and-block-with-arguments/176946)

<div class="topic-metadata">

**Author:** [@robkuz](https://www.ruby-forum.com/u/robkuz)\
**Replies:** 4\
**Last updated:** [October 8, 2009, 10:42pm UTC](https://www.ruby-forum.com/t/mixing-instance-eval-and-block-with-arguments/176946 "2009-10-08T22:42:23Z")

</div>

Hi, here’s what I’d like to do in a silly example: S = Struct.new :foo, :bar init = lambda do |a, b| self.foo = b self.bar = a + 10 end s = S.new # or create an instance otherwise now comes the fun part which doe…

---

## [Enumerable#entries sometimes wants a parameter?](https://www.ruby-forum.com/t/enumerable-entries-sometimes-wants-a-parameter/176846)

<div class="topic-metadata">

**Author:** [@superwick](https://www.ruby-forum.com/u/superwick)\
**Replies:** 4\
**Last updated:** [October 8, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/enumerable-entries-sometimes-wants-a-parameter/176846 "2009-10-08T22:39:28Z")

</div>

We are switching a rails app to JRuby, and some of our tests fail intermittently because we call #entries on an Enumerable (Array or Rails association), and it throws an exception saying 1 parameter was expected (not …

---

## [IronRuby website sitemap](https://www.ruby-forum.com/t/ironruby-website-sitemap/176864)

<div class="topic-metadata">

**Author:** [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Replies:** 5\
**Last updated:** [October 8, 2009, 9:31pm UTC](https://www.ruby-forum.com/t/ironruby-website-sitemap/176864 "2009-10-08T21:31:32Z")

</div>

Here’s a sitemap for the new IronRuby website that I just wrote up. Let me know if there’s something else missing, or you’d like to help with parts. Documentation (docs.ironruby.net) \* API documentation (generated…

---

## [Is the maintainer discharging rule approved? and about matrix.rb](https://www.ruby-forum.com/t/is-the-maintainer-discharging-rule-approved-and-about-matrix-rb/176934)

<div class="topic-metadata">

**Author:** [@Yugui](https://www.ruby-forum.com/u/Yugui)\
**Replies:** 3\
**Last updated:** [October 8, 2009, 8:54pm UTC](https://www.ruby-forum.com/t/is-the-maintainer-discharging-rule-approved-and-about-matrix-rb/176934 "2009-10-08T20:54:38Z")

</div>

Yuguie$B$G$9!#e(B e$B@h$K$\*CN$i$;$7$?$h$&$Ke(B\[ruby-core:25764\]e$B$G%a%s%F%J2rG$%W%m%;%9$rDs0F$7$^$7$?!#e(B e$BFC$KH?BP$O$J$$$h$&$J$N$G\>5G’$5$l$?$H8+$J$7$FNI$$$G$7$g$&$+!#e(B e$B$5$F!":#8=:\_$3$Ne(B3e$B%v7n%k!\<%k$Ke(Bm…

---

## [Error Deploying 2.3.4 to Tomcat 6, due to Rack 1.0](https://www.ruby-forum.com/t/error-deploying-2-3-4-to-tomcat-6-due-to-rack-1-0/176932)

<div class="topic-metadata">

**Author:** [@triplem](https://www.ruby-forum.com/u/triplem)\
**Replies:** 6\
**Last updated:** [October 8, 2009, 6:40pm UTC](https://www.ruby-forum.com/t/error-deploying-2-3-4-to-tomcat-6-due-to-rack-1-0/176932 "2009-10-08T18:40:18Z")

</div>

I’m exploring java deploy. I included every used gems into .war but i always got this error. Does anyone know how to solve and let me to save a little time? GRAVE: Exception caught C:/Program Files/Apache Software Fo…

---

## [State of actor model?](https://www.ruby-forum.com/t/state-of-actor-model/176937)

<div class="topic-metadata">

**Author:** [@diego\_v](https://www.ruby-forum.com/u/diego_v)\
**Replies:** 2\
**Last updated:** [October 8, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/state-of-actor-model/176937 "2009-10-08T18:08:22Z")

</div>

Hello, I’ve read in the past about several projects to support the actor model for concurency. Is any of these still ongoing or have they all died? Thanks Diego

---

## [Coverage and ensure](https://www.ruby-forum.com/t/coverage-and-ensure/175295)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [October 8, 2009, 6:04pm UTC](https://www.ruby-forum.com/t/coverage-and-ensure/175295 "2009-10-08T18:04:16Z")

</div>

coverage e$B$G!"e(Bensure e$B@aFb$NJ8$,?t$($i$l$J$$5$$,$7$^$9!#e(B % cat z.rb begin p 1 ensure p 2 end % ./ruby -rcoverage -ve ’ Coverage.start load “z.rb” p Coverage.result ’ ruby 1.9.2dev (2009-09-10 trunk …

---

## [On Ranges as conditions](https://www.ruby-forum.com/t/on-ranges-as-conditions/176641)

<div class="topic-metadata">

**Author:** [@Rafael\_Cunha\_de\_Alm](https://www.ruby-forum.com/u/Rafael_Cunha_de_Alm)\
**Replies:** 6\
**Last updated:** [October 8, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/on-ranges-as-conditions/176641 "2009-10-08T17:22:05Z")

</div>

Reading a few tutorials I found this piece of code: while input = gets input = input.chomp puts input + " triggered" if input =~ /start/ … input =~ /end/ end I understand what it does. If I type start, end or anythi…

---

## [Upcoming RubyConf](https://www.ruby-forum.com/t/upcoming-rubyconf/176939)

<div class="topic-metadata">

**Author:** [@Hal\_F](https://www.ruby-forum.com/u/Hal_F)\
**Replies:** 0\
**Last updated:** [October 8, 2009, 5:16pm UTC](https://www.ruby-forum.com/t/upcoming-rubyconf/176939 "2009-10-08T17:16:49Z")

</div>

If anyone has to back out, please consider selling me your spot. Thanks, Hal F.

---

## [Regettext is not enough fix in ruby nomenclature](https://www.ruby-forum.com/t/regettext-is-not-enough-fix-in-ruby-nomenclature/176940)

<div class="topic-metadata">

**Author:** [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Replies:** 0\
**Last updated:** [October 8, 2009, 5:16pm UTC](https://www.ruby-forum.com/t/regettext-is-not-enough-fix-in-ruby-nomenclature/176940 "2009-10-08T17:16:20Z")

</div>

\[svn@mylapi ~/work/abc/ruby/cgi\]$ rgettext \*.rb -o rmyappl2.po Error: #\<RubyLex::SyntaxError: unknown type of %string\> in functions.rb:196 “#{\_(t.strftime(”%A"))}, #{t.strftime("%Y-%m-%d")}" \[svn@mylapi ~/work/abc/r…

---

## [Unicorn 0.93.2 - more compatible with Rails](https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873)

<div class="topic-metadata">

**Author:** [@ericw](https://www.ruby-forum.com/u/ericw)\
**Replies:** 3\
**Last updated:** [October 8, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873 "2009-10-08T17:06:17Z")

</div>

Unicorn is a HTTP server for Rack applications designed to take advantage of features in Unix/Unix-like kernels and only serve fast clients on low-latency, high-bandwidth connections. Slow clients should only be serv…

---

## [Looking hosting donation for project](https://www.ruby-forum.com/t/looking-hosting-donation-for-project/176931)

<div class="topic-metadata">

**Author:** [@Francisco\_TufrSSS\_S](https://www.ruby-forum.com/u/Francisco_TufrSSS_S)\
**Replies:** 0\
**Last updated:** [October 8, 2009, 3:36pm UTC](https://www.ruby-forum.com/t/looking-hosting-donation-for-project/176931 "2009-10-08T15:36:44Z")

</div>

Hi, I’m developing an interesting project and need help with a place to host it. Basically it’s a chat where you are given an instrument and your text becomes music. You can check a demo of the algorithm behind here. …

---

## [Vendored Oniguruma gem MissingSourceFile oregexp](https://www.ruby-forum.com/t/vendored-oniguruma-gem-missingsourcefile-oregexp/176752)

<div class="topic-metadata">

**Author:** [@mfeadler](https://www.ruby-forum.com/u/mfeadler)\
**Replies:** 2\
**Last updated:** [October 8, 2009, 2:58pm UTC](https://www.ruby-forum.com/t/vendored-oniguruma-gem-missingsourcefile-oregexp/176752 "2009-10-08T14:58:35Z")

</div>

Hi All, Hoping someone can help me with this. I have installed the Oniguruma gem by compiling from source and then installing the gem based on the instructions here: http://www.goodbyehelicopter.com/2008/02/20/instal…

---

## [Detect any "\<a href=mailto:...\>...\</a\>" string in a string?](https://www.ruby-forum.com/t/detect-any-a-href-mailto-a-string-in-a-string/176905)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 5\
**Last updated:** [October 8, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/detect-any-a-href-mailto-a-string-in-a-string/176905 "2009-10-08T13:01:01Z")

</div>

Hi all I have a long, long string of HTML tags. There might be some unprotected Email links in there like this: Some Email or Some Email or… I need to detect these email links and substitute them with something d…

---

## [How to do explicit copy](https://www.ruby-forum.com/t/how-to-do-explicit-copy/176819)

<div class="topic-metadata">

**Author:** [@rickyr](https://www.ruby-forum.com/u/rickyr)\
**Replies:** 5\
**Last updated:** [October 8, 2009, 12:55pm UTC](https://www.ruby-forum.com/t/how-to-do-explicit-copy/176819 "2009-10-08T12:55:41Z")

</div>

Hi, I notice Ruby uses reference copy by default. The problem is I need to keep two variables keep separate copies of the same data. If I do this: x = Hash.new fill a with data y = x delete some keys from x I got t…

---

## [Code Review: Defined](https://www.ruby-forum.com/t/code-review-defined/176914)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 1\
**Last updated:** [October 8, 2009, 8:46am UTC](https://www.ruby-forum.com/t/code-review-defined/176914 "2009-10-08T08:46:55Z")

</div>

tfpt review “/shelveset:Defined;REDMOND\\tomat” Comment : Implements defined?(super) and fixes defined? applied on a method call to respect visibility. Fixes: http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItem…

---

## [Ruby web programming](https://www.ruby-forum.com/t/ruby-web-programming/176885)

<div class="topic-metadata">

**Author:** [@yousef\_1987](https://www.ruby-forum.com/u/yousef_1987)\
**Replies:** 6\
**Last updated:** [October 8, 2009, 8:36am UTC](https://www.ruby-forum.com/t/ruby-web-programming/176885 "2009-10-08T08:36:51Z")

</div>

I am asking for , how I can call Ruby from html for example : // its possible to do that

---

## [Why I can not use my own blocks in 1.9?](https://www.ruby-forum.com/t/why-i-can-not-use-my-own-blocks-in-1-9/176867)

<div class="topic-metadata">

**Author:** [@ivanstorck](https://www.ruby-forum.com/u/ivanstorck)\
**Replies:** 6\
**Last updated:** [October 8, 2009, 6:15am UTC](https://www.ruby-forum.com/t/why-i-can-not-use-my-own-blocks-in-1-9/176867 "2009-10-08T06:15:01Z")

</div>

Example: 1.8.7: a = lambda {|x,y| x \<=\> y} \[1,2,3\].max(&a) # =\> 3 1.9.1: z = lambda {|x,y| x \<=\> y} \[3,2,1\].max(&z) # =\> ArgumentError: wrong number of arguments (1 for 2) wtf?

---

## [Local JRuby Delegates](https://www.ruby-forum.com/t/local-jruby-delegates/176855)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 10\
**Last updated:** [October 8, 2009, 4:38am UTC](https://www.ruby-forum.com/t/local-jruby-delegates/176855 "2009-10-08T04:38:47Z")

</div>

I think it’s time we started blessing people local to key cities or regions around the world as local JRuby representatives. There’s obviously too many conferences for the core JRuby team to cover, and tons of smaller…

---

## [Lunix split with ruby](https://www.ruby-forum.com/t/lunix-split-with-ruby/176874)

<div class="topic-metadata">

**Author:** [@ahmet](https://www.ruby-forum.com/u/ahmet)\
**Replies:** 8\
**Last updated:** [October 8, 2009, 4:27am UTC](https://www.ruby-forum.com/t/lunix-split-with-ruby/176874 "2009-10-08T04:27:39Z")

</div>

I am using cygwin on windows. I write this script. I have to split all files in the directory. Dir.foreach(‘C:/tmp/test’) {|file| f = system( “split -l 60000 #{file}”) puts “file name : #{f}” } My files is file1…

---

## [Code Review: Strings11](https://www.ruby-forum.com/t/code-review-strings11/176912)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [October 8, 2009, 3:54am UTC](https://www.ruby-forum.com/t/code-review-strings11/176912 "2009-10-08T03:54:16Z")

</div>

tfpt review “/shelveset:Strings11;REDMOND\\tomat” Comment : Reimplements RubyRegex so that it works correctly with 1.9-encoded strings, respects KCODE regex options and $KCODE variable. Fixes rindex used with Regex. …

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

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