Codedrop™ Weblog

Drop’n some code and other tech tidbits…
  • Home
  • Google Shared
  • About Me
  • Reference Links
Rss feed Subscribe

Entries for the ‘Rails’ Category

Add some color to your Capistrano scripts

Nov.27, 2009 in Rails Comments Off

The beauty of ruby makes it simple to add some colorful syntax highlighting to log messages that are displayed in your capistrano scripts.  Here’s a chunk of code I added to my utility.rb file that is included by my capfile that performs the magic.

def colorize(text, color_code)
“#{color_code}#{text}\033[0m"
end

def red(text); colorize(text, "\033[31m"); end
def boldred(text); colorize(text, "\033[1;31m"); end
def green(text); [...]

Capistrano Callbacks

Nov.18, 2009 in Build Automation, Rails Comments Off

Neat way to pre-initalize something in capistrano before a task is run
on :start do verifyParametersAndInitialize()end
callback options:

:before, triggered before a task is invoked
:after, triggered after a task is invoked
:start, triggered before a top-level task is invoked via the command-line
:finish, triggered when a top-level task completes
:load, triggered after all recipes have [...]

Tags: Capistrano

Dynamic fields in YAML file.

Jan.26, 2009 in Rails Comments Off

Recently I had the need to setup environment specific .yml files for email configuration.  Normally this goes off without a hitch, however in my case I had the additional requirement of being able to dynamically substitute values in the yml file at runtime.   I thought it would be nice to allow configuration of email to, [...]

Tags: Rails, Ruby

Rails rake tests randomly generate ORA-12520 errors.

Jan.05, 2009 in Rails Comments Off

If you find your application randomly throwing “ORA-12520: TNS:listener could not find available handler for requested type of server” errors, then try to increase the number of available processes that you have allocated to your Oracle instance.
Logon to
Oracle using sys as sysdba and execute the following:
ALTER SYSTEM SET PROCESSES=150 SCOPE=SPFILE;
After changing the PROCESSES parameter restart [...]

Tags: Rails
  
  • Tag Cloud

    Blackberry Capistrano certificate Configuration CSS DNS-323 DOS Dreamhost EMS Fedora firebug GMail Google Grails Groovy ie Java jQuery JSF Linux Mac Mac OSX MacPorts Memory Migrations Oracle PERL Rails Ruby Safari SOAP WebService Spring SSL Tibco Time Machine toolbar Trac UI video sony m2ts vlc VMWare Windows XMLDB

    WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

  • Blogroll

    • A List Apart
    • Anassina
    • Just Be Kuz
    • Mashable
    • Poker Dreams Online
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Calendar

    September 2010
    M T W T F S S
    « May    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  
  • Categories

    • Databases (5)
      • Oracle (4)
    • Dreamhost (1)
    • General (25)
    • Google (1)
    • Mobile (1)
    • OS (17)
      • Linux (11)
      • Mac OSX (5)
      • Windows (2)
    • Programming (26)
      • Build Automation (3)
      • Grails (1)
      • Java (8)
      • JBoss (1)
      • jQuery (1)
      • JSF (1)
      • MySQL (1)
      • PERL (1)
      • Rails (4)
      • Ruby (3)
    • Security (1)
    • Spring (1)
    • Tibco (4)
  • Recent Posts

    • How to address TIBCO (Send HTTP Request) SSL Certificate Problems
    • Grails and Oracle XMLDB (XMLType)
    • Getting ‘YYYYMMDDhhmmss’ date format in a MS Windows script… yuck!
    • Mysql, Rmagick on Snow Leopard, Homebrew to the rescue!
    • Use your DNS-323 for Time Machine backups.


Green Web Hosting! This site hosted by DreamHost.

© 2007 Codedrop™ Weblog - SafiTech Theme

Full RSS - Comments RSS

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.