First  |  Prev |  Next  |  Last
Pages: 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
Rake task with variable arguments
Hi, I want to create a Rails rake task that can accept a varying number of arguments. Ideally, I'd like the arguments to be optional, and I'd also like to be able to specify 1 or more. So, if I have the rake task my_task, like this: task :do_something, :arg1 do |t, args| puts args.inspect # some code ... 1 Apr 2010 15:44
Is there a method to set variable to NaN or Infinity?
Is there a built-in method to set a floating point value to NaN or Infinity? Or, is the only way to do this by a = 0.0/0.0 # set a to NaN b = 3.0/0.0 # set b to Infinity c = -3.0/0.0 # set c to -Infinity Also, how can I set value to -NaN? This is possible in other languages, but I can't do it in Ru... 1 Apr 2010 17:59
Rails JQuery issue
Hey all, When I place this in my base application html.haml file: = javascript_include_tag :defaults, 'jquery-1.3.2.min', 'highcharts' <!--[if IE]> javascript_include_tag 'excanvas.compiled' <![endif]--> %script{:type => "text/javascript"} $(document).ready(function() { = yie... 1 Apr 2010 10:07
[ANN] Dfect 2.1.0 (2010-03-31)
Dfect 2.1.0 (2010-03-31) Assertion testing library for Ruby http://snk.tuxfamily.org/lib/dfect/ Dfect is an assertion testing library for Ruby that emphasizes a simple assertion vocabulary, instant debuggability of failures, and flexibility in com... 1 Apr 2010 06:48
[ANN] Rumai 3.2.2 (2010-04-01)
Rumai 3.2.2 (2010-04-01) Ruby interface to the wmii window manager http://snk.tuxfamily.org/lib/rumai/ Rumai is a [1]Ruby interface to the [2]wmii window manager. Version 3.2.2 (2010-04-01) This release fixes some warnings that appeared during i... 1 Apr 2010 04:39
Rake 0.8.7 needs Ruby 1.8?
Hello.. I am trying to install a Ruby application called Redmine. In order to create database structure, I have to execute this command: rake db:migrate When I run it, a message telling that msvcrt-ruby18.dll was not found (I'm attaching the complete message). I have downloaded the last ruby version (1.9.1) a... 1 Apr 2010 21:20
socket programming...lsof?
Hi All, Is there a ruby substitute for lsof's functionality? Meaning I want to listen on certain ports/sockets such as identd's port 113 to see if any process is using this port. Is this possible in Ruby w/out using lsof? Here is my test code, on my ubuntu personal laptop with a port from netstat -a. #!/u... 8 Apr 2010 05:03
how to solve this regular expression problem
I have strings of this form: s = 'C#039;era una volta il east' I want to replace '#039;' with the octal representation of 39 ie 47 so the string becomes s = 'C\47era una volta il east' I have tried this: 1 def conv_char(num) 2 puts num.to_i.to_s(8) 3 num.to_i.to_s(8) 4 end ... 1 Apr 2010 01:26
stetecting change in number of leading spaces while looping
I am looping through a file and using a script that detects leading spaces (based on a previous post to this forum) What I want to do is to detect changes in number of leading spaces, for instance when one line has more, fewer, or the same number of leading spaces as the previous line. The problem I am having ... 31 Mar 2010 17:42
each_slice()
I'm using the following code: some_array.each_slice(2).to_a Now, I have a problem. I distribute my code as a gem, and I need to know from which version Ruby supports this each_slice() syntax (I'll put this version number in my gem specification: s.required_ruby_version = '=> 1.8.?'). I located this featu... 1 Apr 2010 22:26
First  |  Prev |  Next  |  Last
Pages: 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143