Feeds:
Posts
Comments

Archive for the ‘Ruby and Ruby On Rails’ Category

I was working with struts validators and need to test a phone number to be digits and starts with a leading 00, I wanna share it here

^00+\d{9,17}$
below is a ruby code snippet:
phone_no=”009621111111″
if phone_no =~ /^00+\d{0,9}$/

puts “match”

else
puts “No match”
end

a quick explain is
^ start from the beginning of the string
+\d{9,17} should include digits with at [...]

Read Full Post »

Today I installed Netbeans 6 and my first Impression is Wow! I will be posting in-depth look at netbeans-6.0 later.
but, what is new on netbeans-6.0?
Editor Improvements

Smarter code completion
Highlights
Better Navigation and Inspection
Live Templates and Surround Functionality

Ruby/JRuby/Ruby on Rails Support

Project support including Gems and RSpec
Advanced Ruby Editing
ActiveRecord Code Completion
Ruby Debugger
Ruby on Rails Support

Profiling

Profiler integrated into NetBeans IDE
Compare [...]

Read Full Post »

Ruby and Yaml

Yaml (Yet Another markup language) allows developers to serialize and deserialize Object to files and still human readable and editable. in short!
I will explain how to load, save, update yaml file using ruby (Yaml4r). a sample source code can be found at the end of this article
As always: busy developer walk through:

Installation

gem install RbYAML

Usage

Tip! [...]

Read Full Post »

This is a busy developer tutorial that walk through installing ruby on rails on Linux Machine.
get Downloads ready

type yum install ruby rdoc irb
Rubygems from http://www.rubyonrails.com/down

unzip the package.

type ruby setup.rb

type gem update
type gem install rails –include-dependencies
choose your lovely database: we will be using mysql for this tutorial; so, that requires us to install mysql

type yum [...]

Read Full Post »