Skip to content

Instantly share code, notes, and snippets.

View cthos's full-sized avatar
🤔

Alexander Ward cthos

🤔
View GitHub Profile
@cthos
cthos / laravel_entity_gen.rb
Created March 4, 2012 20:22 — forked from JonTheWhite/laravel_entity_gen.rb
Laravel Entity Generator
require 'ruble'
command 'Generate Entity Getter/Setters' do |cmd|
cmd.key_binding = 'M1+M2+G'
cmd.scope = 'source.php'
cmd.output = :replace_document
cmd.input = :document
cmd.invoke do |context|
file = context.TM_SELECTED_FILES.match(/([a-zA-Z0-9]+)\.php/)[1]
line = STDIN.read
columns = line.scan(/@Column\(name="([^"]+)", type="([^"]+)"/)