class File # Feel free to add more here, as you need them. Extensions = %r=^(txt|rb|markdown|textile|haml|sass|css|html|xhtml)$=i module Extension def method_missing(meth, *args) if Extensions =~ meth.to_s [self, '.', meth.to_s].join else super end # if end # method_missing end # Extension end # File class Symbol include File::Extension end class String include File::Extension end
'myfile'.html # => "myfile.html" :a_file.rb # => "a_file.rb"
def method_missing(meth, *args) [self, '.', meth.to_s].join ? Extentions =~ meth.to_s : super endYanno.. to make it purdy?