ruby

How to sell Python to a client/boss/person with lots of cash

When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?...

Learning Ruby on Rails any good for Grails?

My company is in the process of starting down the Grails path. The reason for that is that the current developers are heavy on Java but felt the need for a MVC-style language for some future web development projects. Personally, I'm coming from the design/usability world, but as I take more "front-end" responsibilities I'm starting to fe...

What is the best way to learn Ruby?

How do I go about learning Ruby quickly and easily without buying expensive programming books?...

How can I encode xml files to xfdl (base64-gzip)?

Before reading anything else, please take time to read the original thread. A quick simple overview: A .xfdl file is a is a gzipped .xml file which has then been encoded in base64. I wish to de-encode the .xfdl into xml which I can then modify and then re-encode back into a .xfdl file. xfdl > xml.gz > xml > xml.gz > xfdl I have been...

Best place to get Ruby on Vista up and running as dev environment

thanks for the nod on the title... But that was the point of the question... ...

Why doesn't Ruby have a real StringBuffer or StringIO?

I recently read a nice post on using StringIO in Ruby. What the author doesn't mention, though, is that StringIO is just an "I." There's no "O." You can't do this, for example: s = StringIO.new s << 'foo' s << 'bar' s.to_s # => should be "foo\nbar" # => really is ''` Ruby really needs a StringBuffer just like the one Java has. Stri...

How do I write those cool command line code generators (rails, sproutcore, webgen)

I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command... ...

Ruby mixins and calling super methods

Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can include where I need it. So far, so good. Looks like it's going to work out...

Drawing Library for Ruby

I am trying to code a flowchart generator for a language using Ruby. I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes. I would really prefer not having to write code for drawing basic shapes, if I can help it. If someone could po...

Why does sqlite3-ruby-1.2.2 not work on OS X?

I am running OS X 10.5, Ruby 1.8.6, Rails 2.1, and sqlite3-ruby 1.2.2 and I get the following error when trying to rake db:migrate on an app that works find connected to MySQL. rake aborted! no such file to load -- sqlite3/database ...

What do the different brackets in Ruby Mean?

In Ruby, what's the difference between {} and []? {} seems to be used for both code blocks and hashes. are [] only for arrays? The documention isn't very clear. ...

Why Doesn't My Cron Job Work Properly?

I have a cron job on an Ubuntu Hardy VPS that only half works and I can't work out why. The job is a Ruby script that uses mysqldump to back up a MySQL database used by a Rails application, which is then gzipped and uploaded to a remote server using SFTP. The gzip file is created and copied successfully but it's always zero bytes. Yet i...

OpenID authentication in Ruby on Rails

I am a neophyte with Ruby on Rails but I've created a couple of small apps. Anyway, I'm really interested in OpenID and I would like to implement OpenID authentication and maybe some Sreg stuff in a Rails app. All of the research that I have done has come up with articles that are out of date or just don't work for me. Since I'm so new t...

How do I access the Ruby AST from C level code?

I understand that the Ruby 1.8 AST is traversed at runtime using a big switch statement, and many things like calling a method in a class or parent module involve the interpreter looking up and down the tree as it goes. Is there a straightforward way of accessing this AST in a Ruby C extension? Does it involve the Ruby extension API, or ...

Is Ruby On Rails ready for the Enterprise?

Is anyone out there using RoR for large scale, business critical enterprise applications? Are there any other lightweight web-frameworks based on dynamic languages that people are using for these types of apps? If you're not using these types of application frameworks what's stopping you? Is it simply the inertia associated with any l...

What IDE to use for developing in Ruby on Rails on windows?

I've generally been doing stuff on Microsoft .Net out of college almost 2 years ago. I just started looking at Ruby on rails. So what editor should I use? I'm using Notepad++ right now but can I get debugging etc. somehow? ...

Ruby error "Superclass mismatch for class Tempfile"

A while back I migrated a ruby webapp (using eRuby - note: Not Rails) to my new server and in the process it seems to have got broken. I get the error "/usr/lib/ruby/1.8/tempfile.rb:12: superclass mismatch for class Tempfile (TypeError)". I can't see what changed in the migration - all the code stayed exactly the same. I've tried stripp...

JRuby / Rack deployment

I know this is pretty exotic, but I want to deploy a Ruby web application (not Rails, but Rack based, so it plugs into most Ruby servers just fine) using JRuby. Google and friends give me a few success stories, but mostly rails related and if not, no details on the deployment are provided. The framework I'm using is Ramaze, if it matters...

What Ruby IDE do you prefer?

I've been using Eclipse with RDT (not RadRails) a lot lately, and I'm quite happy with it, but I'm wondering if you guys know any decent alternatives. I know NetBeans also supports Ruby these days, but I'm not sure what it has to offer over Eclipse. Please, list any features you think are brilliant or useful when suggesting an IDE, make...

Ruby blocks/Java closures in C

I've been trying to understand how Ruby blocks work, and to do that I've been trying to implement them in C (^_^). One easy way to implement closures is to pass a void* to the enclosing stack to the closure/function but Ruby blocks also seem to handle returns and break statements from the scope that uses the block. loop do break i if...