Archive for the ‘Ruby’

Rails 2.3.5 on Dreamhost (Shared Hosting)11.29.09

Today, I started a new project. A minimalistic bug tracker that should really work under Dreamhost. The only reason I need this to work on Dreamhost is because bills begin to add up after having a few VPS accounts and I’m trying to cut my spending and since Dreamhost gives me unlimited disk space and bandwidth I figure I will use it and yes I know I can use GitHub but that cost money for private repositories.

I installed the latest rails using sudo gem install rails –version 2.3.5 and I got Capistrano all set-up and was able to deploy. Now the only thing that took almost all day was trying to figure out why rails would not process the request. So I did “rake rails:freeze:gems” to freeze the gems. Once I did that I was having problems with Rack version 1.0 already activated and I hacked around RubyGems to see if I can deactivate it but I didn’t find anyway of doing that. I also googled a ton of searched but found nothing.

What did work was to modify the rails core, ActionController to be specific in file:

vendor/rails/actionpack/lib/action_controller.rb

I modified lines 34 and 35 and commented them out.
I then added the following:

load "#{RAILS_ROOT}/vendor/gems/rack-1.0.1/lib/rack.rb"

the end result look like this:

#gem 'rack', '~> 1.0.1'
#require 'rack'
load "#{RAILS_ROOT}/vendor/gems/rack-1.0.1/lib/rack.rb"

which after doing that, it ALL worked well. Now I can continue with building my app.

Posted in Me, Programming, Projects, Ruby, Ruby On Railswith No Comments →

Skatr for iPhone04.15.09

skatr for iphone

It’s been a little over 4 months of development for my iPhone app. This does not mean just coding for the iPhone app but also working on the back-end server side, creating an API for Skatr to use, and later  become a public API for others to consume.

Things I did for the 4 months of development.

First month, Start from scratch to rewrite www.skatr.us from PHP over to Ruby using the Merb Framework. Although that went short after the announcement of Merb & Rails merge. I figured I needed to port things over to Rails now because eventually Merb will be less supported and the other reason was I already know Rails and Merb was sometimes challenging because I did not know it.

Second Month, Write lots of code to port it form Merb over to Rails and Begin writing the API that will be consumed by Skatr. Also go shopping for a Web Host to host the Web App. I started to re-read books I had on Objective-C and Cocoa and bought a few books and screencasts on iPhone development and paid $99 to Apple to be part of the iPhone Developer program. Started writing code for Skatr.

Third Month, Write Ruby Code and Objective-C code for Skatr Web and Skatr iPhone, Also make a ton of google searches to learn how things are done in iPhone land.

Fourth Month, Complete writing Skatr for iPhone and the web API for Skatr.

It was actually a lot of work doing all this considering I was working at my full-time job and not just a 8 hour job but a few days with emergency releases working over 10 hours. Also to mention it takes me almost a little under 2 hours to commute from work to home because of traffic and then I would continue with my iPhone app till usually around 12:00 AM sometimes 1:00 AM and other days when literally my eyelids where already closed and realizing I’m sleeping and I need to go to bed. It was very tiring. Then wake up early for work and continue the same pattern for about 4 months.

Now that Skatr is completed. I’ve submitted it to Apple, hoping it does not get rejected. Let’s see what happens now. Then hopefully take a vacation?

Posted in Me, Objective-C, Projects, Ruby, Ruby On Rails, iPhone, skatrwith No Comments →

Development: Skatr, Update12.31.08

As I wrote earlier, I was trying to release skatr.us on the first of january but unfortunately that is not going to happen. I just don’t have the strength to pull it off.. I’m going to push back the release date for Skatr for mid February, I think that is a good enough time, thats like 8 full-days to work on it plus whatever time I have after work. I’m sure I’ll get it done, it’s better than half-complete.

Happy New Year!

Posted in Me, Programming, Projects, Ruby, Ruby On Railswith No Comments →

Development update: Skatr12.26.08

Just a small updated on my development of skatr. It’s almost ready to go for beta release.

If anyone has taken notice, the site is currently down on purpose. I figure I will take it down it gives me more reason to complete my project. The site is being developed using the Merb Framework. After reading some news about Merb being Merged into Rails 3, was actually good I think. Anyways, my project skatr.us will be up live sometime soon, I’m aiming for the first of January, of course this will be beta release and I say beta because things might not be correct on the site, etc..

Posted in Me, Programming, Projects, Ruby, Uncategorizedwith No Comments →

LA Ruby #409.19.08

So the day as come and gone. LA Ruby was a hit. This time it was over at Los Angeles Times building in Downtown Los Angeles CA. It was great to see many new people. It continues to grow. More good things are coming along the way. I met some guys from a startup called Vokle.com and they are using Merb instead of Rails. The idea behind it sounds cool. So I’ve posted a their video and the music for it awesome.

Posted in Meetup, Ruby, Ruby On Rails, videowith 2 Comments →

RubyCocoa – Hello World09.13.08

So after dicussing with myself. I figure why re-invent the wheel. So here is a screencast of RubyCocoa.

Posted in Mac, Ruby, videowith 1 Comment →

RubyCocoa09.12.08

For while now, I’ve been learning Objective-C, and while I’m writing in Ruby more often I figure I would also learn RubyCocoa. I figure I’m going to create a few screencasts on getting started with RubyCocoa and anything I learn with it. If you don’t know what RubyCocoa is, it is described as:

“…a bridge between the Ruby and the Objective-C languages, allowing you to manipulate Objective-C objects from Ruby, and vice-versa. It lets you write full-stack Cocoa applications in Ruby…”

Posted in Mac, Programming, Rubywith No Comments →

LA Ruby Meetup 6/1906.19.08

LA Ruby Meetup was very cool. So I was the first to be at the scene. I helped bring the food to the room since I was in the lobby and greeted by Jody. I meet and greeted all of the LA Times people. Also meet some guy from Yahoo!, sorry I forgot your name already, and one from heroku, BizQuest another from PGP, and another from Experian. As-well as more but I sorta forgot everyones name already… or at least I can’t remember them, yet.

If you’re in the Los Angeles Area check it out.
Yellowpages.com will be hosting LA Ruby Meetup #2 on July 17 2008, so mark that in your calendar. Join the Yahoo Group, LARuby

Posted in Me, Meetup, Programming, Ruby, Ruby On Railswith 1 Comment →

Something in Ruby05.30.08

#!/usr/bin/env ruby

String.class_eval {
  define_method(:translate_to) do |lang|
    text = case lang
           when :spanish
           "Buenos Dias, Como estas hoy?"
           when :english
           "Good Morning, How are you today?"
           else
           "I don't speak any other language."
           end
  end
}

puts "Sentence".translate_to :spanish
# => Prints out "Buenos Dias, Como estas hoy?"

puts "Sentence".translate_to :english
# => Prints out "Good Morning, How are you today?"

puts "Setenece".translate_to :portuguese
# => Prints out "I don't speak any other language."

puts "Sentence"
# => Prints out "Sentence"

So while messing round I made this in Ruby… I’m not sure if it is considered meta programming? Well, it’s just adding a method to the String class. I get confused when to consider things to be meta programming.. Maybe I over think about it.

Posted in Programming, Rubywith 1 Comment →

Heroku Invites05.25.08

Ruby On Rails Heroku Beta Invites

So I received an invite for heroku a while ago. I never really used it. Want an invite to check out heroku.com? I have many invites to give away. Want one? just leave your email and I will send you one your way!

Posted in Ruby, Ruby On Railswith 15 Comments →

Rails on Dreamhost05.21.08

Dreamhost now supports mod_rails Passanger.

Posted in Ruby, Ruby On Railswith No Comments →

Passenger – mod_rails for Apache04.11.08

So even if you have never set-upped a Rails Application to Production server there is still hope for you. Introducing Passenger a mod_rails for Apache… Make it super simple to deploy apps just like PHP. Check it out over at modrails.com 

Posted in Ruby, Ruby On Railswith 2 Comments →

Ruby Technique: Meta Programming03.02.08

Meta Programming is code that writes code. See the code sample below.
I have made a screencast of this process. View it here

#!/usr/bin/env ruby

class Product
  def initialize(items)
    items.each {|item| Product.product(item) }
  end

  def self.product(item)
    code = %Q{
      def add_#{item}(item)
        @#{item} = [] unless @#{item}
        @#{item} << item
      end

      def display_#{item}s
        @#{item}.each {|item| puts item }
      end
    }
    class_eval(code)
  end
end

class Item < Product
  def initialize(*items)
    super(items)
  end
end

cart = Item.new(:book, :computer, :music)
cart.add_book(:Ruby) # => Add a book to our cart items

cart.display_books # => We want to display All books we have added
puts "\n"

cart.add_computer(:Apple)
cart.add_computer( :D ell)
cart.add_computer(:Sony)
cart.display_computers # => Display All Computers
puts "\n"

cart.add_music(’Modest Mouse‘)
cart.add_music(’Northstar‘)
cart.display_musics # => Display All Music Items

Posted in Programming, Rubywith No Comments →

Ruby Code Snippet01.13.08

In Ruby a switch statement looks like this

say = "Hello"

case say
when "Hello" then
	puts "Say Hello"
when "Bye" then
	puts "Say Bye"
end

In PHP a switch statement looks like this


Posted in Programming, Rubywith No Comments →

Ruby MySpace Status Updater01.05.08

I have written a MySpace Status Updater class in Ruby. So if you want it take it, download it, use it.Download Here Or Download the RubyGem 

How do you use it?

credentials = {:username => ”, :password => ”, :status => %q(Okay Now I am really Done!…)}

@status = MySpace.update_status(credentials) 

Posted in Rubywith 2 Comments →

  • Recent Comments

    • Wilbur Smoke: It’s a great day for Americans. Lastly the war in Iraq ended.
    • celebrity fuck you: Sign: zdbrw Hello!!! cdkgz and 9036xdsnusbqsp and 9027 : Hi! I was surfing and found your blog...
    • WellWisher: What the bullshit this link is not working : http://fernyb.net/myspace/api/
    • Salvador Leconey: Wassup thanks for the post.
    • Mauro Kofa: Very Nice article. Also, loving the blog design. I had a similar blog to yours before I sold it on.

    Recent Listened to Tracks

    Loading...

Bad Behavior has blocked 141 access attempts in the last 7 days.

eastern-avalanche
eastern-avalanche
eastern-avalanche
eastern-avalanche