Refactor ruby.snip