Plugin for this task.
To create a new plugin, select Tools-> Developer-> New Plugin...
API Reference
To create a shortcut, select Preferences->Key Bindings then user settings(right side)
{ "keys": ["ctrl+i"], "command": "ruby"}
{ "keys": ["ctrl+i"], "command": "ruby"}