spariamsgems

Ruby, Ruby on Rails

Sunday, March 23, 2008

Blog Change

Well, for now I've decided it's too much of a hassle to maintain a separate blog strictly for Rails, so I'll be posting everything to my main tech blog, kl93. See you there...

Saturday, January 5, 2008

Install Ruby without openssl

When installing Ruby on an old machine, I got this error:


ruby make[1]: *** [ossl_ssl.o] Error 1


Other than installing openssl, which wasn't option, install ruby without openssl:


$ ./configure prefix=/home/doug/bin/ruby --without-openssl

Autotesting Javascript in Rails

From Dr. Nic's Blog:

Autotesting Javascript in Rails

Thursday, January 3, 2008

Upgrading to specific version of Rails


sudo gem install -v=2.0.1 rails --include-dependencies

Tuesday, December 11, 2007

Ruby Database Connectivity

After mostly doing RoR work for the last several months, lately I've had to write a few command line scripts that interact with MySQL.

I came across an article by Steve Litt on Troubleshooters.com, which I found useful for comparing the mysql driver, dbi, and ActiveRecord:

Ruby Database Connectivity

And here a few articles by Paul DuBois on Ruby and database connectivity:

Using the Ruby MySQL Module

Using the Ruby DBI Module

My First RubyGem

I rewrote and converted one of my old sourceforge projects from C++ to a Ruby Gem:

http://delaycalc.rubyforge.org/

Nothing too earth shattering, but it's certainly nice to get an open source project on Rubyforge....

If you need to calculate delay times for digital delay processors for a given bpm, then please give it a go:

$ sudo gem install delaycalc

RubyGem - HighLine

I was looking for a way to prompt a user for input on the console and ran across the RubyGem HighLine. It does a lot more than this, but here's how to capture STDIN from the console:

#!/usr/local/bin/ruby
require 'rubygems'
require 'highline/import'

username = ask("Enter your username: ") { |q| q.echo = true }
password = ask("Enter your password: ") { |q| q.echo = "*" }

Here's the output on the console:

$ ruby highline.rb
Enter your username: doug
Enter your password: ******

Get it here:

HighLine

or simply install the gem the normal way:

$ sudo gem install highline

About Me

My photo
Developer (Ruby on Rails, iOS), musician/composer, Buddhist, HSP, Vegan, Aspie.