snippets.rb: Titanium Studio Snippets Ruble Customizations

Posted by Quinn Madson | Posted in | Posted on 8:54 AM

1

This here is just a space for holding my Titanium Studio customizations to extend or overwrite the provided ruble for snippets. Feel free to use them and let me know if you have any additions that help you code faster.

snippet 'inspectObject' do |s|
    s.trigger = "inspect"
    s.expansion = 
'Ti.API.info("Inspecting Object: " + ${1:myObject});
for (var thing in ${1:myObject}) {
  Ti.API.info("${1:myObject}." + thing + " = " + ${1:myObject}[thing]);
}'
  end
  
  snippet 'Ti.API.info qk' do |s|
    s.trigger = 'dump'
    s.expansion = 'Ti.API.info(\'[qk]:${1:variableName}\ = \' + ${1:variableName});'
  end
  
  snippet 'Alloy On Event' do |s|
    s.trigger = 'on'
    s.expansion = 
'${1:myObject}.on("${2:click}", function(e){
    
});'
  end
  
  snippet 'Ti.API.info' do |s|
    s.trigger = 'info'
    s.expansion = 'Ti.API.info("${0:log}");'
  end
  

Comments (1)

Awesome snippets! Very useful.