[#363639] Parsing geonames — 12 34 <rubyforum@...>

A Ruby newbie having trouble getting results back from geonames

16 messages 2010/06/02
[#363641] Re: Parsing geonames — Michael Fellinger <m.fellinger@...> 2010/06/02

On Wed, Jun 2, 2010 at 2:57 PM, 12 34 <rubyforum@web.knobby.ws> wrote:

[#363642] Re: Parsing geonames — 12 34 <rubyforum@...> 2010/06/02

Michael Fellinger wrote:

[#363646] installation issue with Ruby gems on Ubuntu 8.04 — Santosh Dvn <santoshdvn@...>

Hi I am installing ruby gems on ubuntu 8.04 .. while installing i got

14 messages 2010/06/02

[#363662] having a class method called only one time ? — unbewusst.sein@... (Une B騅ue)

I'd like having a class method called only one time ?

12 messages 2010/06/02

[#363756] comparing objects — Anderson Leite <andersonlfl@...>

How can I compare two objects and get true if some of his atributes are

48 messages 2010/06/03
[#364122] Re: comparing objects — Rein Henrichs <reinh@...> 2010/06/10

On 2010-06-10 06:59:40 -0700, Robert Dober said:

[#363764] Documenting Ruby 1.9: Ebook or Wiki? — Run Paint Run Run <runrun@...>

I'm writing a free ebook about Ruby 1.9 at http://ruby.runpaint.org/ .

17 messages 2010/06/04
[#363765] Re: Documenting Ruby 1.9: Ebook or Wiki? — Mohit Sindhwani <mo_mail@...> 2010/06/04

On 4/6/2010 11:30 AM, Run Paint Run Run wrote:

[#363775] Looking for ORM for 'legacy' database. — Dave Howell <groups.2009a@...>

I feel I should start with some pre-emptive apologies. I used to subscribe to this list, but haven't been reading it for a year or so, so I may have missed the answer to my question. (I did try finding it in the list archives, of course.) Also, I'm a little frustrated, and that might adversely influence the tone of this message. I'll try to avoid that, but I beg your forgiveness if I sound a little snide.

28 messages 2010/06/04
[#363895] Re: Looking for ORM for 'legacy' database. — Phrogz <phrogz@...> 2010/06/06

On Jun 4, 3:29m, Dave Howell <groups.20...@grandfenwick.net> wrote:

[#363975] Re: Looking for ORM for 'legacy' database. — Dave Howell <groups.2009a@...> 2010/06/07

[#363883] inject method of Array class — RichardSchollar <richardgschollar@...>

I have only just started using Ruby (and am a total noob, in case this

14 messages 2010/06/06

[#363944] Complex numbers contradiction? — Andrew Duncan <andrew.duncan@...>

This looks correct:

13 messages 2010/06/07
[#363951] Re: Complex numbers contradiction? — Robert Dober <robert.dober@...> 2010/06/07

On Mon, Jun 7, 2010 at 9:01 PM, Andrew Duncan <andrew.duncan@sonos.com> wrote:

[#364010] Rubyzip - `dup': can't dup NilClass (TypeError) — Luka Stolyarov <lukich@...>

Hello. I've trying to figure out rubyzip. Here's the code I had:

11 messages 2010/06/08

[#364101] Why private #binding? — Intransition <transfire@...>

Why is #binding a private method? I end up doing a lot of this:

13 messages 2010/06/10

[#364268] State of the union for Ruby CLI libraries? — John Feminella <johnf@...>

I am starting construction on a somewhat complicated internal

18 messages 2010/06/13

[#364273] Loading a module without polluting my namespace — Hagbard Celine <sin3141592@...>

Hey folks!

20 messages 2010/06/13

[#364330] shorthand — Roger Pack <rogerpack2005@...>

I read this once:

14 messages 2010/06/14

[#364342] Placement of require() and missing symbols — Eric MSP Veith <eveith@...>

-----BEGIN PGP SIGNED MESSAGE-----

16 messages 2010/06/15
[#364365] Re: Placement of require() and missing symbols — Kirk Haines <wyhaines@...> 2010/06/15

On Mon, Jun 14, 2010 at 7:18 PM, Eric MSP Veith

[#364371] datamapper blues — Martin DeMello <martindemello@...>

I'm investigating the use of DataMapper to convert an old project with

14 messages 2010/06/15

[#364402] Getting rid of self — Ralph Shnelvar <ralphs@...32.com>

22 messages 2010/06/16
[#364440] Re: Getting rid of self — Josh Cheek <josh.cheek@...> 2010/06/16

On Wed, Jun 16, 2010 at 4:31 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:

[#364415] Android apps using ruby — Lakshmanan Muthukrishnan <lakshmanan@...>

Hi,

16 messages 2010/06/16
[#364439] Re: Android apps using ruby — Andrew Kaspick <akaspick@...> 2010/06/16

Lakshmanan Muthukrishnan wrote:

[#364479] Re: Android apps using ruby — Lakshmanan Muthukrishnan <lakshmanan@...> 2010/06/17

Andrew Kaspick wrote:

[#364496] nothing new in ruby_core for four days ? — Michel Demazure <michel@...>

The Ruby Core forum has no new entry since four days ago.

15 messages 2010/06/17
[#364498] Re: nothing new in ruby_core for four days ? — Brian Candler <b.candler@...> 2010/06/17

Michel Demazure wrote:

[#364529] Dear gem: still no zlib. — Dave Howell <groups.2009a@...>

I really really regret ever installing SnowLeopard.

16 messages 2010/06/17

[#364580] String comparison. Why does Ruby consider this true? — Abder-rahman Ali <abder.rahman.ali@...>

When I try for example to compare the following strings in Ruby, I get

13 messages 2010/06/18
[#364584] Re: String comparison. Why does Ruby consider this true? — Josh Cheek <josh.cheek@...> 2010/06/18

On Fri, Jun 18, 2010 at 12:46 PM, Abder-rahman Ali <

[#364628] Random Points within a Circle (#234) — Daniel Moore <yahivin@...>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

21 messages 2010/06/19
[#364696] Re: [QUIZ] Random Points within a Circle (#234) — Caleb Clausen <vikkous@...> 2010/06/21

On 6/19/10, Daniel Moore <yahivin@gmail.com> wrote:

[#364641] Namespacing a class — Eric MSP Veith <eveith@...>

-----BEGIN PGP SIGNED MESSAGE-----

18 messages 2010/06/20

[#364815] Count substrings in string, scan too slow — Danny Challis <dannychallis@...>

Hello everyone,

18 messages 2010/06/24
[#364817] Re: Count substrings in string, scan too slow — Jes俍 Gabriel y Gal疣 <jgabrielygalan@...> 2010/06/24

On Thu, Jun 24, 2010 at 5:04 PM, Danny Challis <dannychallis@gmail.com> wrote:

[#364825] Re: Count substrings in string, scan too slow — Robert Klemme <shortcutter@...> 2010/06/24

2010/6/24 Jes俍 Gabriel y Gal疣 <jgabrielygalan@gmail.com>:

[#364850] Happy Intransition Day! — Ryan Davis <ryand-ruby@...>

Happy Intransition Day!

23 messages 2010/06/24

[#364930] Ruby in JavaScript, all projects are dead? — Alexey Petrushin <axyd80@...>

Hello, recently I've examined some of the projects that trying to bring

18 messages 2010/06/27

[#364988] Reading String Data as a File — Doug Jolley <ddjolley@...>

I use Net::HTTP to collect some data as a string. I now need to pass

25 messages 2010/06/29
[#364989] Re: Reading String Data as a File — Ryan Davis <ryand-ruby@...> 2010/06/29

[#364996] Re: Reading String Data as a File — Brian Candler <b.candler@...> 2010/06/29

Ryan Davis wrote:

[#365016] Re: Reading String Data as a File — Doug Jolley <ddjolley@...> 2010/06/29

> If it takes only a pathname argument, then you're

[#365024] Re: Reading String Data as a File — Tony Arcieri <tony.arcieri@...> 2010/06/29

On Tue, Jun 29, 2010 at 11:50 AM, Doug Jolley <ddjolley@gmail.com> wrote:

[#365036] Re: Reading String Data as a File — Robert Klemme <shortcutter@...> 2010/06/30

2010/6/29 Tony Arcieri <tony.arcieri@medioh.com>:

[#365049] Re: Reading String Data as a File — Brian Candler <b.candler@...> 2010/06/30

Robert Klemme wrote:

[#365039] pathname.rb:270: warning: `*' interpreted as argument prefix — "R.. Kumar 1.9.1 OSX" <sentinel1879@...>

/opt/local/lib/ruby1.9/1.9.1/pathname.rb:270: warning: `*' interpreted

12 messages 2010/06/30
[#365048] Re: pathname.rb:270: warning: `*' interpreted as argument prefix — Josh Cheek <josh.cheek@...> 2010/06/30

On Wed, Jun 30, 2010 at 6:11 AM, R.. Kumar 1.9.1 OSX <sentinel1879@gmail.com

Re: Looking for ORM for 'legacy' database.

From: Dave Howell <groups.2009a@...>
Date: 2010-06-12 01:59:06 UTC
List: ruby-talk #364228
On Jun 11, 2010, at 10:31 , Walton Hoops wrote:

> On 6/11/2010 2:36 AM, Dave Howell wrote:
>> On Jun 11, 2010, at 0:48 , Brian Candler wrote:
>> 
>> 
>>> Dave Howell wrote:
>>> 
>>>> The piece I couldn't find was "How do I tell ActiveRecord to convert the 
>>>> database's "UUID" type to a string, and vice versa?"
>>>> 
>>> Ah, I've never come across a database with a "UUID" type. I'd imagine AR 
>>> would treat unknown types as strings, but you'd need to try it.
>>> 
>> I had to hook a special library into Postgres in order to get the UUID type. Everybody (including me) expects AR to treat it as a string, but in fact, it threw an error because the column was an unknown type. That's why I was trying to figure out how to *tell* it to treat it as a string.
>> 
> Strange, my version of Postgre (8.4) comes with a UUID type.

8.3 did not; I had to get a special external library module and hook it in. 8.4 requires that it be compiled in with a special switch (&/or might also accept the external module, I'm not sure.) --with-ossd-uuid

> Anyway since this seems to be something we're going back and forth on

{sigh} We're not really going "back and forth" on this. I knew when I first posted my query about alternative ORMs that I would inevitably get a lot of people trying to solve my original problem, even though I tried to make it clear that whether or not ActiveRecord *could* work was NOT the issue for me. 

The problem is the documentation. Not ActiveRecord. The documentation. 

When I first decided it was time to learn a new language a few years ago, I didn't decide to learn Ruby because it could do the most things. In fact, it was quite clear that Ruby would be quite a bit LESS capable than PHP, Perl, or Python. It was really new; there were a lot of libraries and whatnot that had not yet been ported. But it was also quite clear that it would do _most_ of what I wanted to do, and would probably soon expand to cover nearly everything I would want. More importantly, what it did was make doing what I wanted to do EASY. I was going to have to learn how to think about programming in a whole new way (well, not a *whole* new way, since AppleScript is also object-oriented in its own peculiar way) but once I had, things that were merely "possible" in PHP or Java or whatever would be *easy* in Ruby. 

In the past couple of weeks, I have gotten 'stuck' on a problem about six times. One with Sequel, one with Rails/ActiveRecord, one with Ramaze, two with Haml, and I don't remember the last one. Of those six, the 'community' around them has managed to help me with three of them. The other three, nobody had a working solution for me. Now, three of six is pretty good, and people generally were willing to try to help me even if they couldn't solve my problem in the end. But advice from a mail list or chat room is a poor substitute for good documentation. 

I also understand that the best way to get good documentation is to pay for it. Tango (now WiTango) comes with outstanding documentation, and costs $5000 per server to run. Documentation isn't all that much fun to create, so I don't expect the documentation for free &/or open source tools to be as good as for-profit commercial tools. Also, many of the Ruby tools I'm evaluating are very new, and haven't had time to accrete the documentation that they'll eventually have. 

"Documentation" includes, of course, the myriad tutorials, blog entries, and mail list questions & answers archived on line. Rails, not surprisingly, has a LOT of 'documentation.' However, 99%+ of it takes migration for granted. I *know* that you don't HAVE to have migrations to use ActiveRecord; but I NEVER found anything that would actually tell me HOW to make a model from scratch by hand. I was *expected* to make the Ruby object, and migrate it TO the database.

A LOT of the online documentation was written by people who'd been using Rails for a while, and often was written FOR people who'd been using Rails for a while, so it takes a lot of Rails-behavior for granted. Perfectly reasonable, but it meant that a lot of the comments on mailing lists and stuff were fairly incomprehensible to me. It took me quite a while to figure out that I could ask Rails to build me my objects FROM my database. Since I hadn't been able to figure out what they should look like from scratch, this seemed like an excellent way to get started. I figured I'd have to modify/edit/improve them once that was done, but at least I'd have some place to start. 

Unfortunately, that didn't work, because of the UUID problem. And for THAT, I could find *nothing* that seemed to offer a solution, even one I couldn't quite figure out. I rummaged through the source code, I Googled every possible variation I could think of, but nobody seems to have previously discussed how to add new types to ActiveRecord's understanding. 

"This is a basic, fundamental ability." I said to myself. "If I cannot find the answer to THIS, what happens when I get to something that really is tricky?" Answer: I'm going to end up spending many hours trying to solve it myself, with just the source code (I hope) to go on. 

I don't care if it's *possible* to make Rails or ActiveRecord work without migrations, or correctly and comprehensively support Postgres's advanced data types (Arrays, IP Addresses, and Records come to mind off the top of my head, none of which can be represented by plain strings). What matters is if it's *easy.* And it's not. It's insanely hard. The only documentation that will tell me how to do that assumes that I'm an experienced Rails user; that I have a very solid grounding in Rails fundamentals.

When I downloaded Tango and its tutorial back in 1996, I spent about 30 minutes with the tutorial and said "Wow, that was easy, and it's doing just the things I think I want to be able to do. Neat!" I spent about eight hours with Rails, and said "Well, I still haven't been able to get my data into a browser window yet, and that's just the first step. Maybe there's something else that will be easier."

It took me less than two hours to start playing with Ruby objects that were populating themselves from my Postgres database using Sequel. Even though I didn't need to tell Sequel how to handle the UUID fields (it defaulted to turning them into strings), I *did* find the information I would need if I *had.* Is Sequel 'better' or more capable than ActiveRecord? I really don't know. Did its documentation make it easier for *me* to do what *I* need to do? Unquestionably. 

I spent two hours with Padrino before I ran into a problem that I was unable to solve from the documentation. Nor were the helpful folks in the #Padrino IRC room able to fix my issue. I'm sure it's *possible* to make it work, but again, I'd spent a fair amount of those two hours just trying to hunt down answers to fairly trivial issues. So I decided to look at the other strong candidate on my 'frameworks' list, Ramaze. 

Two hours of work with Ramaze had me with a browser full of data from my database. 

There's no doubt in my mind that Rails has more out-of-the-box ready-to-go functionality than Ramaze. But the overwhelming majority of Rails-world is intensely infused with the philosophy that, while you *can* make your web site any number of ways, what you *want* to do is start with your Ruby objects, and be able to switch from one data store to another at a moment's notice. 

Rails and its cloud of associated components are clearly groovy nifty tools. But just as clearly, they are not the right tools for *me.*






In This Thread

Prev Next