Arun Gupta, Miles to go ...

Arun Gupta is a technology enthusiast, a passionate runner, and a community guy who works for Sun Microsystems.
« Previous day (Sep 3, 2007) | Main | Next day (Sep 5, 2007) »

http://blogs.sun.com/arungupta/date/20070904 Tuesday September 04, 2007

PG&E - running all the way and 30 mile weekend

I first ran Rancho PG&E trail around 8 years ago and have run it multiple times every year since then. I start from the first parking lot (one with the Equestrian parking), go all the way up (running and walking) along the PG&E electricity poles and then always run downhill.

For the past few months I've been trying to run the entire trail (both uphill & downhill) and came close to it 3 weeks ago. Finally, I did it yesterday - took me 48 min 57 secs. I maintained a consistent pace through out the run and I think that helped a lot. I hope to improve the timings in the months to come.

Also last weekend was my first 30-mile weekend. Basically, it was a mix of 22 miles bike on Sunday and 9 miles run on Monday with a total > 30 miles. I hope to have at least one 30 mile weekend once a month.

Technorati: running 30miler uphill

del.icio.us | furl | simpy | slashdot | technorati | digg |
|

TOTD #6: Difference between Ruby Gem and Rails Plugin

As a newbie to Rails, "Gem" and "Plugin" terminology was slightly confusing to me. Specifically I saw the terms being used interchangeably sometimes. This TOTD highlights the difference between Ruby Gem and Rails Plugin.

Ruby Gem and Plugin are both packaging systems - the main difference is the scope in which they are effective. The common differences are highlighted in the table below.

Topic Ruby Gem Rails Plugin
Definition A Gem is a packaged Ruby application using the packaging system defined by RubyGems. A Rails plugin is a packaged Ruby application that extends the core Rails framework.
Example Has a name (e.g. rake) and a version (e.g. 0.4.16). Rails is also installed as a Gem. Has a name (e.g. Goldspike) and a version (e.g. 1.1.1).
Scope Installed in the Ruby or JRuby installation and is available to all applications run using that interpreter. Installed in a specific Rails app only.
Packaging System Rails gem is installed in jruby-1.0\lib\ruby\gems\1.8\gems\rails-1.2.3 as:

<DIR>        bin
<DIR>        builtin
      68,465 CHANGELOG
<DIR>        configs
<DIR>        dispatches
<DIR>        doc
<DIR>        environments
307          fresh_rakefile
<DIR>        helpers
<DIR>        html
<DIR>        lib
       1,072 MIT-LICENSE
      11,969 Rakefile
       8,001 README

The lib directory contains all the gem source code.

Goldspike plugin is installed in vendor\plugins\rails-integration directory of the application as:

      7,089 build.xml
      1,141 LICENSE.txt
<DIR>       plugins
      6,675 pom.xml
      1,447 README
<DIR>       samples

plugins/goldspike directory consists of

         24 init.rb
         25 install.rb
<DIR>       lib
        549 Rakefile
        536 README
<DIR>       tasks
<DIR>       test

The lib directory contains all the plugin source code.

Management Gems are managed on your computer using the gem command. You can install, remove and query gem packages using the gem command. Plugins can be installed using after creating a Rails application and then invoking the command

ruby script\plugin install [url or name of plugin]
Load Path gem command adds the lib directory of your gem to the load path of Ruby. Rails adds the lib directory of plugin in your application's load path.
Specific Features  
  • Bundled Rake tasks that get automatically loaded into your Rakefile
  • An installation hook (install.rb)
  • An application initialization hook for the plugin to inject itself (init.rb)
  • ability to bundle additional generators (for the script/generate script)
Publish Format A Gem may be published as Plugin, for example ActiveRecord-JDBC. A Plugin cannot be published as Gem.

Here are some useful entries (with numerous pointers on screencasts, blogs, tips & extensive feature sets) to get you started with JRuby:

Are there any other main differences that I missed ?

Please leave suggestions on other TOTD that you'd like to see. A complete archive is available here.

Technorati: totd rubyonrails rubygem railsplugin netbeans glassfish

del.icio.us | furl | simpy | slashdot | technorati | digg |
|
« Previous day (Sep 3, 2007) | Main | Next day (Sep 5, 2007) »

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.