Skip to content

Instantly share code, notes, and snippets.

@rwilcox
Created June 9, 2010 16:33
Show Gist options
  • Save rwilcox/431757 to your computer and use it in GitHub Desktop.
Save rwilcox/431757 to your computer and use it in GitHub Desktop.
{ scopeName = 'source.ruby.rails.aasm';
fileTypes = ( 'rb', 'rxml', 'builder' );
patterns = (
{ name = 'meta.rails.model';
comment = "Uses lookahead to match classes that (may) inherit from ActiveRecord::Base; includes 'source.ruby' to avoid infinite recursion";
begin = '(^\s*)(?=class\s+.+ActiveRecord::Base)';
end = '^\1(?=end)\b';
patterns = (
{ include = '$self'; },
{ include = 'source.ruby'; },
{ include = 'source.ruby.rails'; },
);
},
{ name = 'source.ruby.rails.aasm.event';
match = 'aasm_event\W*:(\w+)';
captures = { 1 = { name = 'keyword.other.context.ruby.rails.aasm.event'; }; };
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment