Wednesday, November 30, 2011

script console for jruby rails

inside your rails root directory

<system java path>/java -client  -Xbootclasspath/a:<path to jruby jar>/jruby-complete-1.6.2.jar   -Djruby.shell=/bin/sh org.jruby.Main script/console

useful for investigating stuff on production boxes if jruby is not installed on commandline.

Jruby on Rails + Quartz + log4j

If you want your custom quartz.properties file to be picked up, please make sure you configure this in your web.xml or web.xml.erb
<servlet>
     <servlet-name>QuartzInitializer</servlet-name>
     <display-name> Quartz Initializer Servlet</display-name>
     <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
     <init-param>
         <param-name>config-file</param-name>
         <param-value>WEB-INF/lib/quartz.properties</param-value>
     </init-param>
     <init-param>
         <param-name>shutdown-on-unload</param-name>
         <param-value>true</param-value>
     </init-param>
     <init-param>
         <param-name>start-scheduler-on-load</param-name>
         <param-value>true</param-value>
     </init-param>
 </servlet>


and you want  your log4j properties to be picked up
<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>WEB-INF/lib/frlog4j.properties</param-value>
  </context-param>
<listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>

Friday, June 10, 2011

Google Directions with Weather

So finally I updated my new appspot application with the weather and directions rails app that I was procrastinating for a very long time, got its own website address instead of the appspot address.

weathermaps.rajasekharkonuru.com/maps/show


its still very premature and may not be very intuitive, but what it does is you can either mark origin and destination on the map or type the origin and destination input entries and when you click "Get Directions" it will draw a route which is expected but it will also mark weather condition at every turn through out the route (where ever possible) , for longer routes it might not load by throwing an error, but for shorter routes it should load (may be will be slow) , try it out.

Source code is at https://github.com/ksekhar/weathermaps

It might be very ugly code though :), I am refactoring, probably will need to put in some specs and tests.

Wednesday, June 1, 2011

Appspot + Jruby 1.6.2 + Rails 2.3.11

So I successfully uploaded my Rails application to appspot, phew that was NOT a breeze, but still thanks to http://code.google.com/p/appengine-jruby/ and http://code.google.com/p/appengine-jruby/
Now lets ride on rails.

Wednesday, May 25, 2011

Netbeans + rvm = Awesome

Maybe not a news but just wanted to share what difference it makes when netbeans with its really well worked out ruby platform manager and rvm enabling you to install any ruby version out there they really make life work.

I can happily maintain and develop
rails 1.2 on ruby 1.8.6
rails 2.3.3 on jruby 1.3.1
rails 3.0 on ruby 1.9
rails 2.3.11 on jruby 1.6.2

Its simply AWESOME