ruby-1.9
Why begin/rescue/else behaves differently on 1.9.2 and 1.8.7
I am working with t开发者_JAVA技巧he method mm. In ruby 1.9.2 it behaves weird, instead of the expected result 1.9.2=>10 I am getting[详细]
2023-03-14 23:13 分类:问答Ruby - UTF-8 file encoding
We all know the \"magical\" # encoding: utf-8 line. But I\'ve seen several other alternative notations, some of them pretty wild. Do you know or use any of those? Is there some more general rule of[详细]
2023-03-14 22:18 分类:问答ruby multiple loop sets but with limited rows per set
Alrightie, so I\'m building an CSV file thi开发者_如何转开发s time with ruby.The outer loop will run up to length of num_of_loops, but it runs for an entire set rather than up to the specified row.I w[详细]
2023-03-10 21:27 分类:问答In Ruby CSV, how to write a blank ,, instead of ,"", to a file?
Ruby 1.9 version of csv header %w[first second third] data = [\"column one\",,\"column three\"] CSV.open(\"myfile.csv\",\"w\") do |csv|[详细]
2023-03-08 17:17 分类:问答Lock jruby to ruby 1.9 permanently
I want my jruby 1.6.1 installation to operate with ruby 1.9 mode only. I want to uninstall or surely disable the support for 1.8.7 because I do not want to pull my hair out if I forget to set the envi[详细]
2023-03-07 14:02 分类:问答Error when bringing rails 2.3.5 app to 3.0
So I\'ve been using a PDF guide to help bring my application from 2.3.2 to 3.0.7. I\'m still relatively new at this ... but I\'ve managed to use the rails_upgrade plugin to help convert my route files[详细]
2023-03-04 10:31 分类:问答Set global default encoding for ruby 1.9
I want to tell ruby that everything is utf8, except when stated otherwise, so开发者_如何学JAVA I dont have to place these # encoding: utf-8 comments everywhere.You can either:[详细]
2023-03-03 15:02 分类:问答Escape status within a string literal as argument of `String#tr`
There is something mysterious to me about the escape status of a backslash within a single quoted string literal as argument of String#tr. Can you explain the contrast between the three examples below[详细]
2023-03-03 13:20 分类:问答Referencing hash item inside itself
I\'ve got a pretty short question. Is it possible to initialize a hash with something like this: row = {[详细]
2023-03-03 12:06 分类:问答Why is the Profiler module in Ruby 1.9 named with two trailing underscores?
I looked through the standard library and Profiler__ is the only module I can find that uses two underscor开发者_如何学JAVAes in the name like that. Is there a reason? Because in the Ruby core GC has[详细]
2023-03-02 13:38 分类:问答