Sublime text default indentation per extension

To limit a syntax configuration to Ruby files, first open up a Ruby file in the editor, and then go to Preferences -> Settings -> More -> Syntax Specific -> User. This should open a settings window named Ruby.sublime-settings

Save these settings:

{
  "tab_size": 2,
  "translate_tabs_to_spaces": true
}

Repeat for any other syntax types by opening a file of that type and going back to the preferences to open the correct preferences file for that syntax.