ruby 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #------------------------------------------------------------------------------
  2. # $File: ruby,v 1.6 2016/07/27 09:46:29 rrt Exp $
  3. # ruby: file(1) magic for Ruby scripting language
  4. # URL: http://www.ruby-lang.org/
  5. # From: Reuben Thomas <rrt@sc3d.org>
  6. # Ruby scripts
  7. 0 search/1/w #!\ /usr/bin/ruby Ruby script text executable
  8. !:strength + 15
  9. !:mime text/x-ruby
  10. 0 search/1/w #!\ /usr/local/bin/ruby Ruby script text executable
  11. !:strength + 15
  12. !:mime text/x-ruby
  13. 0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
  14. !:strength + 15
  15. !:mime text/x-ruby
  16. 0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
  17. !:strength + 15
  18. !:mime text/x-ruby
  19. # What looks like ruby, but does not have a shebang
  20. # (modules and such)
  21. # From: Lubomir Rintel <lkundrak@v3.sk>
  22. 0 regex \^[\ \t]*require[\ \t]'[A-Za-z_/]+'
  23. >0 regex include\ [A-Z]|def\ [a-z]|\ do$
  24. >>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby script text
  25. !:mime text/x-ruby
  26. 0 regex \^[\ \t]*(class|module)[\ \t][A-Z]
  27. >0 regex (modul|includ)e\ [A-Z]|def\ [a-z]
  28. >>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby module source text
  29. !:mime text/x-ruby