rails

Autocompleting ssh, rake, cap command parameters using PowerShell

I have mentioned in my previous posts that PowerShell has excellent and customizabme autocompletion support.
And some awesome plugins like powertab exist to take this functionality to another level.
Here is one easy way you can customize autocompletion easily by writing a couple of lines of code.

Open your PowerShell profile file (for help see here) and create a function with name "global:TabExpansion" in it.
This function basically overrides default autocompletion and sends your values to the prompt. For example for it to read your ssh files and display hosts in it the function would look something like this:

# customized tab expansion
function global:TabExpansion {
  param($line, $lastWord)
  
  if ($line -match 'ssh'){
    return cat C:\Users\Gaurav\.ssh\config | Select-String '^Host ' | % { if($_.Line -match "^Host ($lastword\S*)" ){ $matches[1] }}
  }
}

› Continue reading

Sunday, November 23rd, 2008 powerpoint, rails, ssh No Comments

Using Flex with Ruby on Rails

This is the second blog post in a series of three posts comparing Flex with Silverlight. In my previous post I demonstrated how to integrate a scaffolded Rails application with Silverlight. Here I will be showing the same with Flex. The steps needed to create the Rails application are also mentioned here.

 

Creating a new Flex project:

Open Flex builder and create a new Flex project.

image

Leave all the options to default and click Finish. A blank project is now created for you.

› Continue reading

Wednesday, March 26th, 2008 adobe, flex, mxml, rails, ruby, ruby on rails, silverlight, xaml 3 Comments

Using Silverlight with Ruby on Rails

In this post I will be showing a really simple example of creating a Silverlight frontend for a Rails backend. This is what I think will be a three part series comparing Silverlight with Flex.

The steps will be:

  1. Creating a Rails application.
  2. Creating a frontend for it in silverlight.
  3. Creating a frontend for it in Flex.
  4. Comparing the approaches taken in both the frontends.

I will try to keep changes in the backend Rails application to a minimum.

› Continue reading

Wednesday, March 26th, 2008 C#, adobe, crud, flex, microsoft, mxml, rails, ruby, ruby on rails, silverlight, xaml 4 Comments