Slashdot Mirror


Rails 2.1 Is Now Available

slick50 writes "Rails 2.1 is now available for general consumption with all the features and fixes we've been putting in over the last six months since 2.0. We've had 1,400 contributors creating patches and vetting them. This has resulted in 1,600+ patches. And lots of that has made it into this release. The new major features are: time zones (by Geoff Buesing), dirty tracking, Gem dependencies, named scope (by Nick Kallen), UTC-based migrations, and better caching. As always, you can install with: gem install rails Or you can use the Git tag for 2.1.0."

3 of 71 comments (clear)

  1. Wt by paugq · · Score: 5, Informative

    I used to use Rails until I discovered Wt: C++, Qt-like API, you develop webapps with widgets (as if they were a desktop application, no more "templates" or "pages") and you don't need to write a single line of HTML, CSS or Javascript. You can deploy it as a FastCGI module for Apache, Lighttp, etc, or as a standalone application with its own webserver. It supports very heavy loads, more than Rails or Django will ever be able to deal with. And you can link to a myriad of existing C and C++ libraries.

    Do you want to authenticate your users using Active Directory? Use Samba and link to libwinbind if on Unix, or link to the Windows API if on Windows (yes, it's cross-platform!). No more worries about language bindings.

  2. I love Ruby and Rails, don't get me wrong... by patio11 · · Score: 5, Informative

    ... but I burned about 16 hours of company time last week trying to do the following:

    1) Have a .rb script written in UTF-8, with Japanese in it.
    2) Read in a files written in a mix of UTF-8 and SJIS (a legacy Japanese encoding which is quite common here)
    3) Do some really freaking simple text munging.
    4) Write out to a new file in SJIS, for exporting to another system

    Sixteen. Freaking. Hours.

    Among the numerous issues I learned the hard way (previously all of my Rails experience had been in the mystical wonderland of ASCII and all of my i18n experience had been in Java, so I had never seen problems like this before):

    1) Running regexps on strings. I naiively assumed that you could actually, you know, do it. As it turns out, you have to first convert the encoding of the regexp and the encoding of the string such that they match, otherwise you get program killing errors. This was sort of a newbie mistake -- I figured that Ruby, with its "keep it easy" credo, would do things fairly transparently like Java does. Instead, I have to manually identify all entrance points of text into the system, and do the encoding to UTF-8 internally there, then do the encoding to the target encoding at all the output points. As you can imagine, this isn't the world's most maintainable solution, since all it takes is one other member of my team to refactor a file and forget to include the magic encoding comment at the top (thus letting encoding fall to the system default) and then we've got little SJIS gremlins running around internally wreaking havoc with our data.

    2) Try opening a file for writing as SJIS in a script written in UTF-8

    output_file = File.open("sample.txt", "w:SJIS") #this is Ruby 1.9
    output_file.puts Date.today.year # 2009
    output_file.close

    You'll get an error saying that you can't transcode between ASCII-8BIT (what the 2009 starts as, after it gets munged into a string) and SJIS, which you've declared as the file encoding. Never mind that a) the transcoding is bitwise identical in this case and b) yes, you freaking machine, I damn well CAN transcode between those two because if I can't then Japan is "#$"#ed.

    3) Documentation. One of my favorite hobbyhorses with Rails, and I love that framework, is that documentation is sparse, outdated, and disorganized. Ruby 1.9 deals with the issue of sparse, outdated, and disorganized documentation by dispensing with it entirely, for minor features like Unicode support, which was theoretically the major advance. (Its possible I merely missed the documentation because my Japanese Google-fu is insufficient, but I really feel for those saps out there who need to support languages which aren't Japanese.)

    About the only helpful things I found were blog posts and mailing list archives which detailed the somewhat idiosyncratic relationship between

    a) the magic comment
    b) the -K and -E command line parameters
    c) the system default encoding

    in determining what encoding strings actually end up as. I have still not been able to re-find where I learned about the File.open(filename, "w:SJIS") syntax. There does not appear to be any comprehensive official list of changes. Rather, the best I was able to do was a blog post featuring (I kid you not) the results of one guy grep'ping changelogs looking for things that looked related to 1.9 and collecting them in one place.

    Oh boy, was Friday frustrating. And I get to do it again today. Fun stuff.

    1. Re:I love Ruby and Rails, don't get me wrong... by JanneM · · Score: 5, Informative

      Java and Python only solved that problem in the sense that "we support only Unicode". Which kind of sucks for Japanese, since Unicode is actually somewhat broken for the language (not all needed characters are actually defined). And even if you use Unicode, dealing with Japanese does mean dealing with and generating both ISO-2022 and Shift-JS documents on a regular basis.

      --
      Trust the Computer. The Computer is your friend.